Hello everyone!
But when I use the "gremlin-driver" to connect to it, reported the following error, who knows why? Thank you!
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.heetian.TestTinkerpop.App.main(App.java:25)
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
I use titan server is titan-1.0.0-hadoop2 comes, java code is as follows:
Cluster cluster = Cluster.open (App.class.getClassLoader () getResource ("") getPath () +. "Com / abc / TestTinkerpop / remote.yaml".);
Client client = cluster.connect ();
ResultSet results = client.submit ("graph.addVertex ('name', 'stephen')");
<dependency>
<groupId> org.apache.tinkerpop </ groupId>
<artifactId> gremlin-driver </ artifactId>
<version> 3.1.0-incubating </ version>
</ dependency>
hosts: [192.168.31.249]
port: 8182
serializer: { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}