Tungsten Replicator: MariaDB MySQL Master/Slave server setup on single server
Synching .102 separate Tungsten Replicator slave with .101 master
I had shutdown .102 separate Tungsten Replicator slave while doing .101 master/slave setup. So decided to reboot .101 master + local slave and start up .102 seprate slave and see if .102 slave synchs up with .101 master.
Looks like they’re all synced up with same global tranasaction id and info
[root@centos6 ~]# mysqladmin create testlocalslavedb |
.101 master
[root@centos6 ~]# ls -alh /var/lib/{mysql,mysql2} <strong>/var/lib/mysql:</strong> total 2.2G drwxr-xr-x. 9 mysql mysql 4.0K Sep 19 08:55 . drwxr-xr-x. 41 root root 4.0K Sep 19 08:37 .. -rw-rw----. 1 mysql mysql 16K Sep 19 06:32 aria_log.00000001 -rw-rw----. 1 mysql mysql 52 Sep 19 06:32 aria_log_control -rw-rw----. 1 mysql mysql 155 Sep 16 14:19 centos6.err -rw-rw----. 1 mysql mysql 5 Sep 19 08:42 centos6.localdomain.pid -rw-rw----. 1 mysql mysql 5 Sep 18 05:57 centos6.pid -rw-rw----. 1 mysql mysql 2.0G Sep 19 08:55 ibdata1 -rw-rw----. 1 mysql mysql 17K Aug 10 01:52 ibdata1.gz -rw-rw----. 1 mysql mysql 64M Sep 19 08:55 ib_logfile0 -rw-rw----. 1 mysql mysql 16K Aug 10 01:52 ib_logfile0.gz -rw-rw----. 1 mysql mysql 64M Sep 18 05:57 ib_logfile1 -rw-rw----. 1 mysql mysql 5.1K Aug 10 01:25 ib_logfile1.gz drwx------. 2 mysql mysql 4.0K Sep 16 14:19 mysql -rw-rw----. 1 mysql mysql 125 Sep 17 15:50 mysql-bin.000001 -rw-rw----. 1 mysql mysql 665 Sep 17 16:42 mysql-bin.000002 -rw-rw----. 1 mysql mysql 259 Sep 18 05:49 mysql-bin.000003 -rw-rw----. 1 mysql mysql 259 Sep 18 05:57 mysql-bin.000004 -rw-rw----. 1 mysql mysql 1.2K Sep 18 06:37 mysql-bin.000005 -rw-rw----. 1 mysql mysql 1.1K Sep 18 08:55 mysql-bin.000006 -rw-rw----. 1 mysql mysql 1.4K Sep 18 15:52 mysql-bin.000007 -rw-rw----. 1 mysql mysql 414 Sep 18 15:52 mysql-bin.000008 -rw-rw----. 1 mysql mysql 125 Sep 18 18:23 mysql-bin.000009 -rw-rw----. 1 mysql mysql 125 Sep 18 18:26 mysql-bin.000010 -rw-rw----. 1 mysql mysql 125 Sep 18 19:30 mysql-bin.000011 -rw-rw----. 1 mysql mysql 125 Sep 18 20:04 mysql-bin.000012 -rw-rw----. 1 mysql mysql 125 Sep 18 20:34 mysql-bin.000013 -rw-rw----. 1 mysql mysql 125 Sep 18 20:39 mysql-bin.000014 -rw-rw----. 1 mysql mysql 106 Sep 18 20:45 mysql-bin.000015 -rw-rw----. 1 mysql mysql 529 Sep 19 05:52 mysql-bin.000016 -rw-rw----. 1 mysql mysql 125 Sep 19 06:04 mysql-bin.000017 -rw-rw----. 1 mysql mysql 125 Sep 19 06:22 mysql-bin.000018 -rw-rw----. 1 mysql mysql 125 Sep 19 06:32 mysql-bin.000019 -rw-rw----. 1 mysql mysql 106 Sep 19 06:37 mysql-bin.000020 -rw-rw----. 1 mysql mysql 106 Sep 19 08:09 mysql-bin.000021 -rw-rw----. 1 mysql mysql 638 Sep 19 08:55 mysql-bin.000022 -rw-rw----. 1 mysql mysql 418 Sep 19 08:42 mysql-bin.index srwxrwxrwx. 1 mysql mysql 0 Sep 19 08:42 mysql.sock -rw-r--r--. 1 root root 13 Sep 16 14:19 mysql_upgrade_info drwx------. 2 mysql mysql 4.0K Aug 10 01:25 test drwx------. 2 mysql mysql 4.0K Sep 18 07:04 test2 drwx------. 2 mysql mysql 4.0K Sep 18 15:37 test3 drwx------. 2 mysql mysql 4.0K Sep 19 08:55 testlocalslavedb drwx------. 2 mysql mysql 4.0K Sep 18 06:04 tungsten drwx------. 2 mysql mysql 4.0K Sep 18 06:37 tungsten_rep1 <strong>/var/lib/mysql2:</strong> total 385M drwxr-xr-x. 8 mysql mysql 4.0K Sep 19 08:55 . drwxr-xr-x. 41 root root 4.0K Sep 19 08:37 .. -rw-rw----. 1 mysql mysql 16K Sep 19 08:47 aria_log.00000001 -rw-rw----. 1 mysql mysql 52 Sep 19 08:47 aria_log_control -rw-rw----. 1 mysql mysql 0 Sep 19 08:37 centos6.err -rw-rw----. 1 mysql mysql 5 Sep 19 08:47 centos6.localdomain.pid -rw-r-----. 1 mysql mysql 3.2K Sep 19 08:47 error.log -rw-rw----. 1 mysql mysql 256M Sep 19 08:50 ibdata1 -rw-rw----. 1 mysql mysql 64M Sep 19 08:55 ib_logfile0 -rw-rw----. 1 mysql mysql 64M Sep 19 08:47 ib_logfile1 drwx------. 2 mysql mysql 4.0K Sep 19 08:37 mysql -rw-rw----. 1 mysql mysql 20K Sep 19 08:37 mysql-bin.000001 -rw-rw----. 1 mysql mysql 701K Sep 19 08:37 mysql-bin.000002 -rw-rw----. 1 mysql mysql 336 Sep 19 08:47 mysql-bin.000003 -rw-rw----. 1 mysql mysql 57 Sep 19 08:47 mysql-bin.index srwxrwxrwx. 1 mysql mysql 0 Sep 19 08:47 mysql.sock drwx------. 2 mysql mysql 4.0K Sep 19 08:37 test drwx------. 2 mysql mysql 4.0K Sep 19 08:50 test2 drwx------. 2 mysql mysql 4.0K Sep 19 08:50 test3 drwx------. 2 mysql mysql 4.0K Sep 19 08:55 testlocalslavedb drwx------. 2 mysql mysql 4.0K Sep 19 08:47 tungsten_rep1 |
.101 local slave
[tungsten@centos6 root]$ bash /opt/tungsten2/tungsten/tungsten-replicator/bin/trepctl -port 10500 -service rep1 status Processing status command... NAME VALUE ---- ----- appliedLastEventId : mysql-bin.000023:0000000000000529;4 appliedLastSeqno : 21 appliedLatency : 124.683 clusterName : default currentEventId : NONE currentTimeMillis : 1316397925260 dataServerHost : 127.0.0.1 extensions : host : null latestEpochNumber : 20 masterConnectUri : thl://192.168.56.101:2112/ masterListenUri : thl://127.0.0.1:22000/ maximumStoredSeqNo : 21 minimumStoredSeqNo : 0 offlineRequests : NONE pendingError : NONE pendingErrorCode : NONE pendingErrorEventId : NONE pendingErrorSeqno : -1 pendingExceptionMessage: NONE resourcePrecedence : 99 rmiPort : -1 role : slave seqnoType : java.lang.Long serviceName : rep1 serviceType : local simpleServiceName : rep1 siteName : default sourceId : 127.0.0.1 state : ONLINE timeInStateSeconds : 2.101 uptimeSeconds : 2.581 Finished status command... |
.102 separate slave
[tungsten@localhost ~]$ trepctl -service rep1 status Processing status command... NAME VALUE ---- ----- appliedLastEventId : mysql-bin.000023:0000000000000529;4 appliedLastSeqno : 21 appliedLatency : 59.002 clusterName : default currentEventId : NONE currentTimeMillis : 1316397942002 dataServerHost : 192.168.56.102 extensions : host : null latestEpochNumber : 20 masterConnectUri : thl://192.168.56.101 masterListenUri : thl://192.168.56.102:2112/ maximumStoredSeqNo : 21 minimumStoredSeqNo : 0 offlineRequests : NONE pendingError : NONE pendingErrorCode : NONE pendingErrorEventId : NONE pendingErrorSeqno : -1 pendingExceptionMessage: NONE resourcePrecedence : 99 rmiPort : -1 role : slave seqnoType : java.lang.Long serviceName : rep1 serviceType : local simpleServiceName : rep1 siteName : default sourceId : 192.168.56.102 state : ONLINE timeInStateSeconds : 84.494 uptimeSeconds : 86.717 Finished status command... You have new mail in /var/spool/mail/root |
.102 separate slave’s mysql data directory
[tungsten@localhost ~]$ ls -alh /var/lib/mysql total 2.2G drwxr-xr-x 9 mysql mysql 4.0K Sep 19 12:04 . drwxr-xr-x 30 root root 4.0K Aug 31 17:39 .. -rw-rw---- 1 mysql mysql 16K Sep 18 05:57 aria_log.00000001 -rw-rw---- 1 mysql mysql 52 Sep 18 05:57 aria_log_control -rw-rw---- 1 mysql mysql 2.0G Sep 19 12:04 ibdata1 -rw-rw---- 1 mysql mysql 64M Sep 19 12:04 ib_logfile0 -rw-rw---- 1 mysql mysql 64M Sep 18 05:57 ib_logfile1 -rw-rw---- 1 mysql mysql 0 Aug 31 17:39 localhost.err -rw-rw---- 1 mysql mysql 5 Sep 19 12:02 localhost.localdomain.pid drwx--x--x 2 mysql mysql 4.0K Aug 31 17:40 mysql -rw-rw---- 1 mysql mysql 259 Sep 18 05:57 mysql-bin.000001 -rw-rw---- 1 mysql mysql 1.7K Sep 18 08:54 mysql-bin.000002 -rw-rw---- 1 mysql mysql 724 Sep 18 15:50 mysql-bin.000003 -rw-rw---- 1 mysql mysql 644 Sep 18 15:52 mysql-bin.000004 -rw-rw---- 1 mysql mysql 336 Sep 19 12:04 mysql-bin.000005 -rw-rw---- 1 mysql mysql 95 Sep 19 12:02 mysql-bin.index srwxrwxrwx 1 mysql mysql 0 Sep 19 12:02 mysql.sock -rw-r--r-- 1 root root 13 Aug 31 17:40 mysql_upgrade_info -rw-rw---- 1 mysql mysql 4 Sep 19 12:02 pbxt-lock drwxr-xr-x 2 mysql mysql 4.0K Aug 31 17:39 test drwx------ 2 mysql mysql 4.0K Sep 18 07:04 test2 drwx------ 2 mysql mysql 4.0K Sep 18 15:37 test3 drwx------ 2 mysql mysql 4.0K Sep 19 12:04 testlocalslavedb drwx------ 2 mysql mysql 4.0K Sep 18 06:03 tungsten drwx------ 2 mysql mysql 4.0K Sep 18 06:37 tungsten_rep1 |
Check back regularly for more of my Tungsten Replicator adventures. You should be able to get updates via my Twitter, Facebook, or Tungsten Replicator RSS feed.