pxc5.7配置安装
一、准备工作
# Centos6.9 最小化安装操作系统 ########################---- Centos最小化安装推荐常用依赖包---- ###################### yum clean all yum -y update yum -y install gcc-c++ gd libxml2-devel libjpeg-devel libpng-devel net-snmp-devel wget telnet vim zip unzip yum -y install curl-devel libxslt-devel pcre-devel libjpeg libpng libcurl4-openssl-dev yum -y install libcurl-devel libcurl freetype-config freetype freetype-devel unixODBC libxslt yum -y install gcc automake autoconf libtool openssl-devel yum -y install perl-devel perl-ExtUtils-Embed *libnuma* yum -y install cmake ncurses-devel.x86_64 openldap-devel.x86_64 lrzsz openssh-clients gcc-g77 bison yum -y install libmcrypt libmcrypt-devel mhash mhash-devel bzip2 bzip2-devel yum -y install ntpdate rsync svn patch iptables iptables-services yum -y install libevent libevent-devel cyrus-sasl cyrus-sasl-devel yum -y install gd-devel libmemcached-devel memcached git libssl-devel libyaml-devel auto make yum -y install gcc gcc-c++ make autoconf automake ncurses-devel bison ncurses cmake libaio libaio-devel boost yum -y groupinstall "Development tools" yum -y groupinstall "Server Platform Development" "Development tools" yum -y install perl-IO-Socket-SSL.noarch perl-DBD-MySQL.x86_64 perl-Time-HiRes openssl openssl-devel perl-DBI perl-TermReadKey.x86_64 yum -y install scons check boost-devel asio-devel readline-devel pam-devel
# 下载安装多端口通信软件包,socat的主要特点就是在两个数据流之间建立通道;且支持众多协议和链接方式
cd /opt/ rpm -ivh https://www.percona.com/redir/downloads/percona-release/redhat/latest/percona-release-0.1-4.noarch.rpm wget http://www.dest-unreach.org/socat/download/socat-1.7.3.2.tar.gz tar -zxf socat-1.7.3.2.tar.gz cd socat-1.7.3.2 ./configure --disable-fips make && make install cd .. ln -s /usr/local/bin/socat /usr/bin/
# 修改系统参数配置
cat >> /etc/sysctl.conf << EOF ##custom net.ipv4.ip_forward = 0 net.ipv4.conf.default.rp_filter = 1 net.ipv4.conf.default.accept_source_route = 0 kernel.sysrq = 0 kernel.core_uses_pid = 1 net.ipv4.tcp_syncookies = 1 kernel.msgmnb = 65536 kernel.msgmax = 65536 net.ipv4.tcp_max_tw_buckets = 6000 net.ipv4.tcp_sack = 1 net.ipv4.tcp_window_scaling = 1 net.ipv4.tcp_rmem = 4096 87380 4194304 net.ipv4.tcp_wmem = 4096 16384 4194304 net.core.wmem_default = 8388608 net.core.rmem_default = 8388608 net.core.rmem_max = 16777216 net.core.wmem_max = 16777216 net.core.netdev_max_backlog = 262144 net.core.somaxconn = 262144 net.ipv4.tcp_max_orphans = 3276800 net.ipv4.tcp_max_syn_backlog = 262144 net.ipv4.tcp_timestamps = 0 #net.ipv4.tcp_synack_retries = 1 net.ipv4.tcp_synack_retries = 2 #net.ipv4.tcp_syn_retries = 1 net.ipv4.tcp_syn_retries = 2 net.ipv4.tcp_tw_recycle = 1 net.ipv4.tcp_tw_reuse = 1 net.ipv4.tcp_mem = 94500000 915000000 927000000 #net.ipv4.tcp_fin_timeout = 1 net.ipv4.tcp_fin_timeout = 15 net.ipv4.tcp_keepalive_time = 30 net.ipv4.ip_local_port_range = 1024 65535 #net.ipv4.tcp_tw_len = 1 EOF #使其生效 sysctl -p cat >> /etc/security/limits.conf << EOF # ###custom # * soft nofile 20480 * hard nofile 65535 * soft nproc 20480 * hard nproc 65535 EOF
二、关闭防火墙和selinux
/etc/init.d/iptables stop # 防火墙配置,如果要配置的话 -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT #默认端口: 3306 -A INPUT -m state --state NEW -m tcp -p tcp --dport 4444 -j ACCEPT #默认端口: 4444 -A INPUT -m state --state NEW -m tcp -p tcp --dport 4567 -j ACCEPT #默认端口: 4567 -A INPUT -m state --state NEW -m tcp -p tcp --dport 4568 -j ACCEPT #默认端口: 4568
# 关闭selinux sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config setenforce 0
# 端口用途说明
pxc环境所涉及的端口:
#mysql实例端口
1. Regular MySQL port, default 3306.
#pxc cluster相互通讯的端口
2. Port for group communication, default 4567. It can be changed by the option:
wsrep_provider_options ="gmcast.listen_addr=tcp://0.0.0.0:4567; "
#用于SST传送的端口
3. Port for State Transfer, default 4444. It can be changed by the option:
wsrep_sst_receive_address=10.11.12.205:4444
#用于IST传送的端口
4. Port for Incremental State Transfer, default port for group communication + 1 (4568). It can be changed by the option:
wsrep_provider_options = "ist.recv_addr=10.11.12.206:4568; "
三、配置主机/etc/hosts
cat >>/etc/hosts<<"EOF" 192.168.65.128 my1-222 192.168.65.129 my2-223 192.168.65.130 my3-224 EOF
四、配置服务器ssh登录无密码验证
(1)在所有的主机上执行
ssh-keygen -t rsa # 在每台都需要操作
(2)将所有机子上公钥(id_rsa.pub)导到一个主机的/root/.ssh/authorized_keys文件中,然后将authorized_keys分别拷贝到所有主机上
cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys # 只需要在192.168.65.128机器上操作这一步 ssh 192.168.65.129 cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys # 只需要在192.168.65.128机器上操作这一步 ssh 192.168.65.130 cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys # 只需要在192.168.65.128机器上操作这一步 scp /root/.ssh/authorized_keys 192.168.65.129:/root/.ssh/authorized_keys # 只需要在192.168.65.128机器上操作这一步 scp /root/.ssh/authorized_keys 192.168.65.130:/root/.ssh/authorized_keys # 只需要在192.168.65.128机器上操作这一步
#测试(强烈建议)
ssh 192.168.65.128 ssh 192.168.65.129 ssh 192.168.65.130 ssh my1-222 ssh my2-223 ssh my3-224
五、下载安装包
# 基本初始化-三个机器都需要安装
mkdir -p /opt/mysql cd /opt/mysql/ wget https://www.percona.com/downloads/Percona-XtraDB-Cluster-LATEST/Percona-XtraDB-Cluster-5.7.21-29.26/binary/tarball/Percona-XtraDB-Cluster-5.7.21-rel20-29.26.1.Linux.x86_64.ssl101.tar.gz tar -zxf Percona-XtraDB-Cluster-5.7.21-rel20-29.26.1.Linux.x86_64.ssl101.tar.gz cd /usr/local/ ln -s /opt/mysql/Percona-XtraDB-Cluster-5.7.21-rel20-29.26.1.Linux.x86_64.ssl101 mysql
# 创建所需要的目录
mkdir -p /data/mysql/mysql_3306/{data,logs,tmp}
# 更改权限
groupadd mysql
useradd -g mysql mysql -d /home/mysql -s /sbin/nologin
# 创建配置文件
# 第一台机器:192.168.65.128
# 附录: cat >/data/mysql/mysql_3306/my_3306.cnf <<"EOF" #my.cnf [client] port = 3306 socket = /data/mysql/mysql_3306/tmp/mysql_3306.sock [mysql] prompt="\u@\h:p \R:\m:\s [\d]>" #tee=/data/mysql/mysql_3306/data/query.log no-auto-rehash [mysqld] #misc user = mysql basedir = /usr/local/mysql datadir = /data/mysql/mysql_3306/data port = 3306 socket = /data/mysql/mysql_3306/tmp/mysql_3306.sock event_scheduler = 0 #tmp tmpdir=/data/mysql/mysql_3306/tmp #timeout interactive_timeout = 300 wait_timeout = 300 #character set #character-set-server = utf8 character-set-server = utf8mb4 open_files_limit = 65535 max_connections = 100 max_connect_errors = 100000 skip-name-resolve = 1 #logs log-output=file slow_query_log = 1 slow_query_log_file = /data/mysql/mysql_3306/logs/slow.log log-error = /data/mysql/mysql_3306/logs/mysql_3306_error.log log_error_verbosity = 3 pid-file = mysql_3306.pid long_query_time = 1 #log-slow-admin-statements = 1 #log-queries-not-using-indexes = 1 log-slow-slave-statements = 1 #binlog binlog_format = row server-id = 1283306 log-bin = /data/mysql/mysql_3306/logs/mysql-bin log-bin-index = /data/mysql/mysql_3306/logs/mysql-bin.index binlog_cache_size = 4M max_binlog_size = 1G max_binlog_cache_size = 2G sync_binlog = 1 expire_logs_days = 90 #relay log skip_slave_start = 1 max_relay_log_size = 1G relay_log_purge = 1 relay_log_recovery = 1 log_slave_updates #slave-skip-errors=1032,1053,1062 explicit_defaults_for_timestamp=1 #buffers & cache table_open_cache = 2048 table_definition_cache = 2048 table_open_cache = 2048 max_heap_table_size = 96M sort_buffer_size = 2M join_buffer_size = 2M thread_cache_size = 256 query_cache_size = 0 query_cache_type = 0 query_cache_limit = 256K query_cache_min_res_unit = 512 thread_stack = 192K tmp_table_size = 96M key_buffer_size = 8M read_buffer_size = 2M read_rnd_buffer_size = 16M bulk_insert_buffer_size = 32M #myisam myisam_sort_buffer_size = 128M myisam_max_sort_file_size = 10G myisam_repair_threads = 1 #innodb innodb_buffer_pool_size = 1G innodb_buffer_pool_instances = 1 innodb_data_file_path = ibdata1:1G:autoextend innodb_flush_log_at_trx_commit = 2 innodb_log_buffer_size = 64M innodb_log_file_size = 500M innodb_log_files_in_group = 3 innodb_max_dirty_pages_pct = 50 innodb_file_per_table = 1 innodb_rollback_on_timeout innodb_status_file = 1 innodb_io_capacity = 2000 transaction_isolation = READ-COMMITTED innodb_flush_method = O_DIRECT gtid_mode = ON enforce_gtid_consistency = ON master_info_repository = TABLE relay-log-info-repository = TABLE binlog_checksum = NONE log_slave_updates = ON # Two-Master configure #server-1 #auto-increment-offset = 1 #auto-increment-increment = 2 #server-2 #auto-increment-offset = 2 #auto-increment-increment = 2 slave_preserve_commit_order = 1 slave_transaction_retries = 128 log_timestamps = system show_compatibility_56 = on slave_parallel_workers = 16 slave_parallel_type = LOGICAL_CLOCK # group replication ##log-bin = mysql ##server-id = 613306 ##gtid_mode = ON ##enforce_gtid_consistency = ON ##master_info_repository = TABLE ##relay-log-info-repository = TABLE ##binlog_checksum = NONE ##log_slave_updates = ON ##binlog_format = row ##transaction_write_set_extraction=XXHASH64 ##loose-group_replication_group_name = '3db33b36-0e51-409f-a61d-c99756e90154' ##loose-group_replication_start_on_boot = off ##loose-group_replication_local_address= "10.0.0.62:23306" # 不能超过5位数字 ##loose-group_replication_group_seeds= "10.0.0.62:23306,10.0.0.62:23307,10.0.0.62:23308" # 不能超过5位数字 ##loose-group_replication_bootstrap_group= off # loose-group_replication_single_primary_mode=FALSE ###本次搭建的是mutil_mode # loose-group_replication_enforce_update_everywhere_checks= TRUE #pxc wsrep_provider = /usr/local/mysql/lib/libgalera_smm.so #库文件位置 #6000 for mysqld port, 6020 for sst port, 6031 for ist port, 6030 for cluster communication port 端口作用及说明见上面 wsrep_cluster_address = gcomm://192.168.65.128:4567,192.168.65.129:4567,192.168.65.130:4567 #集群中所有节点的ip wsrep_node_name = my1-222 #本节点的名字 wsrep_node_address = 192.168.65.128 #本节点的ip wsrep_cluster_name = pxc_cyou #集群名字 wsrep_sst_auth = sst:aPJZiOCF #sst模式需要的用户名和密码 wsrep_sst_method = xtrabackup-v2 #采用什么方式复制数据。还支持mysqldump,rsync wsrep_slave_threads = 2 # 开启的复制线程数,建议cpu核数*2 ,解决apply_cb跟不上问题 pxc_strict_mode = ENFORCING #pxc严厉模式,还有DISABLED、PERMISSIVE、MASTER可选 innodb_autoinc_lock_mode = 2 #自增锁的优化 wsrep_provider_options = "debug=1;gcache.size=1G" #打开调试模式 [mysqld_safe] #malloc-lib=/usr/local/mysql/lib/jmalloc.so nice=-19 open-files-limit=65535 EOF
# 第二台机器:192.168.65.129
cat >/data/mysql/mysql_3306/my_3306.cnf <<"EOF" #my.cnf [client] port = 3306 socket = /data/mysql/mysql_3306/tmp/mysql_3306.sock [mysql] prompt="\u@\h:p \R:\m:\s [\d]>" #tee=/data/mysql/mysql_3306/data/query.log no-auto-rehash [mysqld] #misc user = mysql basedir = /usr/local/mysql datadir = /data/mysql/mysql_3306/data port = 3306 socket = /data/mysql/mysql_3306/tmp/mysql_3306.sock event_scheduler = 0 #tmp tmpdir=/data/mysql/mysql_3306/tmp #timeout interactive_timeout = 300 wait_timeout = 300 #character set #character-set-server = utf8 character-set-server = utf8mb4 open_files_limit = 65535 max_connections = 100 max_connect_errors = 100000 skip-name-resolve = 1 #logs log-output=file slow_query_log = 1 slow_query_log_file = /data/mysql/mysql_3306/logs/slow.log log-error = /data/mysql/mysql_3306/logs/mysql_3306_error.log log_error_verbosity = 3 pid-file = mysql_3306.pid long_query_time = 1 #log-slow-admin-statements = 1 #log-queries-not-using-indexes = 1 log-slow-slave-statements = 1 #binlog binlog_format = row server-id = 1293306 log-bin = /data/mysql/mysql_3306/logs/mysql-bin log-bin-index = /data/mysql/mysql_3306/logs/mysql-bin.index binlog_cache_size = 4M max_binlog_size = 1G max_binlog_cache_size = 2G sync_binlog = 1 expire_logs_days = 90 #relay log skip_slave_start = 1 max_relay_log_size = 1G relay_log_purge = 1 relay_log_recovery = 1 log_slave_updates #slave-skip-errors=1032,1053,1062 explicit_defaults_for_timestamp=1 #buffers & cache table_open_cache = 2048 table_definition_cache = 2048 table_open_cache = 2048 max_heap_table_size = 96M sort_buffer_size = 2M join_buffer_size = 2M thread_cache_size = 256 query_cache_size = 0 query_cache_type = 0 query_cache_limit = 256K query_cache_min_res_unit = 512 thread_stack = 192K tmp_table_size = 96M key_buffer_size = 8M read_buffer_size = 2M read_rnd_buffer_size = 16M bulk_insert_buffer_size = 32M #myisam myisam_sort_buffer_size = 128M myisam_max_sort_file_size = 10G myisam_repair_threads = 1 #innodb innodb_buffer_pool_size = 1G innodb_buffer_pool_instances = 1 innodb_data_file_path = ibdata1:1G:autoextend innodb_flush_log_at_trx_commit = 2 innodb_log_buffer_size = 64M innodb_log_file_size = 500M innodb_log_files_in_group = 3 innodb_max_dirty_pages_pct = 50 innodb_file_per_table = 1 innodb_rollback_on_timeout innodb_status_file = 1 innodb_io_capacity = 2000 transaction_isolation = READ-COMMITTED innodb_flush_method = O_DIRECT gtid_mode = ON enforce_gtid_consistency = ON master_info_repository = TABLE relay-log-info-repository = TABLE binlog_checksum = NONE log_slave_updates = ON # Two-Master configure #server-1 #auto-increment-offset = 1 #auto-increment-increment = 2 #server-2 #auto-increment-offset = 2 #auto-increment-increment = 2 slave_preserve_commit_order = 1 slave_transaction_retries = 128 log_timestamps = system show_compatibility_56 = on slave_parallel_workers = 16 slave_parallel_type = LOGICAL_CLOCK # group replication ##log-bin = mysql ##server-id = 613306 ##gtid_mode = ON ##enforce_gtid_consistency = ON ##master_info_repository = TABLE ##relay-log-info-repository = TABLE ##binlog_checksum = NONE ##log_slave_updates = ON ##binlog_format = row ##transaction_write_set_extraction=XXHASH64 ##loose-group_replication_group_name = '3db33b36-0e51-409f-a61d-c99756e90154' ##loose-group_replication_start_on_boot = off ##loose-group_replication_local_address= "10.0.0.62:23306" # 不能超过5位数字 ##loose-group_replication_group_seeds= "10.0.0.62:23306,10.0.0.62:23307,10.0.0.62:23308" # 不能超过5位数字 ##loose-group_replication_bootstrap_group= off # loose-group_replication_single_primary_mode=FALSE ###本次搭建的是mutil_mode # loose-group_replication_enforce_update_everywhere_checks= TRUE #pxc wsrep_provider = /usr/local/mysql/lib/libgalera_smm.so #库文件位置 #6000 for mysqld port, 6020 for sst port, 6031 for ist port, 6030 for cluster communication port 端口作用及说明见上面 wsrep_cluster_address = gcomm://192.168.65.128:4567,192.168.65.129:4567,192.168.65.130:4567 #集群中所有节点的ip wsrep_node_name = my2-223 #本节点的名字 wsrep_node_address = 192.168.65.129 #本节点的ip wsrep_cluster_name = pxc_cyou #集群名字 wsrep_sst_auth = sst:aPJZiOCF #sst模式需要的用户名和密码 wsrep_sst_method = xtrabackup-v2 #采用什么方式复制数据。还支持mysqldump,rsync wsrep_slave_threads = 2 # 开启的复制线程数,建议cpu核数*2 ,解决apply_cb跟不上问题 pxc_strict_mode = ENFORCING #pxc严厉模式,还有DISABLED、PERMISSIVE、MASTER可选 innodb_autoinc_lock_mode = 2 #自增锁的优化 wsrep_provider_options = "debug=1;gcache.size=1G" #打开调试模式 [mysqld_safe] #malloc-lib=/usr/local/mysql/lib/jmalloc.so nice=-19 open-files-limit=65535 EOF
# 第三台机器:192.168.65.130
cat >/data/mysql/mysql_3306/my_3306.cnf <<"EOF" #my.cnf [client] port = 3306 socket = /data/mysql/mysql_3306/tmp/mysql_3306.sock [mysql] prompt="\u@\h:p \R:\m:\s [\d]>" #tee=/data/mysql/mysql_3306/data/query.log no-auto-rehash [mysqld] #misc user = mysql basedir = /usr/local/mysql datadir = /data/mysql/mysql_3306/data port = 3306 socket = /data/mysql/mysql_3306/tmp/mysql_3306.sock event_scheduler = 0 #tmp tmpdir=/data/mysql/mysql_3306/tmp #timeout interactive_timeout = 300 wait_timeout = 300 #character set #character-set-server = utf8 character-set-server = utf8mb4 open_files_limit = 65535 max_connections = 100 max_connect_errors = 100000 skip-name-resolve = 1 #logs log-output=file slow_query_log = 1 slow_query_log_file = /data/mysql/mysql_3306/logs/slow.log log-error = /data/mysql/mysql_3306/logs/mysql_3306_error.log log_error_verbosity = 3 pid-file = mysql_3306.pid long_query_time = 1 #log-slow-admin-statements = 1 #log-queries-not-using-indexes = 1 log-slow-slave-statements = 1 #binlog binlog_format = row server-id = 1303306 log-bin = /data/mysql/mysql_3306/logs/mysql-bin log-bin-index = /data/mysql/mysql_3306/logs/mysql-bin.index binlog_cache_size = 4M max_binlog_size = 1G max_binlog_cache_size = 2G sync_binlog = 1 expire_logs_days = 90 #relay log skip_slave_start = 1 max_relay_log_size = 1G relay_log_purge = 1 relay_log_recovery = 1 log_slave_updates #slave-skip-errors=1032,1053,1062 explicit_defaults_for_timestamp=1 #buffers & cache table_open_cache = 2048 table_definition_cache = 2048 table_open_cache = 2048 max_heap_table_size = 96M sort_buffer_size = 2M join_buffer_size = 2M thread_cache_size = 256 query_cache_size = 0 query_cache_type = 0 query_cache_limit = 256K query_cache_min_res_unit = 512 thread_stack = 192K tmp_table_size = 96M key_buffer_size = 8M read_buffer_size = 2M read_rnd_buffer_size = 16M bulk_insert_buffer_size = 32M #myisam myisam_sort_buffer_size = 128M myisam_max_sort_file_size = 10G myisam_repair_threads = 1 #innodb innodb_buffer_pool_size = 1G innodb_buffer_pool_instances = 1 innodb_data_file_path = ibdata1:1G:autoextend innodb_flush_log_at_trx_commit = 2 innodb_log_buffer_size = 64M innodb_log_file_size = 500M innodb_log_files_in_group = 3 innodb_max_dirty_pages_pct = 50 innodb_file_per_table = 1 innodb_rollback_on_timeout innodb_status_file = 1 innodb_io_capacity = 2000 transaction_isolation = READ-COMMITTED innodb_flush_method = O_DIRECT gtid_mode = ON enforce_gtid_consistency = ON master_info_repository = TABLE relay-log-info-repository = TABLE binlog_checksum = NONE log_slave_updates = ON # Two-Master configure #server-1 #auto-increment-offset = 1 #auto-increment-increment = 2 #server-2 #auto-increment-offset = 2 #auto-increment-increment = 2 slave_preserve_commit_order = 1 slave_transaction_retries = 128 log_timestamps = system show_compatibility_56 = on slave_parallel_workers = 16 slave_parallel_type = LOGICAL_CLOCK # group replication ##log-bin = mysql ##server-id = 613306 ##gtid_mode = ON ##enforce_gtid_consistency = ON ##master_info_repository = TABLE ##relay-log-info-repository = TABLE ##binlog_checksum = NONE ##log_slave_updates = ON ##binlog_format = row ##transaction_write_set_extraction=XXHASH64 ##loose-group_replication_group_name = '3db33b36-0e51-409f-a61d-c99756e90154' ##loose-group_replication_start_on_boot = off ##loose-group_replication_local_address= "10.0.0.62:23306" # 不能超过5位数字 ##loose-group_replication_group_seeds= "10.0.0.62:23306,10.0.0.62:23307,10.0.0.62:23308" # 不能超过5位数字 ##loose-group_replication_bootstrap_group= off # loose-group_replication_single_primary_mode=FALSE ###本次搭建的是mutil_mode # loose-group_replication_enforce_update_everywhere_checks= TRUE #pxc wsrep_provider = /usr/local/mysql/lib/libgalera_smm.so #库文件位置 #6000 for mysqld port, 6020 for sst port, 6031 for ist port, 6030 for cluster communication port 端口作用及说明见上面 wsrep_cluster_address = gcomm://192.168.65.128:4567,192.168.65.129:4567,192.168.65.130:4567 #集群中所有节点的ip wsrep_node_name = my3-224 #本节点的名字 wsrep_node_address = 192.168.65.130 #本节点的ip wsrep_cluster_name = pxc_cyou #集群名字 wsrep_sst_auth = sst:aPJZiOCF #sst模式需要的用户名和密码 wsrep_sst_method = xtrabackup-v2 #采用什么方式复制数据。还支持mysqldump,rsync wsrep_slave_threads = 2 # 开启的复制线程数,建议cpu核数*2 ,解决apply_cb跟不上问题 pxc_strict_mode = ENFORCING #pxc严厉模式,还有DISABLED、PERMISSIVE、MASTER可选 innodb_autoinc_lock_mode = 2 #自增锁的优化 wsrep_provider_options = "debug=1;gcache.size=1G" #打开调试模式 [mysqld_safe] #malloc-lib=/usr/local/mysql/lib/jmalloc.so nice=-19 open-files-limit=65535 EOF
# 授权
chown -R mysql.mysql /data/mysql/
# 初始化
/usr/local/mysql/bin/mysqld --defaults-file=/data/mysql/mysql_3306/my_3306.cnf --initialize-insecure &
# 安装percona-xtrabackup
cd /opt/ wget https://www.percona.com/downloads/XtraBackup/Percona-XtraBackup-2.4.11/binary/tarball/percona-xtrabackup-2.4.11-Linux-x86_64.libgcrypt145.tar.gz tar -xf percona-xtrabackup-2.4.11-Linux-x86_64.libgcrypt145.tar.gz ln -s /opt/percona-xtrabackup-2.4.11-Linux-x86_64/bin/* /usr/bin/
#启动第一个实例
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld chmod +x /etc/init.d/mysqld
然后就是启动第一个节点,第一个节点在启动的时候要使用bootstrap-pxc的方式启动
也可以使用/usr/local/mysql/bin/mysqld --defaults-file=/etc/my.cnf--wsrep_new_cluster &
其余的节点直接使用 /etc/init.d/mysql start启动
rm -rf /etc/my.cnf ln -s /usr/local/mysql/bin/* /usr/bin/ ln -s /usr/local/mysql/bin/* /usr/sbin/ ln -s /data/mysql/mysql_3306/my_3306.cnf /etc/my.cnf
#遇到过的错误记录
# [root@my1-222 opt]# /etc/init.d/mysqld --help # /etc/init.d/mysqld: line 291: my_print_defaults: command not found # Usage: mysqld {start|stop|restart|restart-bootstrap|reload|force-reload|status|bootstrap-pxc} [ MySQL (Percona XtraDB Cluster) options ] # [root@my1-222 opt]# # # 解决办法: # rm -rf /etc/my.cnf # ln -s /usr/local/mysql/bin/* /usr/bin/ # ln -s /usr/local/mysql/bin/* /usr/sbin/ # ln -s /data/mysql/mysql_3306/my_3306.cnf /etc/my.cnf
# 修改启动文件路径
vi /etc/init.d/mysqld
basedir=/usr/local/mysql
datadir=/data/mysql/mysql_3306/data
# 否则会报如下错误的
# [root@my1-222 opt]# /etc/init.d/mysqld bootstrap-pxc
# Bootstrapping PXC (Percona XtraDB Cluster)Initializing MySQL database: /etc/rc.d/init.d/functions: line 722: /usr/sbin/mysqld: No such file or directory
# 第一台机器方式:
/etc/init.d/mysqld bootstrap-pxc
# 查看日志
tail -f /data/mysql/mysql_3306/logs/mysql_3306_error.log
# 登陆数据库(5.6需要,5.7的不需要)
-- delete from mysql.user where user!='root' or host!='localhost'; -- grant all privileges on *.* to 'sst'@'%' identified by 'aPJZiOCF'; -- grant all privileges on *.* to 'sst'@'localhost' identified by 'aPJZiOCF'; -- flush privileges; CREATE USER 'sst'@'localhost' IDENTIFIED BY 'aPJZiOCF'; CREATE USER 'sst'@'%' IDENTIFIED BY 'aPJZiOCF'; GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT, PROCESS ON *.* TO 'sst'@'localhost'; GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT, PROCESS ON *.* TO 'sst'@'%'; FLUSH PRIVILEGES;
# 第二、第三台机的启动方法
/etc/init.d/mysqld start
# 如果三台都关闭了,那么要先启动最后关闭的那台机器的服务。
备注:最后一个停止的节点,需要第一个启动,启动方式为bootstrap-pxc启动
/etc/init.d/mysqld bootstrap-pxc
附录:其中第一台机器的日志
[root@my1-222 ~]# cat /data/mysql/mysql_3306/logs/mysql_3306_error.log 2018-05-17T01:35:19.772145+08:00 0 [Note] Ignoring --secure-file-priv value as server is running with --initialize(-insecure) or --bootstrap. 2018-05-17T01:35:19.772197+08:00 0 [Warning] WSREP: Node is running in bootstrap/initialize mode. Disabling pxc_strict_mode checks 2018-05-17T01:35:19.772210+08:00 0 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.7.21-20-29.26-log) starting as process 17253 ... 2018-05-17T01:35:19.773378+08:00 0 [Note] --initialize specifed on an existing data directory. 2018-05-17T01:35:19.774105+08:00 0 [Note] WSREP: Setting wsrep_ready to false 2018-05-17T01:35:19.774115+08:00 0 [Note] WSREP: Found pre-stored initial position: 6c5f3333-3036-2f64-6174-612f00000000:61114320 2018-05-17T01:35:19.774119+08:00 0 [Note] WSREP: wsrep_load(): loading provider library 'none' 2018-05-17T01:35:19.774125+08:00 0 [Note] WSREP: Setting wsrep_ready to true 2018-05-17T01:35:19.779785+08:00 0 [Note] InnoDB: PUNCH HOLE support available 2018-05-17T01:35:19.779827+08:00 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 2018-05-17T01:35:19.779833+08:00 0 [Note] InnoDB: Uses event mutexes 2018-05-17T01:35:19.779838+08:00 0 [Note] InnoDB: GCC builtin __sync_synchronize() is used for memory barrier 2018-05-17T01:35:19.779841+08:00 0 [Note] InnoDB: Compressed tables use zlib 1.2.3 2018-05-17T01:35:19.779845+08:00 0 [Note] InnoDB: Using Linux native AIO 2018-05-17T01:35:19.780293+08:00 0 [Note] InnoDB: Number of pools: 1 2018-05-17T01:35:19.780624+08:00 0 [Note] InnoDB: Using CPU crc32 instructions 2018-05-17T01:35:19.783782+08:00 0 [Note] InnoDB: Initializing buffer pool, total size = 1G, instances = 1, chunk size = 128M 2018-05-17T01:35:20.165966+08:00 0 [Note] InnoDB: Completed initialization of buffer pool 2018-05-17T01:35:20.232610+08:00 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority(). 2018-05-17T01:35:20.242908+08:00 0 [Note] InnoDB: The first innodb_system data file 'ibdata1' did not exist. A new tablespace will be created! 2018-05-17T01:35:20.244572+08:00 0 [Note] InnoDB: Setting file './ibdata1' size to 1024 MB. Physically writing the file full; Please wait ... 2018-05-17T01:35:20.245301+08:00 0 [Note] InnoDB: Progress in MB: 100 200 300 400 500 600 700 800 900 1000 2018-05-17T01:35:20.567190+08:00 0 [Note] InnoDB: File './ibdata1' size is now 1024 MB. 2018-05-17T01:35:20.567566+08:00 0 [Note] InnoDB: Setting log file ./ib_logfile101 size to 500 MB 2018-05-17T01:35:20.567708+08:00 0 [Note] InnoDB: Progress in MB: 100 200 300 400 500 2018-05-17T01:35:21.148846+08:00 0 [Note] InnoDB: Setting log file ./ib_logfile1 size to 500 MB 2018-05-17T01:35:21.148950+08:00 0 [Note] InnoDB: Progress in MB: 100 200 300 400 500 2018-05-17T01:35:21.888383+08:00 0 [Note] InnoDB: Setting log file ./ib_logfile2 size to 500 MB 2018-05-17T01:35:21.888575+08:00 0 [Note] InnoDB: Progress in MB: 100 200 300 400 500 2018-05-17T01:35:22.372274+08:00 0 [Note] InnoDB: Created parallel doublewrite buffer at /data/mysql/mysql_3306/data/xb_doublewrite, size 3932160 bytes 2018-05-17T01:35:22.462969+08:00 0 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0 2018-05-17T01:35:22.463032+08:00 0 [Warning] InnoDB: New log files created, LSN=45791 2018-05-17T01:35:22.463044+08:00 0 [Note] InnoDB: Creating shared tablespace for temporary tables 2018-05-17T01:35:22.463134+08:00 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ... 2018-05-17T01:35:22.467994+08:00 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB. 2018-05-17T01:35:22.468132+08:00 0 [Note] InnoDB: Doublewrite buffer not found: creating new 2018-05-17T01:35:22.638206+08:00 0 [Note] InnoDB: Doublewrite buffer created 2018-05-17T01:35:22.724899+08:00 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active. 2018-05-17T01:35:22.724929+08:00 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active. 2018-05-17T01:35:22.746522+08:00 0 [Warning] InnoDB: Creating foreign key constraint system tables. 2018-05-17T01:35:22.834978+08:00 0 [Note] InnoDB: Foreign key constraint system tables created 2018-05-17T01:35:22.835013+08:00 0 [Note] InnoDB: Creating tablespace and datafile system tables. 2018-05-17T01:35:22.835147+08:00 0 [Note] InnoDB: Tablespace and datafile system tables created. 2018-05-17T01:35:22.835159+08:00 0 [Note] InnoDB: Creating sys_virtual system tables. 2018-05-17T01:35:22.835236+08:00 0 [Note] InnoDB: sys_virtual table created 2018-05-17T01:35:22.835247+08:00 0 [Note] InnoDB: Creating zip_dict and zip_dict_cols system tables. 2018-05-17T01:35:22.835395+08:00 0 [Note] InnoDB: zip_dict and zip_dict_cols system tables created. 2018-05-17T01:35:22.836061+08:00 0 [Note] InnoDB: Waiting for purge to start 2018-05-17T01:35:22.886876+08:00 0 [Note] InnoDB: Waiting for purge to start 2018-05-17T01:35:22.937102+08:00 0 [Note] InnoDB: Waiting for purge to start 2018-05-17T01:35:22.987999+08:00 0 [Note] InnoDB: Waiting for purge to start 2018-05-17T01:35:23.038690+08:00 0 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.7.21-rel20 started; log sequence number 0 2018-05-17T01:35:23.082875+08:00 0 [Note] Plugin 'FEDERATED' is disabled. 2018-05-17T01:35:23.634524+08:00 0 [Note] Salting uuid generator variables, current_pid: 17253, server_start_time: 1526492119, bytes_sent: 0, 2018-05-17T01:35:23.685592+08:00 0 [Note] Generated uuid: '83591f27-592f-11e8-bac1-000c2921d086', server_start_time: 4856287774715457340, bytes_sent: 75769936 2018-05-17T01:35:23.685746+08:00 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 83591f27-592f-11e8-bac1-000c2921d086. 2018-05-17T01:35:23.750884+08:00 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened. 2018-05-17T01:35:24.166162+08:00 0 [Note] Auto generated SSL certificates are placed in data directory. 2018-05-17T01:35:24.380307+08:00 0 [Warning] CA certificate ca.pem is self signed. 2018-05-17T01:35:24.417354+08:00 0 [Note] Auto generated RSA key files are placed in data directory. 2018-05-17T01:35:24.576049+08:00 1 [Note] Creating the system database 2018-05-17T01:35:24.576078+08:00 1 [Warning] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option. 2018-05-17T01:35:24.808537+08:00 1 [Note] Creating the system tables 2018-05-17T01:35:27.673657+08:00 1 [Note] Filling in the system tables, part 1 2018-05-17T01:35:27.745614+08:00 1 [Note] Filling in the system tables, part 2 2018-05-17T01:35:27.745629+08:00 1 [Note] Filling in the mysql.help table 2018-05-17T01:35:28.733067+08:00 1 [Note] Creating user for internal session service 2018-05-17T01:35:28.733779+08:00 1 [Note] Creating the sys schema 2018-05-17T01:35:28.734172+08:00 1 [Warning] 'user' entry 'root@localhost' ignored in --skip-name-resolve mode. 2018-05-17T01:35:28.734191+08:00 1 [Warning] 'user' entry 'mysql.session@localhost' ignored in --skip-name-resolve mode. 2018-05-17T01:35:28.734199+08:00 1 [Warning] 'user' entry 'mysql.sys@localhost' ignored in --skip-name-resolve mode. 2018-05-17T01:35:28.734211+08:00 1 [Warning] 'db' entry 'performance_schema mysql.session@localhost' ignored in --skip-name-resolve mode. 2018-05-17T01:35:28.734216+08:00 1 [Warning] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode. 2018-05-17T01:35:28.734236+08:00 1 [Warning] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode. 2018-05-17T01:35:28.734279+08:00 1 [Warning] 'tables_priv' entry 'user mysql.session@localhost' ignored in --skip-name-resolve mode. 2018-05-17T01:35:28.734285+08:00 1 [Warning] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode. 2018-05-17T01:35:30.221496+08:00 1 [Note] Bootstrapping complete 2018-05-17T01:35:30.221722+08:00 0 [Note] Giving 0 client threads a chance to die gracefully 2018-05-17T01:35:30.221739+08:00 0 [Note] WSREP: Waiting for active wsrep applier to exit 2018-05-17T01:35:30.221743+08:00 0 [Note] WSREP: Service disconnected. 2018-05-17T01:35:30.221750+08:00 0 [Note] WSREP: Waiting to close threads...... 2018-05-17T01:35:35.222528+08:00 0 [Note] WSREP: Some threads may fail to exit. 2018-05-17T01:35:35.222764+08:00 0 [Note] Giving 0 client threads a chance to die gracefully 2018-05-17T01:35:35.222782+08:00 0 [Note] Shutting down slave threads 2018-05-17T01:35:35.236119+08:00 0 [Note] Forcefully disconnecting 0 remaining clients 2018-05-17T01:35:35.271286+08:00 0 [Note] Binlog end 2018-05-17T01:35:35.273673+08:00 0 [Note] InnoDB: FTS optimize thread exiting. 2018-05-17T01:35:35.273782+08:00 0 [Note] InnoDB: Starting shutdown... 2018-05-17T01:35:35.374269+08:00 0 [Note] InnoDB: Dumping buffer pool(s) to /data/mysql/mysql_3306/data/ib_buffer_pool 2018-05-17T01:35:35.374954+08:00 0 [Note] InnoDB: Buffer pool(s) dump completed at 180517 1:35:35 2018-05-17T01:35:36.180704+08:00 0 [Note] InnoDB: Waiting for page_cleaner to finish flushing of buffer pool 2018-05-17T01:35:36.935238+08:00 0 [Note] InnoDB: Shutdown completed; log sequence number 2556467 2018-05-17T01:35:36.935370+08:00 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1" 2018-05-17T01:50:17.266185+08:00 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled 2018-05-17T01:50:17.266243+08:00 0 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.7.21-20-29.26-log) starting as process 18638 ... 2018-05-17T01:50:17.293348+08:00 0 [Note] WSREP: Setting wsrep_ready to false 2018-05-17T01:50:17.293386+08:00 0 [Note] WSREP: No pre-stored wsrep-start position found. Skipping position initialization. 2018-05-17T01:50:17.293391+08:00 0 [Note] WSREP: wsrep_load(): loading provider library '/usr/local/mysql/lib/libgalera_smm.so' 2018-05-17T01:50:17.363053+08:00 0 [Note] WSREP: wsrep_load(): Galera 3.26(r) by Codership Oy <info@codership.com> loaded successfully. 2018-05-17T01:50:17.363138+08:00 0 [Note] WSREP: CRC-32C: using hardware acceleration. 2018-05-17T01:50:17.374986+08:00 0 [Warning] WSREP: galera/src/saved_state.cpp:SavedState():48: Could not open state file for reading: '/data/mysql/mysql_3306/data//grastate.dat' 2018-05-17T01:50:17.375032+08:00 0 [Warning] WSREP: galera/src/saved_state.cpp:SavedState():49: No persistent state found. Bootstraping with default state 2018-05-17T01:50:17.375157+08:00 0 [Note] WSREP: galera/src/saved_state.cpp:SavedState():120: Found saved state: 00000000-0000-0000-0000-000000000000:-1, safe_to_bootstrap: 1 2018-05-17T01:50:17.378555+08:00 0 [Note] WSREP: galera/src/galera_gcs.hpp:Gcs():89: Passing config to GCS: base_dir = /data/mysql/mysql_3306/data/; base_host = 192.168.65.128; base_port = 4567; cert.log_conflicts = no; debug = 1; evs.auto_evict = 0; evs.delay_margin = PT1S; evs.delayed_keep_period = PT30S; evs.inactive_check_period = PT0.5S; evs.inactive_timeout = PT15S; evs.join_retrans_period = PT1S; evs.max_install_timeouts = 3; evs.send_window = 10; evs.stats_report_period = PT1M; evs.suspect_timeout = PT5S; evs.user_send_window = 4; evs.view_forget_timeout = PT24H; gcache.dir = /data/mysql/mysql_3306/data/; gcache.freeze_purge_at_seqno = -1; gcache.keep_pages_count = 0; gcache.keep_pages_size = 0; gcache.mem_size = 0; gcache.name = /data/mysql/mysql_3306/data//galera.cache; gcache.page_size = 128M; gcache.recover = no; gcache.size = 1G; gcomm.thread_prio = ; gcs.fc_debug = 0; gcs.fc_factor = 1; gcs.fc_limit = 100; gcs.fc_master_slave = no; gcs.max_packet_size = 64500; gcs.max_throttle = 0.25; gcs.recv_q_hard_limit = 9223372036854775807; gcs.recv_q_soft_limit = 0.25; gcs.sync_donor = no; gmcast.segment = 0; gmcast.version = 0; pc.announce_timeout = PT3S; pc.checksum = false; pc.ignore_quorum = false; pc.ignore_sb = false; pc.npvo = false; pc.recovery = 1; pc.version = 0; pc.wait_prim = true; pc.wait_prim_timeout = PT30S; pc.weight = 1; protonet.backend = asio; protonet.version = 0; repl.causal_read_timeout = PT30S; repl.commit_order = 3; repl.key_format = FLAT8; repl.max_ws_size = 2147483647; repl.proto_max = 8; socket.checksum = 2; socket.recv_buf_size = 212992; 2018-05-17T01:50:17.411747+08:00 0 [Note] WSREP: gcache/src/GCache_seqno.cpp:seqno_reset():28: GCache history reset: 00000000-0000-0000-0000-000000000000:0 -> 00000000-0000-0000-0000-000000000000:-1 2018-05-17T01:50:17.413381+08:00 0 [Note] WSREP: galera/src/certification.cpp:assign_initial_position():914: Assign initial position for certification: -1, protocol version: -1 2018-05-17T01:50:17.413453+08:00 0 [Note] WSREP: Preparing to initiate SST/IST 2018-05-17T01:50:17.413461+08:00 0 [Note] WSREP: Starting replication 2018-05-17T01:50:17.413487+08:00 0 [Note] WSREP: galera/src/replicator_smm.cpp:connect():333: Setting initial position to 00000000-0000-0000-0000-000000000000:-1 2018-05-17T01:50:17.414419+08:00 0 [Note] WSREP: gcomm/src/datagram.cpp:checksum_type():26: Using CRC-32C for message checksums. 2018-05-17T01:50:17.414627+08:00 0 [Note] WSREP: gcs/src/gcs_gcomm.cpp:connect():279: gcomm thread scheduling priority set to other:0 2018-05-17T01:50:17.415218+08:00 0 [Warning] WSREP: gcomm/src/view.cpp:read_file():389: Fail to access the file (/data/mysql/mysql_3306/data//gvwstate.dat) error (No such file or directory). It is possible if node is booting for first time or re-booting after a graceful shutdown 2018-05-17T01:50:17.415278+08:00 0 [Note] WSREP: gcomm/src/pc.cpp:PC():257: Restoring primary-component from disk failed. Either node is booting for first time or re-booting after a graceful shutdown 2018-05-17T01:50:17.416620+08:00 0 [Note] WSREP: gcomm/src/gmcast.cpp:GMCast():98: GMCast version 0 2018-05-17T01:50:17.416838+08:00 0 [Note] WSREP: gcomm/src/gmcast.cpp:GMCast():191: (980e7263, 'tcp://0.0.0.0:4567') listening at tcp://0.0.0.0:4567 2018-05-17T01:50:17.416851+08:00 0 [Note] WSREP: gcomm/src/gmcast.cpp:GMCast():192: (980e7263, 'tcp://0.0.0.0:4567') multicast: , ttl: 1 2018-05-17T01:50:17.417090+08:00 0 [Note] WSREP: gcomm/src/evs_proto.cpp:Proto():199: EVS version 0 2018-05-17T01:50:17.417181+08:00 0 [Note] WSREP: gcs/src/gcs_gcomm.cpp:connect():288: gcomm: bootstrapping new group 'pxc_cyou' 2018-05-17T01:50:17.417218+08:00 0 [Note] WSREP: gcomm/src/pc.cpp:connect():96: start_prim is enabled, turn off pc_recovery 2018-05-17T01:50:17.425982+08:00 0 [Note] WSREP: gcomm/src/pc_proto.cpp:is_prim():796: Node 980e7263 state primary 2018-05-17T01:50:17.426061+08:00 0 [Note] WSREP: gcomm/src/pc_proto.cpp:deliver_view():229: Current view of cluster as seen by this node view (view_id(PRIM,980e7263,1) memb { 980e7263,0 } joined { } left { } partitioned { } ) 2018-05-17T01:50:17.426087+08:00 0 [Note] WSREP: gcomm/src/pc.cpp:handle_up():30: Save the discovered primary-component to disk 2018-05-17T01:50:17.426216+08:00 0 [Note] WSREP: gcomm/src/gmcast.cpp:handle_stable_view():1572: discarding pending addr without UUID: tcp://192.168.65.128:4567 2018-05-17T01:50:17.426240+08:00 0 [Note] WSREP: gcomm/src/gmcast.cpp:handle_stable_view():1582: discarding pending addr proto entry 0x28281a0 2018-05-17T01:50:17.426264+08:00 0 [Note] WSREP: gcomm/src/gmcast.cpp:handle_stable_view():1572: discarding pending addr without UUID: tcp://192.168.65.129:4567 2018-05-17T01:50:17.426284+08:00 0 [Note] WSREP: gcomm/src/gmcast.cpp:handle_stable_view():1582: discarding pending addr proto entry 0x2830970 2018-05-17T01:50:17.426298+08:00 0 [Note] WSREP: gcomm/src/gmcast.cpp:handle_stable_view():1572: discarding pending addr without UUID: tcp://192.168.65.130:4567 2018-05-17T01:50:17.426317+08:00 0 [Note] WSREP: gcomm/src/gmcast.cpp:handle_stable_view():1582: discarding pending addr proto entry 0x28390b0 2018-05-17T01:50:17.426341+08:00 0 [Note] WSREP: gcs/src/gcs_gcomm.cpp:connect():319: gcomm: connected 2018-05-17T01:50:17.426432+08:00 0 [Note] WSREP: gcs/src/gcs.cpp:gcs_shift_state():649: Shifting CLOSED -> OPEN (TO: 0) 2018-05-17T01:50:17.426830+08:00 0 [Note] WSREP: gcs/src/gcs_group.cpp:gcs_group_handle_comp_msg():410: New COMPONENT: primary = yes, bootstrap = no, my_idx = 0, memb_num = 1 2018-05-17T01:50:17.426952+08:00 0 [Note] WSREP: Waiting for SST/IST to complete. 2018-05-17T01:50:17.427992+08:00 0 [Note] WSREP: gcs/src/gcs_group.cpp:gcs_group_handle_comp_msg():471: Starting new group from scratch: 981052d1-5931-11e8-95f8-6b4d972d0618 2018-05-17T01:50:17.428533+08:00 0 [Note] WSREP: gcs/src/gcs_core.cpp:core_handle_comp_msg():767: STATE_EXCHANGE: sent state UUID: 98106228-5931-11e8-8261-ce4da364f82c 2018-05-17T01:50:17.428575+08:00 0 [Note] WSREP: gcs/src/gcs_core.cpp:core_handle_uuid_msg():862: STATE EXCHANGE: sent state msg: 98106228-5931-11e8-8261-ce4da364f82c 2018-05-17T01:50:17.428585+08:00 0 [Note] WSREP: gcs/src/gcs_group.cpp:gcs_group_handle_state_msg():593: STATE EXCHANGE: got state msg: 98106228-5931-11e8-8261-ce4da364f82c from 0 (my1-222) 2018-05-17T01:50:17.428593+08:00 0 [Note] WSREP: gcs/src/gcs_group.cpp:group_print_state_debug():575: Version : 4 Flags : 0x1 Protocols : 0 / 8 / 3 State : JOINED Desync count : 0 Prim state : NON-PRIMARY Prim UUID : 98103ecb-5931-11e8-a9ce-06f5a9ed25ac Prim seqno : 0 First seqno : -1 Last seqno : 0 Prim JOINED : 1 State UUID : 98106228-5931-11e8-8261-ce4da364f82c Group UUID : 981052d1-5931-11e8-95f8-6b4d972d0618 Name : 'my1-222' Incoming addr: '192.168.65.128:3306' 2018-05-17T01:50:17.428600+08:00 0 [Note] WSREP: gcs/src/gcs_group.cpp:group_post_state_exchange():369: Quorum results: version = 4, component = PRIMARY, conf_id = 0, members = 1/1 (primary/total), act_id = 0, last_appl. = -1, protocols = 0/8/3 (gcs/repl/appl), group UUID = 981052d1-5931-11e8-95f8-6b4d972d0618 2018-05-17T01:50:17.428605+08:00 0 [Note] WSREP: gcs/src/gcs.cpp:_set_fc_limits():856: Flow-control interval: [100, 100] 2018-05-17T01:50:17.428610+08:00 0 [Note] WSREP: gcs/src/gcs_sm.hpp:gcs_sm_continue():452: Trying to continue unpaused monitor 2018-05-17T01:50:17.428613+08:00 0 [Note] WSREP: gcs/src/gcs.cpp:gcs_handle_act_conf():1030: Restored state OPEN -> JOINED (0) 2018-05-17T01:50:17.428623+08:00 0 [Note] WSREP: gcs/src/gcs_group.cpp:gcs_group_handle_sync_msg():839: Member 0.0 (my1-222) synced with group. 2018-05-17T01:50:17.428628+08:00 0 [Note] WSREP: gcs/src/gcs.cpp:gcs_shift_state():649: Shifting JOINED -> SYNCED (TO: 0) 2018-05-17T01:50:17.458316+08:00 1 [Note] WSREP: New cluster view: global state: 981052d1-5931-11e8-95f8-6b4d972d0618:0, view# 1: Primary, number of nodes: 1, my index: 0, protocol version 3 2018-05-17T01:50:17.458460+08:00 1 [Note] WSREP: Setting wsrep_ready to true 2018-05-17T01:50:17.458581+08:00 0 [Note] WSREP: SST complete, seqno: 0 2018-05-17T01:50:17.463722+08:00 0 [Note] InnoDB: PUNCH HOLE support available 2018-05-17T01:50:17.463794+08:00 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 2018-05-17T01:50:17.463867+08:00 0 [Note] InnoDB: Uses event mutexes 2018-05-17T01:50:17.463937+08:00 0 [Note] InnoDB: GCC builtin __sync_synchronize() is used for memory barrier 2018-05-17T01:50:17.464022+08:00 0 [Note] InnoDB: Compressed tables use zlib 1.2.3 2018-05-17T01:50:17.464083+08:00 0 [Note] InnoDB: Using Linux native AIO 2018-05-17T01:50:17.464803+08:00 0 [Note] InnoDB: Number of pools: 1 2018-05-17T01:50:17.465418+08:00 0 [Note] InnoDB: Using CPU crc32 instructions 2018-05-17T01:50:17.474508+08:00 0 [Note] InnoDB: Initializing buffer pool, total size = 1G, instances = 1, chunk size = 128M 2018-05-17T01:50:17.588843+08:00 0 [Note] InnoDB: Completed initialization of buffer pool 2018-05-17T01:50:17.645874+08:00 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority(). 2018-05-17T01:50:17.698503+08:00 0 [Note] InnoDB: Crash recovery did not find the parallel doublewrite buffer at /data/mysql/mysql_3306/data/xb_doublewrite 2018-05-17T01:50:17.700525+08:00 0 [Note] InnoDB: Highest supported file format is Barracuda. 2018-05-17T01:50:17.741153+08:00 0 [Note] InnoDB: Created parallel doublewrite buffer at /data/mysql/mysql_3306/data/xb_doublewrite, size 3932160 bytes 2018-05-17T01:50:17.888093+08:00 0 [Note] InnoDB: Creating shared tablespace for temporary tables 2018-05-17T01:50:17.888241+08:00 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ... 2018-05-17T01:50:17.893192+08:00 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB. 2018-05-17T01:50:17.893944+08:00 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active. 2018-05-17T01:50:17.893973+08:00 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active. 2018-05-17T01:50:17.895820+08:00 0 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.7.21-rel20 started; log sequence number 2556467 2018-05-17T01:50:17.897476+08:00 0 [Note] InnoDB: Loading buffer pool(s) from /data/mysql/mysql_3306/data/ib_buffer_pool 2018-05-17T01:50:17.897534+08:00 0 [Note] Plugin 'FEDERATED' is disabled. 2018-05-17T01:50:17.945961+08:00 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them. 2018-05-17T01:50:17.946004+08:00 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory. 2018-05-17T01:50:17.952170+08:00 0 [Warning] CA certificate ca.pem is self signed. 2018-05-17T01:50:17.952485+08:00 0 [Note] Skipping generation of RSA key pair as key files are present in data directory. 2018-05-17T01:50:17.952717+08:00 0 [Note] Server hostname (bind-address): '*'; port: 3306 2018-05-17T01:50:17.952822+08:00 0 [Note] IPv6 is available. 2018-05-17T01:50:17.952844+08:00 0 [Note] - '::' resolves to '::'; 2018-05-17T01:50:17.952864+08:00 0 [Note] Server socket created on IP: '::'. 2018-05-17T01:50:17.972223+08:00 0 [Note] InnoDB: Buffer pool(s) load completed at 180517 1:50:17 2018-05-17T01:50:17.978401+08:00 0 [Warning] 'user' entry 'root@localhost' ignored in --skip-name-resolve mode. 2018-05-17T01:50:17.978488+08:00 0 [Warning] 'user' entry 'mysql.session@localhost' ignored in --skip-name-resolve mode. 2018-05-17T01:50:17.978501+08:00 0 [Warning] 'user' entry 'mysql.sys@localhost' ignored in --skip-name-resolve mode. 2018-05-17T01:50:17.978518+08:00 0 [Warning] 'db' entry 'performance_schema mysql.session@localhost' ignored in --skip-name-resolve mode. 2018-05-17T01:50:17.978526+08:00 0 [Warning] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode. 2018-05-17T01:50:17.978535+08:00 0 [Warning] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode. 2018-05-17T01:50:18.001905+08:00 0 [Warning] 'tables_priv' entry 'user mysql.session@localhost' ignored in --skip-name-resolve mode. 2018-05-17T01:50:18.001948+08:00 0 [Warning] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode. 2018-05-17T01:50:18.014839+08:00 0 [Note] Event Scheduler: Loaded 0 events 2018-05-17T01:50:18.018033+08:00 0 [Note] /usr/local/mysql/bin/mysqld: ready for connections. Version: '5.7.21-20-29.26-log' socket: '/data/mysql/mysql_3306/tmp/mysql_3306.sock' port: 3306 Percona XtraDB Cluster binary (GPL) 5.7.21-29.26, Revision 1702aea, wsrep_29.26 2018-05-17T01:50:18.018992+08:00 1 [Note] WSREP: Initialized wsrep sidno 2 2018-05-17T01:50:18.019048+08:00 1 [Note] WSREP: wsrep_notify_cmd is not defined, skipping notification. 2018-05-17T01:50:18.019073+08:00 1 [Note] WSREP: galera/src/replicator_smm.cpp:establish_protocol_versions():1507: REPL Protocols: 8 (3, 2) 2018-05-17T01:50:18.019083+08:00 1 [Note] WSREP: galera/src/certification.cpp:assign_initial_position():914: Assign initial position for certification: 0, protocol version: 3 2018-05-17T01:50:18.019174+08:00 0 [Note] WSREP: galera/src/galera_service_thd.cpp:thd_func():46: Service thread queue flushed. 2018-05-17T01:50:18.019268+08:00 1 [Note] WSREP: gcache/src/GCache_seqno.cpp:seqno_reset():28: GCache history reset: 00000000-0000-0000-0000-000000000000:0 -> 981052d1-5931-11e8-95f8-6b4d972d0618:0 2018-05-17T01:50:18.021254+08:00 1 [Note] WSREP: Synchronized with group, ready for connections 2018-05-17T01:50:18.021290+08:00 1 [Note] WSREP: Setting wsrep_ready to true 2018-05-17T01:50:18.021304+08:00 1 [Note] WSREP: wsrep_notify_cmd is not defined, skipping notification. 2018-05-17T01:50:57.955839+08:00 5 [Warning] 'user' entry 'root@localhost' ignored in --skip-name-resolve mode. 2018-05-17T01:50:57.955911+08:00 5 [Warning] 'user' entry 'mysql.session@localhost' ignored in --skip-name-resolve mode. 2018-05-17T01:50:57.955923+08:00 5 [Warning] 'user' entry 'mysql.sys@localhost' ignored in --skip-name-resolve mode. 2018-05-17T01:50:57.955930+08:00 5 [Warning] 'user' entry 'sst@localhost' ignored in --skip-name-resolve mode. 2018-05-17T01:50:57.955945+08:00 5 [Warning] 'db' entry 'performance_schema mysql.session@localhost' ignored in --skip-name-resolve mode. 2018-05-17T01:50:57.955950+08:00 5 [Warning] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode. 2018-05-17T01:50:57.955960+08:00 5 [Warning] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode. 2018-05-17T01:50:57.956017+08:00 5 [Warning] 'tables_priv' entry 'user mysql.session@localhost' ignored in --skip-name-resolve mode. 2018-05-17T01:50:57.956087+08:00 5 [Warning] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode. 2018-05-17T01:51:43.546356+08:00 5 [Warning] 'user' entry 'root@localhost' ignored in --skip-name-resolve mode. 2018-05-17T01:51:43.546412+08:00 5 [Warning] 'user' entry 'mysql.session@localhost' ignored in --skip-name-resolve mode. 2018-05-17T01:51:43.546426+08:00 5 [Warning] 'user' entry 'mysql.sys@localhost' ignored in --skip-name-resolve mode. 2018-05-17T01:51:43.546434+08:00 5 [Warning] 'user' entry 'sst@localhost' ignored in --skip-name-resolve mode. 2018-05-17T01:51:43.546476+08:00 5 [Warning] 'db' entry 'performance_schema mysql.session@localhost' ignored in --skip-name-resolve mode. 2018-05-17T01:51:43.546496+08:00 5 [Warning] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode. 2018-05-17T01:51:43.546508+08:00 5 [Warning] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode. 2018-05-17T01:51:43.546552+08:00 5 [Warning] 'tables_priv' entry 'user mysql.session@localhost' ignored in --skip-name-resolve mode. 2018-05-17T01:51:43.546576+08:00 5 [Warning] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode. 2018-05-17T01:51:58.862992+08:00 0 [Note] WSREP: gcomm/src/gmcast.cpp:handle_established():555: (980e7263, 'tcp://0.0.0.0:4567') connection established to d48a58f9 tcp://192.168.65.129:4567 2018-05-17T01:51:58.864023+08:00 0 [Note] WSREP: gcomm/src/gmcast.cpp:check_liveness():1152: (980e7263, 'tcp://0.0.0.0:4567') turning message relay requesting on, nonlive peers: 2018-05-17T01:51:59.364266+08:00 0 [Note] WSREP: gcomm/src/gmcast.cpp:handle_stable_view():1602: declaring d48a58f9 at tcp://192.168.65.129:4567 stable 2018-05-17T01:51:59.365750+08:00 0 [Note] WSREP: gcomm/src/pc_proto.cpp:is_prim():796: Node 980e7263 state primary 2018-05-17T01:51:59.366839+08:00 0 [Note] WSREP: gcomm/src/pc_proto.cpp:deliver_view():229: Current view of cluster as seen by this node view (view_id(PRIM,980e7263,2) memb { 980e7263,0 d48a58f9,0 } joined { } left { } partitioned { } ) 2018-05-17T01:51:59.366892+08:00 0 [Note] WSREP: gcomm/src/pc.cpp:handle_up():30: Save the discovered primary-component to disk 2018-05-17T01:51:59.368912+08:00 0 [Note] WSREP: gcs/src/gcs_group.cpp:gcs_group_handle_comp_msg():410: New COMPONENT: primary = yes, bootstrap = no, my_idx = 0, memb_num = 2 2018-05-17T01:51:59.369697+08:00 0 [Note] WSREP: gcs/src/gcs_core.cpp:core_handle_comp_msg():767: STATE_EXCHANGE: sent state UUID: d4d35610-5931-11e8-9688-badac771d91a 2018-05-17T01:51:59.371403+08:00 0 [Note] WSREP: gcs/src/gcs_core.cpp:core_handle_uuid_msg():862: STATE EXCHANGE: sent state msg: d4d35610-5931-11e8-9688-badac771d91a 2018-05-17T01:51:59.372265+08:00 0 [Note] WSREP: gcs/src/gcs_group.cpp:gcs_group_handle_state_msg():593: STATE EXCHANGE: got state msg: d4d35610-5931-11e8-9688-badac771d91a from 0 (my1-222) 2018-05-17T01:51:59.372321+08:00 0 [Note] WSREP: gcs/src/gcs_group.cpp:group_print_state_debug():575: Version : 4 Flags : 0x3 Protocols : 0 / 8 / 3 State : SYNCED Desync count : 0 Prim state : SYNCED Prim UUID : 98106228-5931-11e8-8261-ce4da364f82c Prim seqno : 1 First seqno : 1 Last seqno : 10 Prim JOINED : 1 State UUID : d4d35610-5931-11e8-9688-badac771d91a Group UUID : 981052d1-5931-11e8-95f8-6b4d972d0618 Name : 'my1-222' Incoming addr: '192.168.65.128:3306' 2018-05-17T01:51:59.864594+08:00 0 [Note] WSREP: gcs/src/gcs_group.cpp:gcs_group_handle_state_msg():593: STATE EXCHANGE: got state msg: d4d35610-5931-11e8-9688-badac771d91a from 1 (my2-223) 2018-05-17T01:51:59.864643+08:00 0 [Note] WSREP: gcs/src/gcs_group.cpp:group_print_state_debug():575: Version : 4 Flags : 00 Protocols : 0 / 8 / 3 State : NON-PRIMARY Desync count : 0 Prim state : NON-PRIMARY Prim UUID : 00000000-0000-0000-0000-000000000000 Prim seqno : -1 First seqno : -1 Last seqno : -1 Prim JOINED : 0 State UUID : d4d35610-5931-11e8-9688-badac771d91a Group UUID : 00000000-0000-0000-0000-000000000000 Name : 'my2-223' Incoming addr: '192.168.65.129:3306' 2018-05-17T01:51:59.864655+08:00 0 [Note] WSREP: gcs/src/gcs_group.cpp:group_post_state_exchange():369: Quorum results: version = 4, component = PRIMARY, conf_id = 1, members = 1/2 (primary/total), act_id = 10, last_appl. = 0, protocols = 0/8/3 (gcs/repl/appl), group UUID = 981052d1-5931-11e8-95f8-6b4d972d0618 2018-05-17T01:51:59.864662+08:00 0 [Note] WSREP: gcs/src/gcs.cpp:_set_fc_limits():856: Flow-control interval: [141, 141] 2018-05-17T01:51:59.864666+08:00 0 [Note] WSREP: gcs/src/gcs_sm.hpp:gcs_sm_continue():452: Trying to continue unpaused monitor 2018-05-17T01:51:59.864789+08:00 1 [Note] WSREP: New cluster view: global state: 981052d1-5931-11e8-95f8-6b4d972d0618:10, view# 2: Primary, number of nodes: 2, my index: 0, protocol version 3 2018-05-17T01:51:59.864803+08:00 1 [Note] WSREP: Setting wsrep_ready to true 2018-05-17T01:51:59.864813+08:00 1 [Note] WSREP: wsrep_notify_cmd is not defined, skipping notification. 2018-05-17T01:51:59.864820+08:00 1 [Note] WSREP: galera/src/replicator_smm.cpp:establish_protocol_versions():1507: REPL Protocols: 8 (3, 2) 2018-05-17T01:51:59.864838+08:00 1 [Note] WSREP: galera/src/certification.cpp:assign_initial_position():914: Assign initial position for certification: 10, protocol version: 3 2018-05-17T01:51:59.864882+08:00 0 [Note] WSREP: galera/src/galera_service_thd.cpp:thd_func():46: Service thread queue flushed. 2018-05-17T01:52:00.529837+08:00 0 [Note] WSREP: gcs/src/gcs_group.cpp:group_select_donor():1314: Member 1.0 (my2-223) requested state transfer from '*any*'. Selected 0.0 (my1-222)(SYNCED) as donor. 2018-05-17T01:52:00.529900+08:00 0 [Note] WSREP: gcs/src/gcs.cpp:gcs_shift_state():649: Shifting SYNCED -> DONOR/DESYNCED (TO: 10) 2018-05-17T01:52:00.530002+08:00 1 [Note] WSREP: wsrep_notify_cmd is not defined, skipping notification. 2018-05-17T01:52:00.530803+08:00 0 [Note] WSREP: Initiating SST/IST transfer on DONOR side (wsrep_sst_xtrabackup-v2 --role 'donor' --address '192.168.65.129:4444/xtrabackup_sst//1' --socket '/data/mysql/mysql_3306/tmp/mysql_3306.sock' --datadir '/data/mysql/mysql_3306/data/' --defaults-file '/etc/my.cnf' --defaults-group-suffix '' --binlog '/data/mysql/mysql_3306/logs/mysql-bin' --gtid '981052d1-5931-11e8-95f8-6b4d972d0618:10') 2018-05-17T01:52:00.576254+08:00 1 [Note] WSREP: DONOR thread signaled with 0 2018-05-17T01:52:02.132483+08:00 0 [Note] WSREP: gcomm/src/gmcast.cpp:check_liveness():1193: (980e7263, 'tcp://0.0.0.0:4567') turning message relay requesting off 2018-05-16T17:52:11.037831Z WSREP_SST: [INFO] Streaming the backup to joiner at 192.168.65.129 4444 2018-05-17T01:52:39.678013+08:00 0 [Note] WSREP: gcs/src/gcs_group.cpp:gcs_group_handle_join_msg():793: 0.0 (my1-222): State transfer to 1.0 (my2-223) complete. 2018-05-17T01:52:39.678107+08:00 0 [Note] WSREP: gcs/src/gcs.cpp:gcs_shift_state():649: Shifting DONOR/DESYNCED -> JOINED (TO: 10) 2018-05-17T01:52:39.679181+08:00 0 [Note] WSREP: gcs/src/gcs_group.cpp:gcs_group_handle_sync_msg():839: Member 0.0 (my1-222) synced with group. 2018-05-17T01:52:39.679277+08:00 0 [Note] WSREP: gcs/src/gcs.cpp:gcs_shift_state():649: Shifting JOINED -> SYNCED (TO: 10) 2018-05-17T01:52:39.679342+08:00 1 [Note] WSREP: Synchronized with group, ready for connections 2018-05-17T01:52:39.679386+08:00 1 [Note] WSREP: Setting wsrep_ready to true 2018-05-17T01:52:39.679396+08:00 1 [Note] WSREP: wsrep_notify_cmd is not defined, skipping notification. 2018-05-17T01:52:48.454000+08:00 0 [Note] WSREP: gcs/src/gcs_group.cpp:gcs_group_handle_join_msg():793: 1.0 (my2-223): State transfer from 0.0 (my1-222) complete. 2018-05-17T01:52:48.454715+08:00 0 [Note] WSREP: gcs/src/gcs_group.cpp:gcs_group_handle_sync_msg():839: Member 1.0 (my2-223) synced with group. 2018-05-17T01:52:59.315214+08:00 0 [Note] WSREP: gcomm/src/gmcast.cpp:handle_established():555: (980e7263, 'tcp://0.0.0.0:4567') connection established to f8911862 tcp://192.168.65.130:4567 2018-05-17T01:52:59.316580+08:00 0 [Note] WSREP: gcomm/src/gmcast.cpp:check_liveness():1152: (980e7263, 'tcp://0.0.0.0:4567') turning message relay requesting on, nonlive peers: 2018-05-17T01:52:59.425060+08:00 0 [Note] WSREP: gcomm/src/gmcast.cpp:handle_stable_view():1602: declaring d48a58f9 at tcp://192.168.65.129:4567 stable 2018-05-17T01:52:59.425111+08:00 0 [Note] WSREP: gcomm/src/gmcast.cpp:handle_stable_view():1602: declaring f8911862 at tcp://192.168.65.130:4567 stable 2018-05-17T01:52:59.426122+08:00 0 [Note] WSREP: gcomm/src/pc_proto.cpp:is_prim():796: Node 980e7263 state primary 2018-05-17T01:52:59.429044+08:00 0 [Note] WSREP: gcomm/src/pc_proto.cpp:deliver_view():229: Current view of cluster as seen by this node view (view_id(PRIM,980e7263,3) memb { 980e7263,0 d48a58f9,0 f8911862,0 } joined { } left { } partitioned { } ) 2018-05-17T01:52:59.429109+08:00 0 [Note] WSREP: gcomm/src/pc.cpp:handle_up():30: Save the discovered primary-component to disk 2018-05-17T01:52:59.430406+08:00 0 [Note] WSREP: gcs/src/gcs_group.cpp:gcs_group_handle_comp_msg():410: New COMPONENT: primary = yes, bootstrap = no, my_idx = 0, memb_num = 3 2018-05-17T01:52:59.431186+08:00 0 [Note] WSREP: gcs/src/gcs_core.cpp:core_handle_comp_msg():767: STATE_EXCHANGE: sent state UUID: f89ffe41-5931-11e8-b95d-d31cbbb4291e 2018-05-17T01:52:59.433335+08:00 0 [Note] WSREP: gcs/src/gcs_core.cpp:core_handle_uuid_msg():862: STATE EXCHANGE: sent state msg: f89ffe41-5931-11e8-b95d-d31cbbb4291e 2018-05-17T01:52:59.435402+08:00 0 [Note] WSREP: gcs/src/gcs_group.cpp:gcs_group_handle_state_msg():593: STATE EXCHANGE: got state msg: f89ffe41-5931-11e8-b95d-d31cbbb4291e from 0 (my1-222) 2018-05-17T01:52:59.435515+08:00 0 [Note] WSREP: gcs/src/gcs_group.cpp:group_print_state_debug():575: Version : 4 Flags : 0x3 Protocols : 0 / 8 / 3 State : SYNCED Desync count : 0 Prim state : SYNCED Prim UUID : d4d35610-5931-11e8-9688-badac771d91a Prim seqno : 2 First seqno : 1 Last seqno : 10 Prim JOINED : 2 State UUID : f89ffe41-5931-11e8-b95d-d31cbbb4291e Group UUID : 981052d1-5931-11e8-95f8-6b4d972d0618 Name : 'my1-222' Incoming addr: '192.168.65.128:3306' 2018-05-17T01:52:59.435563+08:00 0 [Note] WSREP: gcs/src/gcs_group.cpp:gcs_group_handle_state_msg():593: STATE EXCHANGE: got state msg: f89ffe41-5931-11e8-b95d-d31cbbb4291e from 1 (my2-223) 2018-05-17T01:52:59.435578+08:00 0 [Note] WSREP: gcs/src/gcs_group.cpp:group_print_state_debug():575: Version : 4 Flags : 0x2 Protocols : 0 / 8 / 3 State : SYNCED Desync count : 0 Prim state : SYNCED Prim UUID : d4d35610-5931-11e8-9688-badac771d91a Prim seqno : 2 First seqno : -1 Last seqno : 10 Prim JOINED : 2 State UUID : f89ffe41-5931-11e8-b95d-d31cbbb4291e Group UUID : 981052d1-5931-11e8-95f8-6b4d972d0618 Name : 'my2-223' Incoming addr: '192.168.65.129:3306' 2018-05-17T01:52:59.816445+08:00 0 [Note] WSREP: gcs/src/gcs_group.cpp:gcs_group_handle_state_msg():593: STATE EXCHANGE: got state msg: f89ffe41-5931-11e8-b95d-d31cbbb4291e from 2 (my3-224) 2018-05-17T01:52:59.816504+08:00 0 [Note] WSREP: gcs/src/gcs_group.cpp:group_print_state_debug():575: Version : 4 Flags : 00 Protocols : 0 / 8 / 3 State : NON-PRIMARY Desync count : 0 Prim state : NON-PRIMARY Prim UUID : 00000000-0000-0000-0000-000000000000 Prim seqno : -1 First seqno : -1 Last seqno : -1 Prim JOINED : 0 State UUID : f89ffe41-5931-11e8-b95d-d31cbbb4291e Group UUID : 00000000-0000-0000-0000-000000000000 Name : 'my3-224' Incoming addr: '192.168.65.130:3306' 2018-05-17T01:52:59.816533+08:00 0 [Note] WSREP: gcs/src/gcs_group.cpp:group_post_state_exchange():369: Quorum results: version = 4, component = PRIMARY, conf_id = 2, members = 2/3 (primary/total), act_id = 10, last_appl. = 0, protocols = 0/8/3 (gcs/repl/appl), group UUID = 981052d1-5931-11e8-95f8-6b4d972d0618 2018-05-17T01:52:59.816544+08:00 0 [Note] WSREP: gcs/src/gcs.cpp:_set_fc_limits():856: Flow-control interval: [173, 173] 2018-05-17T01:52:59.816550+08:00 0 [Note] WSREP: gcs/src/gcs_sm.hpp:gcs_sm_continue():452: Trying to continue unpaused monitor 2018-05-17T01:52:59.816688+08:00 4 [Note] WSREP: New cluster view: global state: 981052d1-5931-11e8-95f8-6b4d972d0618:10, view# 3: Primary, number of nodes: 3, my index: 0, protocol version 3 2018-05-17T01:52:59.816718+08:00 4 [Note] WSREP: Setting wsrep_ready to true 2018-05-17T01:52:59.816731+08:00 4 [Note] WSREP: wsrep_notify_cmd is not defined, skipping notification. 2018-05-17T01:52:59.816742+08:00 4 [Note] WSREP: galera/src/replicator_smm.cpp:establish_protocol_versions():1507: REPL Protocols: 8 (3, 2) 2018-05-17T01:52:59.816750+08:00 4 [Note] WSREP: galera/src/certification.cpp:assign_initial_position():914: Assign initial position for certification: 10, protocol version: 3 2018-05-17T01:52:59.817024+08:00 0 [Note] WSREP: galera/src/galera_service_thd.cpp:thd_func():46: Service thread queue flushed. 2018-05-17T01:53:00.473701+08:00 0 [Note] WSREP: gcs/src/gcs_group.cpp:group_select_donor():1314: Member 2.0 (my3-224) requested state transfer from '*any*'. Selected 0.0 (my1-222)(SYNCED) as donor. 2018-05-17T01:53:00.473778+08:00 0 [Note] WSREP: gcs/src/gcs.cpp:gcs_shift_state():649: Shifting SYNCED -> DONOR/DESYNCED (TO: 10) 2018-05-17T01:53:00.473899+08:00 4 [Note] WSREP: wsrep_notify_cmd is not defined, skipping notification. 2018-05-17T01:53:00.474066+08:00 0 [Note] WSREP: Initiating SST/IST transfer on DONOR side (wsrep_sst_xtrabackup-v2 --role 'donor' --address '192.168.65.130:4444/xtrabackup_sst//1' --socket '/data/mysql/mysql_3306/tmp/mysql_3306.sock' --datadir '/data/mysql/mysql_3306/data/' --defaults-file '/etc/my.cnf' --defaults-group-suffix '' --binlog '/data/mysql/mysql_3306/logs/mysql-bin' --gtid '981052d1-5931-11e8-95f8-6b4d972d0618:10') 2018-05-17T01:53:00.474683+08:00 4 [Note] WSREP: DONOR thread signaled with 0 2018-05-17T01:53:02.735429+08:00 0 [Note] WSREP: gcomm/src/gmcast.cpp:check_liveness():1193: (980e7263, 'tcp://0.0.0.0:4567') turning message relay requesting off 2018-05-16T17:53:10.795663Z WSREP_SST: [INFO] Streaming the backup to joiner at 192.168.65.130 4444 2018-05-17T01:53:54.344231+08:00 0 [Note] WSREP: gcs/src/gcs_group.cpp:gcs_group_handle_join_msg():793: 0.0 (my1-222): State transfer to 2.0 (my3-224) complete. 2018-05-17T01:53:54.344293+08:00 0 [Note] WSREP: gcs/src/gcs.cpp:gcs_shift_state():649: Shifting DONOR/DESYNCED -> JOINED (TO: 10) 2018-05-17T01:53:54.345959+08:00 0 [Note] WSREP: gcs/src/gcs_group.cpp:gcs_group_handle_sync_msg():839: Member 0.0 (my1-222) synced with group. 2018-05-17T01:53:54.346015+08:00 0 [Note] WSREP: gcs/src/gcs.cpp:gcs_shift_state():649: Shifting JOINED -> SYNCED (TO: 10) 2018-05-17T01:53:54.346060+08:00 4 [Note] WSREP: Synchronized with group, ready for connections 2018-05-17T01:53:54.346070+08:00 4 [Note] WSREP: Setting wsrep_ready to true 2018-05-17T01:53:54.346080+08:00 4 [Note] WSREP: wsrep_notify_cmd is not defined, skipping notification. 2018-05-17T01:54:02.688138+08:00 0 [Note] WSREP: gcs/src/gcs_group.cpp:gcs_group_handle_join_msg():793: 2.0 (my3-224): State transfer from 0.0 (my1-222) complete. 2018-05-17T01:54:02.689114+08:00 0 [Note] WSREP: gcs/src/gcs_group.cpp:gcs_group_handle_sync_msg():839: Member 2.0 (my3-224) synced with group. [root@my1-222 ~]#