zkfan / tungsten-replicator

Automatically exported from code.google.com/p/tungsten-replicator
0 stars 0 forks source link

Tungsten installer on same server works on 'localhost' but not with '127.0.0.1' #132

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Install one master and one slave on the same server, using MySQL sandboxes

./tools/tungsten-installer --master-slave \
  --cluster-hosts=127.0.0.1 \
  --master-host=127.0.0.1 \
  --datasource-port=7101 \
  --datasource-user=msandbox \
  --datasource-password=msandbox \
  --home-directory=$HOME/tsb2//db1 \
  --datasource-log-directory=$HOME/sandboxes/tr_dbs/node1/data \
  --service-name=tsandbox \
  --thl-directory=$HOME/tsb2//db1/tlogs 
  --thl-port=12111 --rmi-port=10101 --start

./tools/tungsten-installer \
  --master-slave \
  --cluster-hosts=127.0.0.1 \
  --master-host=localhost \
  --master-thl-port=12111 \
  --datasource-port=7102 \
  --datasource-user=msandbox \
  --datasource-password=msandbox \
  --home-directory=$HOME/tsb2//db2 \
  --datasource-log-directory=$HOME/sandboxes/tr_dbs/node2/data \
  --service-name=tsandbox \
  --thl-directory=$HOME/tsb2//db2/tlogs \
  --thl-port=12112 --rmi-port=10102 --start

WARN  >> The master-host (localhost) does not appear in the cluster-hosts 
(127.0.0.1).
gmac4.local >> The master-host (localhost) does not appear in the cluster-hosts 
(127.0.0.1).  
Do you want to continue with the configuration (Y) or quit (Q)?
y

2. When the slave has --cluster-hosts=127.0.0.1 and --master-host=localhost, 
installation succeeds, but the installer asks for confirmation, thus making it 
impossible to run this command in a script.

3. When the slave has --cluster-host=127.0.0.1 and --master-host=127.0.0.1, the 
installation succeeds, and no confirmation is asked, but replication does not 
work. Each node becomes a master.

What is the expected output?

 ~/tsb2/trepctl_all services
Processing services command...
NAME              VALUE
----              -----
appliedLastSeqno: 0
appliedLatency  : 0.231
role            : master
serviceName     : tsandbox
serviceType     : local
started         : true
state           : ONLINE
Finished services command...
Processing services command...
NAME              VALUE
----              -----
appliedLastSeqno: 0
appliedLatency  : 0.138
role            : slave    # <------
serviceName     : tsandbox
serviceType     : local
started         : true
state           : ONLINE
Finished services command...

What do you see instead?

 ~/tsb2/trepctl_all services
Processing services command...
NAME              VALUE
----              -----
appliedLastSeqno: 0
appliedLatency  : 0.706
role            : master
serviceName     : tsandbox
serviceType     : local
started         : true
state           : ONLINE
Finished services command...
Processing services command...
NAME              VALUE
----              -----
appliedLastSeqno: 0
appliedLatency  : 0.236
role            : master   # <-----
serviceName     : tsandbox
serviceType     : local
started         : true
state           : ONLINE
Finished services command...

What is the possible cause?

N/A

What is the proposed solution?

Make sure that localhost and 127.0.0.1 are considered as the same host.

Original issue reported on code.google.com by g.maxia on 27 Jun 2011 at 1:13

GoogleCodeExporter commented 9 years ago
Robert,

There are some new checks to to ensure that examples like this work.  I did not 
try to duplicate this issue prior to adding those checks so I can't guarantee 
that this is the right fix.  Could you try to duplicate the issue again?

Original comment by jeffm...@gmail.com on 3 Jul 2011 at 10:55

GoogleCodeExporter commented 9 years ago
The issue is repeatable in the same way as described above.

Original comment by g.maxia on 5 Jul 2011 at 7:47

GoogleCodeExporter commented 9 years ago
This has been fixed.  The tungsten-installer script will configure a service in 
the slave role if:

- The hostname does not match the master hostname
or
- The master-thl-port is different than thl-port

This will allow you to use '127.0.0.1' for all of the hostnames and update the 
thl-port and master-thl-port accordingly.

Original comment by jeffm...@gmail.com on 6 Jul 2011 at 1:42

GoogleCodeExporter commented 9 years ago
Thanks. The fix works. 

Original comment by g.maxia on 7 Jul 2011 at 10:39