1. 程式人生 > >Mysql Group Replication 簡介及單主模式組複製配置

Mysql Group Replication 簡介及單主模式組複製配置

  1. mysql> create database test;
  2. 2017-03-31T23:23:45.535115Z8[Note]Plugin group_replication reported:'Primary had applied all relay logs, disabled conflict detection'
  3. Query OK,1 row affected (0.03 sec)
  4. mysql> use test;
  5. Database changed
  6. mysql> create table t1(c1 int primary key,c2 text not null);
  7. Query OK
    ,0 rows affected (0.03 sec)
  8. mysql> insert into t1 values (1,'Luis');
  9. Query OK,1 row affected (0.01 sec)
  10. mysql> select * from t1;
  11. +----+------+
  12. | c1 | c2 |
  13. +----+------+
  14. |1|Luis|
  15. +----+------+
  16. 1 row inset(0.00 sec)
  17. mysql> show binlog events;
  18. +---------------+------+----------------+-----------+-------------+----------------------------------------------------------------------------------------------------------------------+
  19. | Log_name | Pos | Event_type | Server_id | End_log_pos | Info | +---------------+------+----------------+-----------+-------------+----------------------------------------------------------------------------------------------------------------------+ | binlog.000001 | 4 | Format_desc | 1 | 123 | Server ver: 5.7.17-log, Binlog ver: 4 | | binlog.000001 | 123 | Previous_gtids | 1 | 150 | | | binlog.000001 | 150 | Gtid | 1 | 211 | SET @@SESSION.GTID_NEXT= '21355e09-16ea-11e7-bb6b-000c29433013:1' | | binlog.000001 | 211 | Query | 1 | 386 | ALTER USER 'root'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9' | | binlog.000001 | 386 | Gtid | 1 | 447 | SET @@SESSION.GTID_NEXT= 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1' | | binlog.000001 | 447 | Query | 1 | 506 | BEGIN | | binlog.000001 | 506 | View_change | 1 | 645 | view_id=14910585094598745:1 | | binlog.000001 | 645 | Query | 1 | 710 | COMMIT | | binlog.000001 | 710 | Gtid | 1 | 771 | SET @@SESSION.GTID_NEXT= 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:2' | | binlog.000001 | 771 | Query | 1 | 861 | create database test | | binlog.000001 | 861 | Gtid | 1 | 922 | SET @@SESSION.GTID_NEXT= 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:3' | | binlog.000001 | 922 | Query | 1 | 1044 | use `test`; create table t1(c1 int primary key,c2 text not null) | | binlog.000001 | 1044 | Gtid | 1 | 1105 | SET @@SESSION.GTID_NEXT= 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:4' | | binlog.000001 | 1105 | Query | 1 | 1173 | BEGIN | | binlog.000001 | 1173 | Table_map | 1 | 1216 | table_id: 220 (test.t1) | | binlog.000001 | 1216 | Write_rows | 1 | 1258 | table_id: 220 flags: STMT_END_F | | binlog.000001 | 1258 | Xid | 1 | 1285 | COMMIT /* xid=40 */ | +---------------+------+----------------+-----------+-------------+----------------------------------------------------------------------------------------------------------------------+ 17 rows in set (0.00 sec)