gfsh
using the bind-address
option (e.g. bind-address=172.16.43.146
and jmx-manager-bind-address=172.16.43.146
) may sometimes automatically connect to the other IP address and give a [java.net.ConnectException: Connection refused]
exception.Example:
gfsh>start locator --name=gfshlocator --bind-address=172.16.43.146 --J=-Dgemfire.jmx-manager-bind-address=172.16.43.146 --port=13489 Starting a GemFire Locator in /home/gpadmin/apps/gemfireServer810/gfshlocator... ............................... Locator in /home/gpadmin/apps/gemfireServer810/gfshlocator on 172.16.43.146[13489] as gfshlocator is currently online. Process ID: 118185 Uptime: 16 seconds GemFire Version: 8.1.0 Java Version: 1.7.0_45 Log File: /home/gpadmin/apps/gemfireServer810/gfshlocator/gfshlocator.log JVM Arguments: -Dgemfire.enable-cluster-configuration=true -Dgemfire.load-cluster-configuration-from-dir=false -Dgemfire.jmx-manager-bind-address=172.16.43.146 -Dgemfire.launcher.registerSignalHandlers=true -Djava.awt.headless=true -Dsun.rmi.dgc.server.gcInterval=9223372036854775806 Class-Path: /home/gpadmin/apps/Pivotal_GemFire_810_b50625_Linux/lib/gemfire.jar:/home/gpadmin/apps/Pivotal_GemFire_810_b50625_Linux/lib/locator-dependencies.jar Please use "connect --locator=172.16.43.146[13489]" to connect Gfsh to the locator. Failed to connect; unknown cause: Connection refused to host: 10.50.253.25; nested exception is: java.net.ConnectException: Connection refused Cluster configuration service is up and running. gfsh>connect --locator=172.16.43.146[13489] Connecting to Locator at [host=172.16.43.146, port=13489] .. Connecting to Manager at [host=172.16.43.146, port=1099] .. Connection refused to host: 10.50.253.25; nested exception is: java.net.ConnectException: Connection refused
To make sure that the correct IP address is set for JMX clients, you can use the system property java.rmi.server.hostname
Example:
start locator --name=locator --bind-address=172.16.43.146 --J=-Dgemfire.jmx-manager-bind-address=172.16.43.146 --port=13489 --J=-Djava.rmi.server.hostname=172.16.43.146
Starting a GemFire Locator in /home/gpadmin/apps/gemfireServer810/locator...
................................
Locator in /home/gpadmin/apps/gemfireServer810/locator on 172.16.43.146[13489] as locator is currently online.
Process ID: 118676
Uptime: 16 seconds
GemFire Version: 8.1.0
Java Version: 1.7.0_45
Log File: /home/gpadmin/apps/gemfireServer810/locator/locator.log
JVM Arguments: -Dgemfire.enable-cluster-configuration=true -Dgemfire.load-cluster-configuration-from-dir=false -Dgemfire.jmx-manager-bind-address=172.16.43.146 -Djava.rmi.server.hostname=172.16.43.146 -Dgemfire.launcher.registerSignalHandlers=true -Djava.awt.headless=true -Dsun.rmi.dgc.server.gcInterval=9223372036854775806
Class-Path: /home/gpadmin/apps/Pivotal_GemFire_810_b50625_Linux/lib/gemfire.jar:/home/gpadmin/apps/Pivotal_GemFire_810_b50625_Linux/lib/locator-dependencies.jar
Successfully connected to: [host=172.16.43.146, port=2099]
Cluster configuration service is up and running.