Hopefully you've got this working by now, but I believe the issue is a host
naming one. i.e. your JVM thinks the hostname for your system resolves to
127.0.0.1. Your original post contained this:

gfsh>connect --locator=192.168.20.109[10334]
Connecting to Locator at [host=192.168.20.109, port=10334] ..
Connecting to Manager at [host=192.168.20.109, port=1099] ..
*Connection refused to host: 127.0.0.1*; nested exception is:
    java.net.ConnectException: Connection refused

This *is* an RMI issue. RMI performs a handshake process when a client
connects. Initially, the client connects to the given host and port and
performs a service lookup. The RMI server then responds with an address and
port on which the client should connect for that service. The default
address is the hostname of the system. In this case, the server responded
with 127.0.0.1 which ultimately didn't work.

In this case you should be setting *--bind-address* on both server and
locator as well as setting *java.rmi.server.hostname *(gfsh
--J=-Djava.rmi.server.hostname=x.x.x.x).

We have a Jira ticket which will improve this situation as setting
(jmx-manager-)bind-address should also ensure that RMI clients receive the
correct address.

--Jens


On Sun, Feb 14, 2016 at 1:01 PM, John Blum <[email protected]> wrote:

> Alternatively, you can set the jmx-manager-bind-address property for the
> locator/manager as well, as in...
>
> // on host 192.168.20.109
>
> gfsh>start locator --name=Locator1 ...
> --J=-Dgemfire.jmx-manager-bind-address=192.168.20.109
> ...
>
> gfsh>start server --name=Server1 ...
>
>
>
> Then from 192.168.20.110...
>
> gfsh>connect --locator=192.168.20.109[10334]
>
> If that does not work (maybe because something funky with your systems
> network setup), then...
>
> // also from 192.168.20.110
>
> gfsh>connect --jmx-manager=192.168.20.110[1099]
>
> Hope this helps!
>
> -j
>
> On Sun, Feb 14, 2016 at 11:10 AM, Luke Shannon <[email protected]>
> wrote:
>
>> I have not used those args before. Here are some examples from a recent
>> POC I did on AWS. Each process had its own machine.
>>
>> Here is the start locator:
>>
>> start locator1 --name=locator1 --bind-address=<static IP on AWS>
>> --enable-cluster-configuration=false --port=<the port> --J=-Xms1g
>> --J=-Xmx1g --J=-XX:+PrintFlagsFinal --log-level=error
>>
>> Then for a server to connect to this process (running on a diff AWS
>> machine):
>>
>> start server --name=server1 --use-cluster-configuration=false
>> --bind-address=<Static IP on AWS for this machine> --locators=<locator1 AWS
>> static IP>[<locator 1 port>] --properties-file=<directory this is
>> in>/gemfire.properties --rebalance=true --J=-Xms<heap> --J=-Xmx<heap>
>> --J=-XX:+PrintFlagsFinal --cache-xml-file=<directory this in>/cache.xml
>>
>> You don't need the properties or cache file so you can ignore those for
>> now.
>>
>> To connect from any machine I launch gfsh and put in:
>> connect --locator=<Locator 1 AWS Static IP>[<locator 1 port>]
>>
>>
>> On Sun, Feb 14, 2016 at 1:53 PM, Alan Kash <[email protected]> wrote:
>>
>>> Hi,
>>>
>>> Following this thread -
>>> https://communities.vmware.com/thread/428088?start=0&tstart=0
>>>
>>> "The error points to an RMI issue. When starting the locator, please
>>> set the property *java.rmi.server.hostname"*
>>>
>>>
>>> *gfsh>start locator --name=l1 --bind-address=192.168.20.109
>>> --hostname-for-clients=192.168.20.109
>>> --J=-Djava.rmi.server.hostname=192.168.20.109*
>>>
>>> *I was able to set the locator connection.*
>>>
>>> *Starting a new server*
>>>
>>>
>>>
>>> *gfsh>start server --name=alps --bind-address=192.168.20.100Starting a
>>> GemFire Server in /home/z/alps.................................Server in
>>> /home/z/alps on alps[40404] as alps is currently online.Process ID:
>>> 25858Uptime: 16 secondsGemFire Version: 1.0.0-incubating.M2-SNAPSHOTJava
>>> Version: 1.8.0_66Log File: /home/z/alps/alps.logJVM Arguments:
>>> -Dgemfire.default.locators=192.168.20.109:192.168.20.109[10334]
>>> -Dgemfire.use-cluster-configuration=true
>>> -Dgemfire.bind-address=192.168.20.100 -XX:OnOutOfMemoryError=kill -KILL %p
>>> -Dgemfire.launcher.registerSignalHandlers=true -Djava.awt.headless=true
>>> -Dsun.rmi.dgc.server.gcInterval=9223372036854775806Class-Path:
>>> /home/z/palindrome/store/geode/apache-geode/lib/gemfire-core-1.0.0-incubating.M2-SNAPSHOT.jar:/home/z/palindrome/store/geode/apache-geode/lib/gemfire-core-dependencies.jar*
>>> The ServerLauncher process started locally. But, my list member list is
>>> not getting updated with the new server nodes. It always shows locator
>>> address.
>>>
>>>
>>> gfsh>list members;
>>> Name | Id
>>> ---- | ---------------------------------------------
>>> l1   | 192.168.20.109(l1:11926:locator)<ec><v0>:1024
>>>
>>>
>>> I am suspecting - 
>>> *-Dgemfire.default.locators=192.168.20.109:192.168.20.109[10334]
>>> in JVM Arguments is the issue ? *
>>>
>>>
>>>
>>>
>>> On Sun, Feb 14, 2016 at 12:27 PM, Luke Shannon <[email protected]>
>>> wrote:
>>>
>>>> This might be easier to figure out if I could see your set up. If you
>>>> are interested email me directly and I could take a look in a short screen
>>>> share.
>>>>
>>>> On Sun, Feb 14, 2016 at 12:22 PM, Luke Shannon <[email protected]>
>>>> wrote:
>>>>
>>>>> Sorry, I should have been more clear. I was referring to the Locator.
>>>>> Is it also a separate machine (ie: not the machine you are working on)?
>>>>>
>>>>> On Sun, Feb 14, 2016 at 11:42 AM, Alan Kash <[email protected]> wrote:
>>>>>
>>>>>> These are two different physical machines.
>>>>>>
>>>>>> 192.168.20.109 - Machine 1
>>>>>> 192.168.20.100 - Machine 2
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Sun, Feb 14, 2016 at 11:20 AM, Luke Shannon <[email protected]>
>>>>>> wrote:
>>>>>>
>>>>>>> I think this is happening because you are running and connecting on
>>>>>>> the same machine, if the locator was on a different machine you would 
>>>>>>> use
>>>>>>> that IP. Try connecting to your locator using 127.0.0.1 or updated your
>>>>>>> host file so 192.168.20.109 points to localhost.
>>>>>>>
>>>>>>> On Sun, Feb 14, 2016 at 11:02 AM, Alan Kash <[email protected]>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> I am creating a small 2 node distributed prototype, I am getting
>>>>>>>> locator "Connection Refused" error.
>>>>>>>>
>>>>>>>> Source - Build from develop branch - M2.SNAPSHOT
>>>>>>>>
>>>>>>>> Here is the setup :
>>>>>>>>
>>>>>>>> 1. 192.168.20.109
>>>>>>>> 2. 192.168.20.100
>>>>>>>>
>>>>>>>> # NODE 1 - Start Locator & Server on - 192.168.20.109
>>>>>>>>
>>>>>>>> gfsh>start locator --name=l1
>>>>>>>> gfsh>start server --name=l1s1
>>>>>>>>
>>>>>>>> gfsh>list members;
>>>>>>>> Name | Id
>>>>>>>> ---- | -------------------------------------------
>>>>>>>> l1   | 192.168.20.109(l1:948:locator)<ec><v0>:1024
>>>>>>>> l1s1 | 192.168.20.109(l1s1:1076)<ec><v1>:1025
>>>>>>>>
>>>>>>>>
>>>>>>>> # NODE 2 - Connect to Locator - 192.168.20.100
>>>>>>>>
>>>>>>>> gfsh>connect --locator=192.168.20.109[10334]
>>>>>>>> Connecting to Locator at [host=192.168.20.109, port=10334] ..
>>>>>>>> Connecting to Manager at [host=192.168.20.109, port=1099] ..
>>>>>>>> Connection refused to host: 127.0.0.1; nested exception is:
>>>>>>>>     java.net.ConnectException: Connection refused
>>>>>>>>
>>>>>>>> I went through the complete documentation there are no examples of
>>>>>>>> distributed setup/storage/queries.
>>>>>>>>
>>>>>>>> What am I missing here?
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Alan
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Luke Shannon | Field Engineering | Pivotal
>>>>>>>
>>>>>>> -------------------------------------------------------------------------
>>>>>>> Mobile:416-571-9495
>>>>>>> Join the Toronto Pivotal Usergroup:
>>>>>>> http://www.meetup.com/Toronto-Pivotal-User-Group/
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Luke Shannon | Field Engineering | Pivotal
>>>>>
>>>>> -------------------------------------------------------------------------
>>>>> Mobile:416-571-9495
>>>>> Join the Toronto Pivotal Usergroup:
>>>>> http://www.meetup.com/Toronto-Pivotal-User-Group/
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Luke Shannon | Field Engineering | Pivotal
>>>>
>>>> -------------------------------------------------------------------------
>>>> Mobile:416-571-9495
>>>> Join the Toronto Pivotal Usergroup:
>>>> http://www.meetup.com/Toronto-Pivotal-User-Group/
>>>>
>>>
>>>
>>
>>
>> --
>> Luke Shannon | Field Engineering | Pivotal
>> -------------------------------------------------------------------------
>> Mobile:416-571-9495
>> Join the Toronto Pivotal Usergroup:
>> http://www.meetup.com/Toronto-Pivotal-User-Group/
>>
>
>
>
> --
> -John
> 503-504-8657
> john.blum10101 (skype)
>

Reply via email to