Just tried below mentioned code to check my Amazon Neptune service, it's throwing this error:
ClientConnectorError: Cannot connect to host <host>:8182 ssl:default [Connect call failed ('<ip-address>', 8182)]
from __future__ import print_function # Python 2/3 compatibility
from gremlin_python import statics
from gremlin_python.structure.graph import Graph
from gremlin_python.process.graph_traversal import __
from gremlin_python.process.strategies import *
from gremlin_python.driver.driver_remote_connection import DriverRemoteConnection
graph = Graph()
remoteConn = DriverRemoteConnection('wss://<host>','g')
g = graph.traversal().withRemote(remoteConn)
print(g.V().limit(2).toList())
remoteConn.close()
Does anybody know the solution? Thanks
<host>
is a placeholder that you need to replace with the name of the host that runs Gremlin Server. If your python client runs on the same host, you can replace<host>
bylocalhost
.Also note that you can only use url's starting with wss:// if secure socket layer is configured on Gremlin Server, otherwise use a url starting with ws://.