..... [ OK ]
[root@node3 ~]#
日志输出如下:
[root@node3 mysql]# tail -n 20 node3.err
2014-07-2510:49:2638949 [Note] InnoDB: Percona XtraDB () 5.6.19-67.0 started; log sequence number 1626646
2014-07-2510:49:2638949 [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: 4ad6df19-13a6-11e4-aae1-000c29d894d0.
2014-07-2510:49:2738949 [Note] RSA private key file not found: /data/mysql//private_key.pem. Some authentication plugins will not work.
2014-07-2510:49:2738949 [Note] RSA public key file not found: /data/mysql//public_key.pem. Some authentication plugins will not work.
2014-07-2510:49:2738949 [Note] Server hostname (bind-address): '*'; port: 3306
2014-07-2510:49:2738949 [Note] IPv6 is available.
2014-07-2510:49:2738949 [Note] - '::' resolves to '::';
2014-07-2510:49:2738949 [Note] Server socket created on IP: '::'.
2014-07-2510:49:2738949 [Note] Event Scheduler: Loaded 0 events
2014-07-2510:49:2738949 [Note] WSREP: Signalling provider to continue.
2014-07-2510:49:2738949 [Note] WSREP: inited wsrep sidno 1
2014-07-2510:49:2738949 [Note] WSREP: SST received: 2dc360e7-135f-11e4-a4e9-126b1471680b:1
2014-07-2510:49:2738949 [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:49:2838949 [Note] WSREP: 0.0 (node3): State transfer from 1.0 (node1) complete.
2014-07-2510:49:2838949 [Note] WSREP: Shifting JOINER -> JOINED (TO: 1)
2014-07-2510:49:2838949 [Note] WSREP: Member 0.0 (node3) synced with group.
2014-07-2510:49:2838949 [Note] WSREP: Shifting JOINED -> SYNCED (TO: 1)
2014-07-2510:49:2838949 [Note] WSREP: Synchronized with group, ready for connections
2014-07-2510:49:2838949 [Note] WSREP: wsrep_notify_cmd is not defined, skipping notification.
[root@node3 mysql]#
如果启动失败,日志里面也会有提示的,通常启动失败的原因有如下:
(1)配置文件错误
(2)防火墙没有开放相应的端口,比如默认的4567端口
(3)忘记进行授权账号
(4)xtrabackup没有安装或者安装有问题
下面我们进行相关的测试,比如在node节点创建表,插入数据,看另外两个节点是否有数据。
node1节点创建表t1,插入数据,在另外两个节点也可以看见:
mysql> create database linuxidc;
Query OK, 1 row affected (0.02 sec)
mysql> use linuxidc
Database changed
mysql> create table t1 ( idint,name char(20)) engine=innodb;
Query OK, 0 rows affected (0.03 sec)
mysql> insert into t1 select1,'linuxidc';
Query OK, 1 row affected (0.00 sec)
Records: 1 Duplicates: 0 Warnings: 0
mysql> select * from t1;
+------+-------+
| id | name |
+------+-------+
| 1 | linuxidc |
+------+-------+
1 row in set (0.00 sec)
mysql>
node2节点:
mysql>select*from linuxidc.t1;
+------+-------+
| id | name |
+------+-------+
| 1| linuxidc |
+------+-------+
1 row inset (0.00 sec)
mysql>
node3节点:
mysql>select*from linuxidc.t1;
+------+-------+
| id | name |
+------+-------+
| 1| linuxidc |
+------+-------+
1 row inset (0.00 sec)
mysql>
到这里搭建就基本结束了。3个节点同时支持write/read操作。最大节点数量不建议超过8个,更加详细的介绍以及细节建议大家参考官方文档。
总结: