Specifying additional TCP Locators using the "-Dlocators" JVM argument does not result in the TCP Locators recognizing each other.
For example, if you start the TCP Locators using the following line in the "startlocator.bat":
java -cp .\gemfire.jar com.gemstone.gemfire.internal.SystemAdmin start-locator -port=%port% -address=%bindaddr% -Djava.io.tmpdir=%TEMPDIR% -Dgemfire.log-file=GFLocator.log -Dgemfire.license-type=production -Dgemfire.license-file=gemfireLicense.zip -Dlocator=10.131.96.64[22345],10.131.96.217[22345]
Then the "GFLocator.log" will still only show one node, and indicate there is no other Distribution Manager:
...
[info 2015/02/10 12:27:15.933 CET tid=0x1] GemFire P2P Listener started on tcp:///10.131.96.64:63464
[config 2015/02/10 12:27:21.152 CET tid=0x1] This member, 10.131.96.64:30179, is becoming group coordinator.
[info 2015/02/10 12:27:21.152 CET tid=0x1] Entered into membership in group GF6.5.1.35 with ID 10.131.96.64(:admin):30179/63464.
[info 2015/02/10 12:27:21.152 CET tid=0x1] Starting DistributionManager 10.131.96.64(:admin):30179/63464.
[info 2015/02/10 12:27:21.152 CET tid=0x1] Initial (membershipManager) view = [10.131.96.64(:admin):30179/63464]
[info 2015/02/10 12:27:21.152 CET tid=0x1] DMMembership: Admitting new administration member < 10.131.96.64(:admin):30179/63464 >.
[info 2015/02/10 12:27:21.152 CET tid=0x1] Did not hear back from any other system. I am the first one.
[info 2015/02/10 12:27:21.152 CET tid=0x1] DistributionManager 10.131.96.64(:admin):30179/63464 started on 10.131.96.64[22345]. There were 0 other DMs. others: [] (admin only)
...
In order for the TCP Locators to recognize each other, you need to specify the additional members by passing them in a "GemFire.properties" file.
You can follow the steps below
- Create a "GemFire.properties" file in the directory where you run the TCP Locator.
- Pass the parameters required in the "GemFire.properties" file, for example:
name=<TCP Locator name>
locators=10.131.96.64[22345],10.131.96.217[22345]
- Pass the file using the “-DgemfirePropertyFile” by starting the locator as follow:
java -cp .\gemfire.jar com.gemstone.gemfire.internal.SystemAdmin start-locator -port=%port% -address=%bindaddr% -DgemfirePropertyFile=gemfire.properties -Djava.io.tmpdir=%TEMPDIR% -Dgemfire.log-file=GFLocator.log -Dgemfire.license-type=production -Dgemfire.license-file=gemfireLicense.zip
- Apply the same change on all TCP Locators (You will need to provide a unique name in the "GemFire.properties" file for each instance).
When you start the TCP Locators, you will finally see them recognising each other as Distribution Members in the "GFLocator.log":
...
[info 2015/02/12 11:08:23.281 GMT TCPLocator1 tid=0x1] GemFire P2P Listener started on tcp:///10.131.96.217:49262
[info 2015/02/12 11:08:23.796 GMT TCPLocator1 tid=0x1] Attempting to join distributed system whose membership coordinator is 10.131.96.64:36169 using membership ID 10.131.96.217:32186
[info 2015/02/12 11:08:23.984 GMT TCPLocator1 tid=0x1] Entered into membership in group GF6.5.1.17 with ID 10.131.96.217(:admin):32186/49262.
[info 2015/02/12 11:08:23.984 GMT TCPLocator1 tid=0x1] Starting DistributionManager 10.131.96.217(:admin):32186/49262.
[info 2015/02/12 11:08:23.984 GMT TCPLocator1 tid=0x1] Initial (membershipManager) view = [10.131.96.64(:admin):36169/49227, 10.131.96.217(:admin):32186/49262]
[info 2015/02/12 11:08:23.984 GMT TCPLocator1 tid=0x1] DMMembership: Admitting new administration member < 10.131.96.64(:admin):36169/49227 >.
[info 2015/02/12 11:08:23.984 GMT TCPLocator1 tid=0x1] DMMembership: Admitting new administration member < 10.131.96.217(:admin):32186/49262 >.
[info 2015/02/12 11:08:24.031 GMT TCPLocator1 tid=0x1] DistributionManager 10.131.96.217(:admin):32186/49262 started on 10.131.96.217[22345]10.131.96.64[22345]. There were 0 other DMs. others: [] (admin only)
...