GTID模式 mysql集群搭建( 二 )

2).查看集群状态mysql> show master status;+-------------------------+----------+--------------+------------------+------------------------------------------+| File                  | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set                      |+-------------------------+----------+--------------+------------------+------------------------------------------+| mysql-master-bin.000002 |    995 |            |                | 95a3f56b-b6e4-11eb-8a6a-3a4c58bd3f13:1-4 |+-------------------------+----------+--------------+------------------+------------------------------------------+1 row in set (0.00 sec)mysql> show slave hosts;+-----------+------+------+-----------+--------------------------------------+| Server_id | Host | Port | Master_id | Slave_UUID                           |+-----------+------+------+-----------+--------------------------------------+|         3 |    | 4980 |         1 | a00b9b71-b6e4-11eb-8a2f-f6cc164fe846 ||         2 |    | 4980 |         1 | 9ea77650-b6e4-11eb-8963-a6f44ead4ab1 |+-----------+------+------+-----------+--------------------------------------+2 rows in set (0.00 sec)mysql> show global variables like '%gtid%';+----------------------------------+---------------------------------------------+| Variable_name                  | Value                                       |+----------------------------------+---------------------------------------------+| binlog_gtid_simple_recovery    | ON                                        || enforce_gtid_consistency         | ON                                        || gtid_executed                  | 3b8e89ca-fe36-11ea-bbba-66ef29902e35:1-2057 || gtid_executed_compression_period | 1000                                      || gtid_mode                      | ON                                        || gtid_owned                       |                                             || gtid_purged                    |                                             || session_track_gtids            | OFF                                         |+----------------------------------+---------------------------------------------+8 rows in set (0.01 sec)4.开机自启systemctl enable mysqldsystemctl start mysqld



推荐阅读