Installing Tungsten Replicator on Multiple Ports

Today I’ve been setting up tungsten on hosts which have multiple instances running on different ports

The hosts are tung1, tung2 and tung3 (all centos 6  running mysql 5.1) with tung1 being the master and tung2 and 3 being slaves.

The instances in this case are on ports 3101 and 3102. You need to do  a separate install for each port



./tools/tungsteninstaller
    masterslave
    masterhost=tung1
    datasourceuser=tungsten
    datasourcepassword=secret
    –datasource-port=3101
    servicename=tr3101
    homedirectory=/opt/tungsten/tr_3101 
    clusterhosts=tung1,tung2,tung3
    –thl-port=2101
    –rmi-port=10001
    startandreport

./tools/tungsteninstaller
    masterslave
    masterhost=tung1
    datasourceuser=tungsten
    datasourcepassword=secret
    –datasource-port=3102
    servicename=tr3102
    homedirectory=/opt/tungsten/tr_3101 
    clusterhosts=tung1,tung2,tung3
    –thl-port=2102
    –rmi-port=10003
    startandreport
It appears that the replicator needs 2 RMI ports hence the jump as tr3101 is using 10001 and 10002 and tr3102 is using 10003 and 10004

When you use trepctl you need to add the -port=rmi_port to access it
Advertisements
Installing Tungsten Replicator on Multiple Ports

Another interesting mysql feature

I’ve been having problems with replication on a dev machine today because of a rather annoying feature. It appears it is possible to have a comma in a database name so if you use the command
replicate_do_db = db1,db2
It actually thinks you are trying to replicate the database ‘db1,db2’ which obviously doesn’t exist
They have to be added on 2 separate lines for it to work
replicate_do_db = db1
replicate_do_db = db2
Annoyingly the show slave statement actually uses commas to separate the databases
*************************** 1. row ***************************
               Slave_IO_State: Connecting to master
                  Master_Host: dev1
                  Master_User: repuser
                  Master_Port: 3103
                Connect_Retry: 60
              Master_Log_File: mysql-bin.000133
          Read_Master_Log_Pos: 3067355
               Relay_Log_File: peripheral_3105-relay-bin.000214
                Relay_Log_Pos: 407551
        Relay_Master_Log_File: mysql-bin.000133
             Slave_IO_Running: Yes
            Slave_SQL_Running: Yes
              Replicate_Do_DB: db1,db2
          Replicate_Ignore_DB:

It’s documented here in the manual 



Warning
To specify multiple databases you must use multiple instances of this option. Because database names can contain commas, if you supply a comma separated list then the list will be treated as the name of a single database.

Another interesting mysql feature