markito / geode-docker

Apache Geode (incubating) Dockerfile
Apache License 2.0
23 stars 19 forks source link

Trouble connecting to server #4

Closed mangesh17 closed 6 years ago

mangesh17 commented 7 years ago

Hi,

I am having trouble connecting to server that is created inside container. Locator uses internal hostname to identify the server and client is not aware of this name. How would one resolve this and have you tried connecting from a client to a server created inside container?

I tried assigning host name to container using -h option to "docker run" command. But that doesn't seem to help either.

[fine 2017/05/24 14:52:07.079 PDT <RMI TCP Connection(2)-127.0.0.1> tid=0x11] SubscriptionManager - discovered subscription servers [9ade546c2288:40404]

[info 2017/05/24 14:52:07.080 PDT <poolTimer-gemfire-pool-2> tid=0x6b] AutoConnectionSource discovered new locators [9ade546c2288:10334]

[fine 2017/05/24 14:52:07.080 PDT <poolTimer-gemfire-pool-3> tid=0x6c] Error attempting to connect to 9ade546c2288:40404: 
java.net.UnknownHostException: 9ade546c2288
    at java.net.InetAddress.getAllByName0(InetAddress.java:1280)
    at java.net.InetAddress.getAllByName(InetAddress.java:1192)
    at java.net.InetAddress.getAllByName(InetAddress.java:1126)
    at java.net.InetAddress.getByName(InetAddress.java:1076)
    at com.gemstone.gemfire.cache.client.internal.ConnectionImpl.connect(ConnectionImpl.java:98)
    at com.gemstone.gemfire.cache.client.internal.ConnectionFactoryImpl.createClientToServerConnection(ConnectionFactoryImpl.java:112)
    at com.gemstone.gemfire.cache.client.internal.ConnectionFactoryImpl.createClientToServerConnection(ConnectionFactoryImpl.java:217)
    at com.gemstone.gemfire.cache.client.internal.pooling.ConnectionManagerImpl.prefillConnection(ConnectionManagerImpl.java:787)
    at com.gemstone.gemfire.cache.client.internal.pooling.ConnectionManagerImpl.prefill(ConnectionManagerImpl.java:730)
    at com.gemstone.gemfire.cache.client.internal.pooling.ConnectionManagerImpl$PrefillConnectionsTask.run2(ConnectionManagerImpl.java:884)
    at com.gemstone.gemfire.cache.client.internal.PoolImpl$PoolTask.run(PoolImpl.java:1189)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:748)

Thanks, Mangesh

markito commented 6 years ago

Sorry for the long delay on responding this one. Please take a look at https://geode.apache.org/docs/guide/13/reference/topics/gemfire_properties.html and read about jmx-manager-hostname-for-clients as well as https://geode.apache.org/docs/guide/13/tools_modules/gfsh/command-pages/start.html and read about --hostname-for-clients - They need to be set in order to enable external connections and you should use your docker public network IP value there. Hope that helps.