一.mysql5.5.6 安装 1.卸载原有的 mysql #rpm -qa
grep -i mysql #rpm -ev MySQL-client-5.5.6_rc-1.linux2.6 #rpm -ev MySQL-server-5.5.6_rc-1.linux2.6 卸载后/var/lib/mysql 中的数据及/etc/my.cnf 不会删除,如果确定没用后就手工删除 #rm -f /etc/my.cnf #rm -rf /var/lib/mysql
2.安装 mysql5.5.6 #rpm -ivh MySQL-server-5.5.6_rc-1.linux2.6.i386.rpm MySQL-client-5.5.6_rc-1.linux2.6.i386.rpm #/usr/bin/mysqladmin -u root password 'founder'
#/usr/bin/mysqladmin -u root -h localhost.localdomain password 'founder'
#mysql -uroot -pfounder mysql>use mysql; mysql>grant all on *.* to root@'%' identified by "founder"; mysql>FLUSH PRIVILEGES; mysql>exit; #cp /usr/share/mysql/my-small.cnf /etc/my.cnf
二.配置半同步模式的主从配置 1.半同步的配置: master>INSTALL PLUGIN rpl_semi_sync_master SONAME 'semisync_master.so'; master>SET GLOBAL rpl_semi_sync_master_enabled=1; master>SET GLOBAL rpl_semi_sync_master_timeout=10;
slave-x>INSTALL PLUGIN rpl_semi_sync_slave SONAME 'semisync_slave.so'; slave-x>SET GLOBAL rpl_semi_sync_slave_enabled=1;
On the master: [mysqld] rpl_semi_sync_master_enabled=1 rpl_semi_sync_master_timeout=10
grep -i mysql #rpm -ev MySQL-client-5.5.6_rc-1.linux2.6 #rpm -ev MySQL-server-5.5.6_rc-1.linux2.6 卸载后/var/lib/mysql 中的数据及/etc/my.cnf 不会删除,如果确定没用后就手工删除 #rm -f /etc/my.cnf #rm -rf /var/lib/mysql
2.安装 mysql5.5.6 #rpm -ivh MySQL-server-5.5.6_rc-1.linux2.6.i386.rpm MySQL-client-5.5.6_rc-1.linux2.6.i386.rpm #/usr/bin/mysqladmin -u root password 'founder'
#/usr/bin/mysqladmin -u root -h localhost.localdomain password 'founder'
#mysql -uroot -pfounder mysql>use mysql; mysql>grant all on *.* to root@'%' identified by "founder"; mysql>FLUSH PRIVILEGES; mysql>exit; #cp /usr/share/mysql/my-small.cnf /etc/my.cnf
二.配置半同步模式的主从配置 1.半同步的配置: master>INSTALL PLUGIN rpl_semi_sync_master SONAME 'semisync_master.so'; master>SET GLOBAL rpl_semi_sync_master_enabled=1; master>SET GLOBAL rpl_semi_sync_master_timeout=10;
slave-x>INSTALL PLUGIN rpl_semi_sync_slave SONAME 'semisync_slave.so'; slave-x>SET GLOBAL rpl_semi_sync_slave_enabled=1;
On the master: [mysqld] rpl_semi_sync_master_enabled=1 rpl_semi_sync_master_timeout=10
On each slave: [mysqld] rpl_semi_sync_slave_enabled=1