PXC安裝

psufnxk2000發表於2016-10-27
在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/,如需轉載,請註明出處,否則將追究法律責任。

相關文章