centos6.4 安装PXC5.6

原创
2016/05/08 16:28
阅读数 66
#依赖下载地址 ftp://rpmfind.net/linux/dag/redhat/el6/en/x86_64/dag/RPMS/libev-4.15-1.el6.rf.x86_64.rpm
https://www.percona.com/downloads/XtraBackup/Percona-XtraBackup-2.3.4/binary/redhat/6/x86_64/percona-xtrabackup-2.3.4-1.el6.x86_64.rpm
ftp://rpmfind.net/linux/dag/redhat/el6/en/x86_64/dag/RPMS/socat-1.7.1.3-1.el6.rf.x86_64.rpm
ftp://rpmfind.net/linux/centos/6.7/os/x86_64/Packages/tcp_wrappers-7.6-57.el6.x86_64.rpm
ftp://rpmfind.net/linux/centos/6.7/os/x86_64/Packages/perl-DBD-MySQL-4.013-3.el6.x86_64.rpm
ftp://rpmfind.net/linux/centos/6.7/os/x86_64/Packages/lsof-4.82-5.el6.x86_64.rpm


#官方文档
https://www.percona.com/doc/percona-xtradb-cluster/5.6/index.html
#配置参考
https://www.percona.com/doc/percona-xtradb-cluster/5.6/manual/bootstrap.html


#关闭SELINUX
vim /etc/sysconfig/selinux
SELINUX=disabled
#关闭防火墙服务
service iptables stop
#关闭防火墙启动项
chkconfig iptables off

yum install http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm #删除原安装Mysql
#rpm -qa | grep -i mysql-client | xargs sudo rpm -e --nodeps
#rpm -qa | grep -i mysql-server | xargs sudo rpm -e --nodeps
rpm -qa | grep -i mysql | xargs sudo rpm -e --nodeps

#安装依赖
rpm -ivh libmysqlclient16-5.1.69-1.w6.x86_64.rpm
rpm -ivh perl-DBD-MySQL-4.013-3.el6.x86_64.rpm socat-1.7.2.4-1.el6.rf.x86_64.rpm nc-1.84-22.el6.x86_64.rpm tcp_wrappers-7.6-57.el6.x86_64.rpm
rpm -ivh lsof-4.82-5.el6.x86_64.rpm
rpm -ivh percona-xtrabackup-2.3.4-1.el6.x86_64.rpm
tar -xvf Percona-XtraDB-Cluster-5.6.28-25.14-rf9b078d-el6-x86_64-bundle.tar 
rpm -ivh Percona-XtraDB-Cluster-server-56-5.6.28-25.14.1.el6.x86_64.rpm Percona-XtraDB-Cluster-client-56-5.6.28-25.14.1.el6.x86_64.rpm Percona-XtraDB-Cluster-galera-3-3.14-1.rhel6.x86_64.rpm Percona-XtraDB-Cluster-shared-56-5.6.28-25.14.1.el6.x86_64.rpm

#配置配置文件
cp /usr/share/doc/Percona-XtraDB-Cluster-server-56-5.6.28/my-default.cnf my.cnf
vim /etc/my.cnf

#安装数据库
mysql_install_db --defaults-file=/etc/my.cnf

#做个软连接方便使用客户端工具
ln -s /data/pxc_db/mysql.sock /var/lib/mysql/mysql.sock 

#主节点启动
/etc/init.d/mysql bootstrap-pxc
/etc/init.d/mysql start
/etc/init.d/mysql stop

#登录
mysql -uroot -proot

#创建wsrep_sst_auth="sstuser:s3cret" 用户
GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO  sstuser@'localhost'  IDENTIFIED BY 's3cret';
FLUSH PRIVILEGES;

#查询状态
show status like 'wsrep%';  

展开阅读全文
打赏
2
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
2
分享
返回顶部
顶部