【问题标题】:Gremlin Client Connecting to Gremlin / JanusGraph Server via URL-based Load BalancersGremlin 客户端通过基于 URL 的负载均衡器连接到 Gremlin / JanusGraph 服务器
【发布时间】:2020-05-30 04:23:23
【问题描述】:

由于安全政策,我有一个 JanusGraph 服务器集群(在内部 Kubernetes 网络中运行),外部 Gremlin 客户端可以通过以下网络路由访问:

客户端 --> 全局负载均衡器 (URL-based) --> 第三方防火墙 --> 内部负载均衡器 --> 图服务器

全局负载均衡器暴露的端点类似于例如https://myhost.com/mypath1/mypath2/

这种方法适用于基于 HTTP(S) 的请求,因为当向上述全局负载平衡器端点发送 curl 命令时,我能够从 gremlin 服务器接收响应。

但是,我还有 2 种其他 gremlin 客户端使用模式:

  1. 使用gremlin.sh 控制台
  2. 使用gremlin-python 客户端(或更一般地说,WebSocket 客户端)

因此我的问题是:

  1. gremlin.sh客户端使用的remote.yaml文件中,如何在hostsport参数中指定全局负载均衡器端点?

    • 我尝试了一些组合(例如hosts = ['myhost.com']/['myhost.com/mypath1/mypath2']、port = 8182/443)但它们都不起作用
  2. gremlin-python 客户端中,我使用的是基于 WebSocket 的连接。如何使用上述端点指定 websocket 连接字符串?

    • 我尝试了各种连接字符串(例如ws(s)://myhost.com/mypath1/mypath2/gremlin),但它们也不起作用

【问题讨论】:

    标签: google-cloud-platform gremlin janusgraph gremlinpython google-cloud-http-load-balancer


    【解决方案1】:

    在gremlin.sh客户端使用的remote.yaml文件中,如何在hosts和port参数中指定全局负载均衡端点?

    对于hosts,您应该只提供主机名(无路径),对于端口,它应该只是 443,假设这是您在负载平衡器上公开的端口。当然,您还需要启用 SSL - 作为an example,请注意打包的remote-secure.yaml 文件中提供的设置,并在https://tinkerpop.apache.org/docs/current/reference/#_configuration 中查看其他配置选项。

    至于您的自定义路径mypath1/mypath2/gremlin,目前无法配置。它期望该路径为/gremlin。我创建了TINKERPOP-2379 作为回应。

    在 gremlin-python 客户端中,我使用的是基于 WebSocket 的连接。如何使用上述端点指定 websocket 连接字符串?

    我希望这适用于 Python:wss://myhost.com:443/mypath1/mypath2/gremlin

    【讨论】:

    • 谢谢!对于 python WebSocket 连接字符串,我面临HTTPError: HTTP 599: Timeout during request 错误。但是我需要在内部检查负载均衡器是否支持 WebSocket 连接。
    猜你喜欢
    • 1970-01-01
    • 2013-04-26
    • 2015-04-06
    • 2018-07-09
    • 2019-03-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多