Tungsten Replicator: MariaDB MySQL Master/Slave server setup on single server
Step 2).
Add Tungsten Replicator local slave 127.0.0.1 server to .101 master defining separate Tungsten Home & THL directories and separate THL/RMI ports.
Add slave
[root@centos6 ~]# mysqladmin create testlocalslavedb |
Checking Tungsten Replicator master and slave services and status. Note the role field either reports master or slave.
master service
[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 |
slave service on RMI port 10500
[tungsten@centos6 tungsten-replicator-2.0.4]$ bash /opt/tungsten2/tungsten/tungsten-replicator/bin/trepctl -port 10500 services Processing services command... NAME VALUE ---- ----- appliedLastSeqno: 19 appliedLatency : 0.362 role : slave serviceName : rep1 serviceType : local started : true state : ONLINE Finished services command... |
master status
[tungsten@centos6 tungsten-replicator-2.0.4]$ bash /opt/tungsten/tungsten/tungsten-replicator/bin/trepctl -service rep1 status Processing status command... NAME VALUE ---- ----- appliedLastEventId : mysql-bin.000022:0000000000000638;8 appliedLastSeqno : 19 appliedLatency : 0.03 clusterName : default currentEventId : mysql-bin.000022:0000000000000638 currentTimeMillis : 1316389465273 dataServerHost : 192.168.56.101 extensions : host : null latestEpochNumber : 17 masterConnectUri : thl://192.168.56.102 masterListenUri : thl://192.168.56.101:2112/ maximumStoredSeqNo : 19 minimumStoredSeqNo : 0 offlineRequests : NONE pendingError : NONE pendingErrorCode : NONE pendingErrorEventId : NONE pendingErrorSeqno : -1 pendingExceptionMessage: NONE resourcePrecedence : 99 rmiPort : -1 role : master seqnoType : java.lang.Long serviceName : rep1 serviceType : local simpleServiceName : rep1 siteName : default sourceId : 192.168.56.101 state : ONLINE timeInStateSeconds : 3241.28 uptimeSeconds : 3244.518 Finished status command... |
slave status on RMI port 10500
[tungsten@centos6 tungsten-replicator-2.0.4]$ bash /opt/tungsten2/tungsten/tungsten-replicator/bin/trepctl -port 10500 -service rep1 status Processing status command... NAME VALUE ---- ----- appliedLastEventId : mysql-bin.000022:0000000000000638;8 appliedLastSeqno : 19 appliedLatency : 0.362 clusterName : default currentEventId : NONE currentTimeMillis : 1316389475455 dataServerHost : 127.0.0.1 extensions : host : null latestEpochNumber : 17 masterConnectUri : thl://192.168.56.101:2112/ masterListenUri : thl://127.0.0.1:22000/ maximumStoredSeqNo : 19 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 : 3253.083 uptimeSeconds : 3418.168 Finished status command... |