【问题标题】:Gremlin with Neptune : Timed out while waiting for an available hostGremlin with Neptune:等待可用主机时超时
【发布时间】:2020-07-21 06:50:10
【问题描述】:

我正在尝试从 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.IllegalStateException: 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

另外,我尝试使用 HTTP REST 端点连接到 Neptune,并执行了相同的查询并且它工作正常。似乎是 Gremlin 连接的问题。

有人知道是什么原因造成的吗?

【问题讨论】:

    标签: scala amazon-web-services gremlin amazon-neptune


    【解决方案1】:

    我的 Gremlin 连接初始化的问题是它缺少以下内容:

    .enableSsl(true)

    我需要启用 SSL,因为 Neptune 仅适用于 https,而 Gremlin 客户端默认为非 SSL 连接。

    添加这个解决了我的问题。

    【讨论】:

      【解决方案2】:

      我认为您不应该禁用 keepAliveInterval。你应该让默认值。说明here

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2013-12-31
        • 2019-04-30
        • 2021-10-15
        • 2016-11-25
        • 2020-09-17
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多