标签归档:MySQL Replication

How to setup a slave for replication in 6 simple steps with Percona XtraBackup

Data is, by far, the most valuable part of a system. Having a backup done systematically and available for a rapid recovery in case of failure is admittedly essential to a system. However, it is not common practice because of its costs, infrastructure needed or even the boredom associated to the task. Percona XtraBackup is designed to solve this problem.

You can have almost real-time backups in 6 simple steps by setting up a replication environment with Percona XtraBackup.

Percona XtraBackup is a tool for backing up your data extremely easy and without interruption. It performs “hot backups” on unmodified versions of MySQL servers (5.1, 5.5 and 5.6), as well as MariaDB and Percona Servers. It is a totally free and open source software distributed only under the GPLv2 license. 继续阅读

MySQL的复制原理及配置

MySQL的复制原理及配置

mysql的数据库的高可用性的架构大概有以下几种:集群,读写分离,主备。而后面两种都是通过复制来实现的。下面将简单介绍复制的原理及配置,以及一些常见的问题。 继续阅读

MySQL Replication(复制)基本原理

1、复制进程
Mysql的复制(replication)是一个异步的复制,从一个Mysql instace(称之为Master)复制到另一个Mysql instance(称之Slave)。实现整个复制操作主要由三个进程完成的,其中两个进程在Slave(Sql进程和IO进程),另外一个进程在 Master(IO进程)上。 继续阅读

MySQL 数据库双向复制、循环复制

对于双服务器库镜像,就是数据库A的数据变化要镜像到数据库B中,同时数据库B里的修改也要同时复制到数据库A里 。

  对于循环数据库镜像,就是多个数据库A、B、C、D等,对其中任一个数据库的修改,都要同时镜像到其它的数据库里 。

应用:同一个Zen Cart网店的数据库和程序,可以放置在不同的主机上,在任一台主机上新增的订单、客户资料,都会同时加入其它的主机数据库里 。

  要实现双向或循环数据库镜像,首先要解决的就是防止数据库中自动递增(AUTO_INCREMENT)字段的冲突,以免多数据库各自生成一样的增量值 。 继续阅读

mysql双机备份方案及操作

运行环境:
虚拟机安装的是Linux Red Hat9
Mysql版本:5.1.31-log MySQL Community Server (GPL)

操作步骤:

1. 在主从服务器上分别安装mysql

shell> groupadd mysql
shell> useradd -g mysql mysql
shell> cd /usr/local
shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -
shell> ln -s full-path-to-mysql-VERSION-OS mysql
shell> cd mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> scripts/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql data
shell> bin/mysqld_safe --user=mysql &

继续阅读

How To Set Up Database Replication In MySQL

How To Set Up Database Replication In MySQL
http://www.howtoforge.com/mysql_database_replication
Version 1.1
Author: Falko Timme
Last edited: 01/14/2006

This tutorial describes how to set up database replication in MySQL. MySQL replication allows you to have an exact copy of a database from a master server on another server (slave), and all updates to the database on the master server are immediately replicated to the database on the slave server so that both databases are in sync. This is not a backup policy because an accidentally issued DELETE command will also be carried out on the slave; but replication can help protect against hardware failures though. 继续阅读