Luís Martins
Luís Martins

Reputation: 11

How to connect local aws graph-explorer to local gremlin server?

To whom it may concern,

Exploring graph visualisation tools, I have stumbled upon some solutions such as neo4j's bloom and aws' graph-explorer (https://github.com/aws/graph-explorer). It is stated in the README file that, should one wish to connect to Neptune, it should be in the same VPC of the database instance. However, it is also stated it could run on a local environment. (https://apex974.com/articles/aws-graph-explorer-first-impression) seems to have achieved the local connection with a RDF graph database and I tried to achieve the same result with the gremlin server, to no avail. I wonder if it would be possible to to connect local aws graph-explorer to local gremlin server.

Firstly I downloaded the latest tikerpop gramlin server on https://tinkerpop.apache.org/download.html . And run it with the bin/gremlin-server.sh conf/gremlin-server-rest-modern.yaml code, in order to create a future HTTP connection with the graph explorer.

Then, I cloned the git repository of the graph-explorer and built and ran the docker image with the commands,

docker build --build-arg host=localhost -t graph-explorer .
docker run -p 5173:5173 -p 8182:8182 graph-explorer

However, I had changed the 8182 port of the container to 8183 as it was already being used by the gremlin server. On the already running graph-explorer container (localhost:5173), I have tried to connect to the gremlin server on https:\localhost:8182, but the connection is never established.

I would be most grateful if someone could help to connect local aws graph-explorer to local gremlin server or determine that such a feat is is unachievable.

Yours faithfully,

Luís Martins.

Upvotes: 1

Views: 617

Answers (1)

ttemple
ttemple

Reputation: 1995

I ran into this same exact issue and spent a lot of time trying to understand why this was happening. It turns out, the default Channelizer for the local Gremlin Server uses the WebSocket Channelizer causing the connection to never be completed.

Inside your server conf/gremlin-server.yaml file (or whichever server yaml file you are using), change the channelizer value from this value: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer

to this value instead: org.apache.tinkerpop.gremlin.server.channel.WsAndHttpChannelizer

That will allow Graph-Explorer to connect to Gremlin Server over HTTP.

The big clue for me was when I tried doing a plain a GET request outside of graph-explorer (e.g. using curl, or Postman or ThunderClient inside VS Code), it was not responding at all.

As soon as I did this, I could run locally using node or run the docker container from my local, go to http://localhost:3000/ if using npm run serve or to https://localhost/explorer if using docker, create a connection to http://127.0.0.1:8182, and it immediately connected to my local gremlin server.

Hope this helps!

Upvotes: 1

Related Questions