Search code examples
azure-cosmosdbgremlinazure-storage-emulator

How to set up gremlin console to work against local Azure CosmosDB Emulator?


I have some software running locally against Azure CosmosDB Emulator which works fine, but when i try to use the gremlin console (version 3.4.4) I just can't get it to work.

Based on the Microsoft documentation https://github.com/MicrosoftDocs/azure-docs/blob/master/articles/cosmos-db/create-graph-gremlin-console.md and my existing working app I set up my local yaml file

hosts: [localhost]
port: 8901
username: /dbs/GremlinNoteDB/colls/CrmCollection
password: C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==
connectionPool: { enableSsl: true }
serializer: { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV2d0, config: { serializeResultToString: true }}

And running the command...

gremlin> :remote connect tinkerpop.server conf/cosmos_local.yaml

...results in the following output which (to my untrained eye) looks ok.

gremlin> :remote connect tinkerpop.server conf/cosmos_local.yaml
==>Configured localhost/127.0.0.1:8901, localhost/0:0:0:0:0:0:0:1:8901

But when I then try to run a gremlin command like the following it fails. Have I missed something obvious? I have tried changing ssl and using other serializers but to no avail.

gremlin> :> g.V().count()
Host did not respond in a timely fashion - check the server status and submit again.
Type ':help' or ':h' for help.
Display stack trace? [yN]

Any and all help is welcome. I checked the other related posts here on stackoverflow, but they didn't solve my problem. So to summarize: The Azure CosmosDB Emulator works since I can connect with my .net application, but I can't get the gremlin console to work.


Solution

  • Seems like at the moment gremlin console (version 3.4.4) doesn't support connection to Azure CosmosDB Emulator (at least in the form it is shown here). Use gremlin console 3.3.4 instead.