由于安全策略的原因,我有一堆JanusGraph服务器(在内部Kubernetes网络中运行),外部Gremlin客户端可以通过以下网络路径访问这些服务器:
客户端->全局负载均衡器(URL-based)->第三方防火墙->内部负载均衡器->图形服务器
全局负载均衡器公开的端点类似于https://myhost.com/mypath1/mypath2/
这种方法对于基于HTTP(S)的请求很好用,因为当向上述全局负载均衡器端点触发curl
命令时,我可以从gremlin服务器接收响应。
但是,我还有另外2种gremlin客户端使用模式:
gremlin.sh
控制台gremlin-python
客户端(或更常见的是WebSocket客户端)因此,我的问题是:
在remote.yaml
客户端使用的gremlin.sh
文件中,如何在hosts
和port
参数中指定全局负载均衡器端点?
hosts
= ['myhost.com'] / ['myhost.com/mypath1/mypath2']、port
= 8182/443),但它们全部不工作在gremlin-python
客户端中,我正在使用基于WebSocket的连接。如何使用上述端点指定websocket连接字符串?
ws(s)://myhost.com/mypath1/mypath2/gremlin
),但它们也不起作用答案 0 :(得分:1)
在gremlin.sh客户端使用的remote.yaml文件中,如何在主机和端口参数中指定全局负载均衡器终结点?
对于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