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
推荐阅读
- 监控mysql主从同步状态是否异常
- SQL优化最干货总结 - MySQL
- 淘宝的数据库,主键是如何设计的?
- Mysql注入 -- 联合注入
- Explain关键字 什么是MySQL的执行计划?
- Mysql删除数据表的三种方式详解
- 保税仓跨境电商?跨境电商进口保税模式下进入保税仓库的货物
- 看这篇就够了!MySQL 索引知识点超全总结
- 一次解决mysql锁表问题的经历
- CentOS 如何用rpm安装Mysql
