cd /usr/local/
tar -zxvf Percona-XtraDB-Cluster-5.6.21-rel70.1-25.8.938.Linux.x86_64.tar.gz
ln -s Percona-XtraDB-Cluster-5.6.21-rel70.1-25.8.938.Linux.x86_64 mysql
chown mysql:mysql -R mysql
mkdir -p /data/mysql
chown mysql:mysql -R /data/mysql
mysql> delete from mysql.user where user!='root' or host!='localhost';
mysql> grant all privileges on *.* to 'zs'@'%' identified by 'zs';
mysql> grant all privileges on *.* to 'sst'@'localhost' identified by 'zs';
mysql> flush privileges;
在节点二(192.168.56.101)上执行操作:
cd /usr/local/
tar -zxvf Percona-XtraDB-Cluster-5.6.21-rel70.1-25.8.938.Linux.x86_64.tar.gz
ln -s Percona-XtraDB-Cluster-5.6.21-rel70.1-25.8.938.Linux.x86_64 mysql
chown mysql:mysql -R mysql
mkdir -p /data/mysql
chown mysql:mysql -R /data/mysql
cd /usr/local/mysql/support-files
cp mysql.server /etc/init.d/mysql
[root@node2 mysql]# /etc/init.d/mysql start
Starting MySQL (Percona XtraDB Cluster).. [ OK ]
在第三个节点(192.168.56.102)上面执行:
cd /usr/local/
tar -zxvf Percona-XtraDB-Cluster-5.6.21-rel70.1-25.8.938.Linux.x86_64.tar.gz
ln -s Percona-XtraDB-Cluster-5.6.21-rel70.1-25.8.938.Linux.x86_64 mysql
chown mysql:mysql -R mysql
mkdir -p /data/mysql
chown mysql:mysql -R /data/mysql