ITPub博客

首页 > 数据库 > MySQL > PXC安装

PXC安装

原创 MySQL 作者:psufnxk2000 时间:2016-10-27 23:42:40 0 删除 编辑
在centos 7.2.1511上
10.23.100.11,
10.23.30.164,
10.23.77.125
这三个机器上安装pxc


1 关闭firewall
systemctl status firewalld
2 关闭selinux
sestatus

3 安装
wget "https://www.percona.com/redir/downloads/percona-release/redhat/0.1-4/percona-release-0.1-4.noarch.rpm"
rpm -ivh percona-release-0.1-4.noarch.rpm

yum install Percona-XtraDB-Cluster-full-56.x86_64 -y


4 第一个节点的配置文件:
[mysqld]

log_bin

binlog_format = ROW
innodb_buffer_pool_size = 100M
innodb_flush_log_at_trx_commit = 0
innodb_flush_method = O_DIRECT
innodb_log_files_in_group = 2
innodb_log_file_size = 20M
innodb_file_per_table = 1
datadir = /var/lib/mysql

wsrep_provider = /usr/lib64/galera3/libgalera_smm.so

wsrep_slave_threads = 8
wsrep_cluster_name = Cluster
wsrep_node_name = Node1

innodb_locks_unsafe_for_binlog = 1
innodb_autoinc_lock_mode = 2
wsrep_cluster_address=gcomm://10.23.100.11,10.23.30.164,10.23.77.125
default_storage_engine=InnoDB
wsrep_node_address=10.23.100.11

# SST method
wsrep_sst_method=xtrabackup-v2
# Authentication for SST method
wsrep_sst_auth="song:test"

[mysqld_safe]
pid-file = /run/mysqld/mysql.pid
syslog


!includedir /etc/my.cnf.d

启动
systemctl start mysql@bootstrap.service
查看状态
show status like 'wsrep%';


CREATE USER 'song'@'localhost' IDENTIFIED BY 'test';
GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* to 'song'@'localhost';
flush privileges;



5 第二个节点的配置文件
[mysqld]

log_bin

binlog_format = ROW
innodb_buffer_pool_size = 100M
innodb_flush_log_at_trx_commit = 0
innodb_flush_method = O_DIRECT
innodb_log_files_in_group = 2
innodb_log_file_size = 20M
innodb_file_per_table = 1
datadir = /var/lib/mysql

wsrep_provider = /usr/lib64/galera3/libgalera_smm.so

wsrep_slave_threads = 8
wsrep_cluster_name = Cluster
wsrep_node_name = Node2

innodb_locks_unsafe_for_binlog = 1
innodb_autoinc_lock_mode = 2
wsrep_cluster_address=gcomm://10.23.100.11,10.23.30.164,10.23.77.125
default_storage_engine=InnoDB
wsrep_node_address=10.23.30.164

# SST method
wsrep_sst_method=xtrabackup-v2
# Authentication for SST method
wsrep_sst_auth="song:test"

[mysqld_safe]
pid-file = /run/mysqld/mysql.pid
syslog


!includedir /etc/my.cnf.d


启动:
systemctl start mysql
查看状态
show status like 'wsrep%';

6 第三个节点的配置文件:
[mysqld]

log_bin

binlog_format = ROW
innodb_buffer_pool_size = 100M
innodb_flush_log_at_trx_commit = 0
innodb_flush_method = O_DIRECT
innodb_log_files_in_group = 2
innodb_log_file_size = 20M
innodb_file_per_table = 1
datadir = /var/lib/mysql

wsrep_provider = /usr/lib64/galera3/libgalera_smm.so

wsrep_slave_threads = 8
wsrep_cluster_name = Cluster
wsrep_node_name = Node3

innodb_locks_unsafe_for_binlog = 1
innodb_autoinc_lock_mode = 2
wsrep_cluster_address=gcomm://10.23.100.11,10.23.30.164,10.23.77.125
default_storage_engine=InnoDB
wsrep_node_address=10.23.77.125

# SST method
wsrep_sst_method=xtrabackup-v2
# Authentication for SST method
wsrep_sst_auth="song:test"

[mysqld_safe]
pid-file = /run/mysqld/mysql.pid
syslog


!includedir /etc/my.cnf.d

启动:
systemctl start mysql
查看状态
show status like 'wsrep%';

转载请注明源出处

QQ 273002188 欢迎一起学习

QQ 群 236941212

oracle,mysql,PG 相互交流

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25099483/viewspace-2127255/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2011-05-31

  • 博文量
    215
  • 访问量
    618238