Event Timeline
Comment Actions
>>> import WMFMariaDB >>> import WMFReplication >>> db1 = WMFMariaDB.WMFMariaDB(host='127.0.0.1') >>> db2 = WMFMariaDB.WMFMariaDB(host='127.0.0.1', port=3307) >>> db3 = WMFMariaDB.WMFMariaDB(host='127.0.0.1', port=3308) >>> db1r = WMFReplication.WMFReplication(db1) >>> db2r = WMFReplication.WMFReplication(db2) >>> db3r = WMFReplication.WMFReplication(db3) >>> db1.name() '127.0.0.1:3306/(none)' >>> db2.name() '127.0.0.1:3307/(none)' >>> db3.name() '127.0.0.1:3308/(none)' >>> db1r.debug() 127.0.0.1:3306/(none)> Not configured as a slave >>> db2r.debug() 127.0.0.1:3307/(none)> master: 127.0.0.1:3306, io: Yes, sql: Yes, lag: 0, pos: sangai-bin.000003/1683948 >>> db3r.debug() 127.0.0.1:3308/(none)> master: 127.0.0.1:3306, io: Yes, sql: Yes, lag: 0, pos: sangai-bin.000003/1683948 >>> db3r.move(db2) /usr/lib/python3/dist-packages/pymysql/cursors.py:170: Warning: (1278, "It is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave's mysqld restart") result = self._query(query) {'success': True} >>> db1r.debug() 127.0.0.1:3306/(none)> Not configured as a slave >>> db2r.debug() 127.0.0.1:3307/(none)> master: 127.0.0.1:3306, io: Yes, sql: Yes, lag: 0, pos: sangai-bin.000003/1696195 >>> db3r.debug() 127.0.0.1:3308/(none)> master: 127.0.0.1:3307, io: Yes, sql: Yes, lag: 0, pos: sangai-bin.000003/1640009 >>> db2r.move(db3) {'success': False, 'errno': -1, 'errmsg': 'The topology change cannot be done at the moment- check its relationship, replication status or replication lag'} >>> db1r.move(db3) {'success': False, 'errno': -1, 'errmsg': 'The host is not configured as a replica'} >>> db3r.move(db1) {'success': True} >>> db1r.debug() 127.0.0.1:3306/(none)> Not configured as a slave >>> db2r.debug() 127.0.0.1:3307/(none)> master: 127.0.0.1:3306, io: Yes, sql: Yes, lag: 0, pos: sangai-bin.000003/1721682 >>> db3r.debug() 127.0.0.1:3308/(none)> master: 127.0.0.1:3306, io: Yes, sql: Yes, lag: 0, pos: sangai-bin.000003/1723337