Gremlin客户端通过基于URL的负载均衡器连接到Gremlin JanusGraph服务器。

问题描述 投票:0回答:1

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

clients --> global load balancer (基于URL的)->第三方防火墙->内部负载平衡器->图形服务器。

全局负载均衡器所暴露的端点是这样的,如 https:/myhost.commypath1mypath2。

这种方法对于基于HTTP(S)的请求来说,工作得很好,因为当我发射一个 curl 命令到上述全局负载均衡器端点。

然而,我还有2种gremlin客户端的使用模式。

  1. 使用 gremlin.sh 慰问
  2. 使用 gremlin-python 客户端(或更一般地,WebSocket客户端)

因此,我的问题是。

  1. 我的问题是... remote.yaml 档案 gremlin.sh 客户端,我如何指定全局负载均衡器端点在 hostsport 的参数?

    • 我尝试了一些组合(如 hosts = ['myhost.com']['myhost.commypath1mypath2']。port = 8182443),但他们都不工作
  2. gremlin-python 客户端,我使用的是基于 WebSocket 的连接。我如何使用上述端点指定websocket连接字符串?

    • 我已经尝试了各种连接字符串(如 ws(s)://myhost.com/mypath1/mypath2/gremlin),但它们都不太有效。
google-cloud-platform gremlin janusgraph gremlinpython google-cloud-http-load-balancer
1个回答
1
投票

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

对于 hosts 你应该只提供主机名(没有路径),端口应该是443,假设那是你的负载均衡器上的端口。当然,你还需要启用SSL - 如 例子 请注意在打包的 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

© www.soinside.com 2019 - 2024. All rights reserved.