您好,登錄后才能下訂單哦!
1、trove mysql replica 一些限制
trove 可以同時支持binlog replica 和gtid replica
gtid 需要mysql5.6及其以上版本
newton trove 對mysql 的 binlog replica 支持不是很好
newton trove 對mysql的gtid replica 可以正常工作
newton trove 可以創建 mysql5.5 binlog replica
detach-replica:Mysql 5.5 binlog 模式可以正常工作
eject-replica-source:對binlog復制模式mysql5.5報錯,binlog模式報錯信息:Could not locate column in row for column 'Master_UUID'
promote-to-replica-source:Mysql5.5 binlog 模式報錯,操作中會用到gtid
2、與replica 相關的命令
trove create # 創建復制 trove detach-replica # 從復制中移除slave trove promote-to-replica-source #master,slave都存活的情況下,將指定的slave提升為master,原master降為slave trove eject-replica-source # 當master失去心跳,可以移除master,trove在slave選擇一個合適的節點作為master
3、創建復制
trove create ab 6 --size 5 --databases myDB \ --users userA:password --datastore_version mysql-5.6 \ --datastore mysql trove create ab-slave1 6 --size 5 --replica_of ab --replica_count 2 \ --datastore_version mysql-5.6 --datastore mysql
4、分離slave
trove show ab-slave2-2 +-------------------+--------------------------------------+ | Property | Value | +-------------------+--------------------------------------+ | created | 2017-03-31T03:29:20 | | datastore | mysql | | datastore_version | mysql-5.6 | | flavor | 6 | | id | caa908f1-5e14-4c65-ac0e-a9ba26536107 | | ip | 172.168.10.6 | | name | ab-slave2-2 | | replica_of | 3d39a475-3277-4d24-9467-ebc254e9316f | | status | ACTIVE | | updated | 2017-03-31T06:19:30 | | volume | 5 | | volume_used | 0.14 | +-------------------+--------------------------------------+ trove detach-replica ab-slave2-2 trove show ab-slave2-2 +-------------------+--------------------------------------+ | Property | Value | +-------------------+--------------------------------------+ | created | 2017-03-31T03:29:20 | | datastore | mysql | | datastore_version | mysql-5.6 | | flavor | 6 | | id | caa908f1-5e14-4c65-ac0e-a9ba26536107 | | ip | 172.168.10.6 | | name | ab-slave2-2 | | status | ACTIVE | | updated | 2017-03-31T06:28:45 | | volume | 5 | | volume_used | 0.14 | +-------------------+--------------------------------------+
5、提升slave為master
trove show ab-slave3-1 +-------------------+--------------------------------------+ | Property | Value | +-------------------+--------------------------------------+ | created | 2017-03-31T03:36:16 | | datastore | mysql | | datastore_version | mysql-5.6 | | flavor | 6 | | id | f303fc8f-819b-47b5-b33a-38184c8aff90 | | ip | 172.168.10.14 | | name | ab-slave3-1 | | replica_of | 3d39a475-3277-4d24-9467-ebc254e9316f | | status | ACTIVE | | updated | 2017-03-31T06:19:30 | | volume | 5 | | volume_used | 0.14 | +-------------------+--------------------------------------+ trove promote-to-replica-source ab-slave3-1 # ab-slave3-1已提升為master trove show ab-slave3-1 +-------------------+----------------------------------------------------------------------------+ | Property | Value | +-------------------+----------------------------------------------------------------------------+ | created | 2017-03-31T03:36:16 | | datastore | mysql | | datastore_version | mysql-5.6 | | flavor | 6 | | id | f303fc8f-819b-47b5-b33a-38184c8aff90 | | ip | 172.168.10.14 | | name | ab-slave3-1 | | replicas | 3d39a475-3277-4d24-9467-ebc254e9316f, f4b3be64-c204-439d-a9c4-e28cb543a3b9 | | status | ACTIVE | | updated | 2017-03-31T06:33:39 | | volume | 5 | | volume_used | 0.14 | +-------------------+----------------------------------------------------------------------------+ # master已降級為slave trove show 3d39a475-3277-4d24-9467-ebc254e9316f +-------------------+--------------------------------------+ | Property | Value | +-------------------+--------------------------------------+ | created | 2017-03-31T06:14:35 | | datastore | mysql | | datastore_version | mysql-5.6 | | flavor | 6 | | id | 3d39a475-3277-4d24-9467-ebc254e9316f | | ip | 172.168.10.8 | | name | ab | | replica_of | f303fc8f-819b-47b5-b33a-38184c8aff90 | | status | ACTIVE | | updated | 2017-03-31T06:33:39 | | volume | 5 | | volume_used | 0.14 | +-------------------+--------------------------------------+
6、移除master
移除master需要在master已經失去心跳的情況下做,如果master尚有心跳是無法移除master的
可以通過停止master上的trove-guestagent模擬master失去心跳
service trove-guestagent stop trove eject-replica-source
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。