我正试图通过Lambda函数(在Scala中(创建一个到Neptune集群的Gremlin连接,如下所示:
lazy val cluster =
Cluster
.build()
.addContactPoint("<my-neptune-endpoint>")
.port(NEPTUNE_ENDPOINT_PORT)
.keepAliveInterval(0)
.create()
lazy val neptuneConnection: GraphTraversalSource = traversal().withRemote(DriverRemoteConnection.using(cluster))
然而,即使是简单的查询也会失败。neptuneConnection.V().drop().toList()
抛出的异常为:
java.lang.IollegalStateException:org.apache.tinkerpop.gremlin.process.remote.RemoteConnectionException: java.lang.RuntimeException: java.lang.RuntimeException: java.util.concurrent.TimeoutException: Timed out while waiting for an available host - check the client configuration and connectivity to the server if this message persists
此外,我还尝试使用HTTPREST端点连接到Neptune,并执行了相同的查询,结果成功了。这似乎是格雷姆林关系的一个问题。
有人知道是什么原因造成的吗?
我的Gremlin连接初始化的问题是它缺少以下内容:
.enableSsl(true)
我需要启用SSL,因为Neptune只适用于https,Gremlin客户端默认为非SSL连接。
添加此项解决了我的问题。
我认为您不应该禁用keepAliveInterval。您应该让默认值。在这里解释