MySQL高可用架构PXC(Percona XtraDB Cluster)(3)

wsrep_slave_threads=2                                                         

binlog_format=ROW                                                               

default_storage_engine=InnoDB                                                 

innodb_autoinc_lock_mode=2                                                     

wsrep_cluster_name=pxc-linuxidc                                                   

wsrep_sst_auth=sst:linuxidc                                                       

wsrep_sst_method=xtrabackup-v2         

node3的配置如下:

[mysqld]

basedir = /usr/local/services/mysql

datadir = /data/mysql/data

wsrep_provider=/usr/local/services/mysql/lib/libgalera_smm.so                           

wsrep_cluster_address=gcomm://192.168.0.100,192.168.0.101,192.168.0.102       

wsrep_node_address=192.168.0.102                                           

wsrep_slave_threads=2                                                         

binlog_format=ROW                                                             

default_storage_engine=InnoDB                                                 

innodb_autoinc_lock_mode=2                                                     

wsrep_cluster_name=pxc-linuxidc                                                   

wsrep_sst_auth=sst:linuxidc                                                       

wsrep_sst_method=xtrabackup-v2         

node2,node3节点都配置完成以后,我们启动,对于第2,3个节点启动和我们普通的MySQL启动方式一样。

node2启动:

[root@node2 ~]# /etc/init.d/mysqld start

MySQL (Percona XtraDB Cluster) is not running, but lock fil[FAILED]lock/subsys/mysql) exists

Starting MySQL (Percona XtraDB Cluster)...............State transfer in progress, setting sleep higher

.............                                              [  OK  ]

[root@node2 ~]#

日志输出如下:

[root@node2 mysql]# tail -n 20 node2.err

2014-07-2510:44:2933172 [Note] InnoDB:  Percona XtraDB () 5.6.19-67.0 started; log sequence number 1626646

2014-07-2510:44:2933172 [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: 997242b1-13a5-11e4-aa74-000c29fedc91.

2014-07-2510:44:2933172 [Note] RSA private key file not found: /data/mysql//private_key.pem. Some authentication plugins will not work.

2014-07-2510:44:2933172 [Note] RSA public key file not found: /data/mysql//public_key.pem. Some authentication plugins will not work.

2014-07-2510:44:2933172 [Note] Server hostname (bind-address): '*'; port: 3306

2014-07-2510:44:2933172 [Note] IPv6 is available.

2014-07-2510:44:2933172 [Note]  - '::' resolves to '::';

2014-07-2510:44:2933172 [Note] Server socket created on IP: '::'.

2014-07-2510:44:2933172 [Note] Event Scheduler: Loaded 0 events

2014-07-2510:44:2933172 [Note] WSREP: Signalling provider to continue.

2014-07-2510:44:2933172 [Note] WSREP: inited wsrep sidno 1

2014-07-2510:44:2933172 [Note] WSREP: SST received: 2dc360e7-135f-11e4-a4e9-126b1471680b:1

2014-07-2510:44:2933172 [Note] /usr/local/mysql/bin/mysqld: ready for connections.

Version: '5.6.19-67.0-25.6'  socket: '/tmp/mysql.sock'  port: 3306  Percona XtraDB Cluster binary (GPL) 5.6.19-25.6, Revision 824, wsrep_25.6.r4111

2014-07-2510:44:3033172 [Note] WSREP: 1.0 (node2): State transfer from 0.0 (node1) complete.

2014-07-2510:44:3033172 [Note] WSREP: Shifting JOINER -> JOINED (TO: 1)

2014-07-2510:44:3033172 [Note] WSREP: Member 1.0 (node2) synced with group.

2014-07-2510:44:3033172 [Note] WSREP: Shifting JOINED -> SYNCED (TO: 1)

2014-07-2510:44:3033172 [Note] WSREP: Synchronized with group, ready for connections

2014-07-2510:44:3033172 [Note] WSREP: wsrep_notify_cmd is not defined, skipping notification.

[root@node2 mysql]#

node3启动:

[root@node3 ~]# /etc/init.d/mysqld start

MySQL (Percona XtraDB Cluster) is not running, but lock fil[FAILED]lock/subsys/mysql) exists

Starting MySQL (Percona XtraDB Cluster)....................................State transfer in progress, setting sleep higher

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/9e6e5d32b2c1f66b1c4b8c0b1f01d320.html