GitHub user okuc opened a pull request:

    https://github.com/apache/incubator-tinkerpop/pull/257

    When hosts configured incorrectly, causing problems not connect services

    Mainly to solve the following problem:
    
    I have two machines, machine name and ip as follows:
    
    ```
               ip                             hostname
    192.168.1.1                         host11
    192.168.1.2                         host12
    
    ```
    I start gremlin-server on 192.168.1.1, and then access on 192.168.1.2.
    
    But for some reason, the hosts file on the 192.168.1.2 is not configured 
correctly, as follows:
    
    `192.168.1.1   host33`
    
    So I'm on the 192.168.1.2, it will report an error when accessing the 
gremlin-server. My statement is as follows access
    
    ```
      Builder builder = Cluster.build ( "192.168.1.1");
      Cluster cluster = builder.create ();
      Client client = cluster.connect ();
      ResultSet results = client.submit ( "[1,2,3,4]");
      results.stream () forEach (System.out :: println).;
    ```
    
    It reported the following error:
    
    ```
    Exception in thread "main" java.lang.RuntimeException: 
java.lang.RuntimeException: java.util.concurrent.TimeoutException: Timed out 
waiting for an available host.
    at org.apache.tinkerpop.gremlin.driver.Client.submit (Client.java:146)
    at org.apache.tinkerpop.gremlin.driver.Client.submit (Client.java:130)
    at com.okuc.graph.hello.remote.main (remote.java:27)
    Caused by: java.lang.RuntimeException: 
java.util.concurrent.TimeoutException: Timed out waiting for an available host.
    at org.apache.tinkerpop.gremlin.driver.Client.submitAsync (Client.java:194)
    at org.apache.tinkerpop.gremlin.driver.Client.submitAsync (Client.java:174)
    at org.apache.tinkerpop.gremlin.driver.Client.submit (Client.java:144)
    ... 2 more
    Caused by: java.util.concurrent.TimeoutException: Timed out waiting for an 
available host.
    at org.apache.tinkerpop.gremlin.driver.Client $ 
ClusteredClient.chooseConnection (Client.java:342)
    at org.apache.tinkerpop.gremlin.driver.Client.submitAsync (Client.java:189)
    ... 4 more
    ```

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/okuc/incubator-tinkerpop master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-tinkerpop/pull/257.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #257
    
----
commit 4b875448d8094b241bff220c06b8e3f21d1d63ff
Author: okuc <[email protected]>
Date:   2016-03-11T09:20:05Z

    When hosts configured incorrectly, causing problems not connect services

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to