Skip to content

Commit 971b155

Browse files
authored
Merge pull request #233259 from seesharprun/cosmos-emulator-gremlin
Cosmos DB | Update gremlin emulator instructions
2 parents e43ee6f + a217e0f commit 971b155

File tree

1 file changed

+50
-26
lines changed

1 file changed

+50
-26
lines changed

articles/cosmos-db/local-emulator.md

Lines changed: 50 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -282,41 +282,65 @@ Start emulator from an administrator [command prompt](emulator-command-line-para
282282

283283
### API for Gremlin
284284

285-
Start emulator from an administrator [command prompt](emulator-command-line-parameters.md)with "/EnableGremlinEndpoint". Alternatively you can also set the environment variable `AZURE_COSMOS_EMULATOR_GREMLIN_ENDPOINT=true`
285+
Start the emulator from an administrator [command prompt](emulator-command-line-parameters.md) with `/EnableGremlinEndpoint`. Alternatively you can also set the environment variable `AZURE_COSMOS_EMULATOR_GREMLIN_ENDPOINT=true`
286286

287-
1. [Install apache-tinkerpop-gremlin-console-3.6.0](https://archive.apache.org/dist/tinkerpop/3.6.0).
287+
1. Tinkerpop console **3.6.2** is compatible with Java 8 or Java 11. For more information, see [OpenJDK 11](/java/openjdk/download#openjdk-11).
288+
289+
1. Extract [apache-tinkerpop-gremlin-console-3.6.2](https://tinkerpop.apache.org/download.html) to a folder on your machine.
290+
291+
> [!NOTE]
292+
> For the remainder of these steps, we will assume that you installed the console to the `%ProgramFiles%\gremlin` folder.
288293
289294
1. From the emulator's data explorer create a database "db1" and a collection "coll1"; for the partition key, choose "/name"
290295

291296
1. Run the following commands in a regular command prompt window:
292297

293-
```bash
294-
cd /d C:\sdk\apache-tinkerpop-gremlin-console-3.6.0-bin\apache-tinkerpop-gremlin-console-3.6.0
295-
296-
copy /y conf\remote.yaml conf\remote-localcompute.yaml
297-
notepad.exe conf\remote-localcompute.yaml
298-
hosts: [localhost]
299-
port: 8901
300-
username: /dbs/db1/colls/coll1
301-
password: C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==
302-
connectionPool: {
303-
enableSsl: false}
304-
serializer: { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0,
305-
config: { serializeResultToString: true }}
306-
307-
bin\gremlin.bat
308-
```
298+
```cmd
299+
cd /d %ProgramFiles%\apache-tinkerpop-gremlin-console-3.6.0
300+
```
301+
302+
```cmd
303+
copy /y conf\remote.yaml conf\remote-localcompute.yaml
304+
```
305+
306+
1. Open the `conf\remote-localcompute.yaml` file in Notepad.
307+
308+
```cmd
309+
notepad.exe conf\remote-localcompute.yaml
310+
```
311+
312+
1. Replace the contents of the YAML file with this configuration and **Save** the file.
313+
314+
```yaml
315+
hosts: [localhost]
316+
port: 8901
317+
username: /dbs/db1/colls/coll1
318+
password: C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==
319+
connectionPool: { enableSsl: false }
320+
serializer: { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0, config: { serializeResultToString: true }}
321+
```
322+
323+
1. Run the gremlin console.
324+
325+
```cmd
326+
bin\gremlin.bat
327+
```
309328
310329
1. In the Gremlin shell, run the following commands to connect to the Gremlin endpoint:
311330
312-
```bash
313-
:remote connect tinkerpop.server conf/remote-localcompute.yaml
314-
:remote console
315-
:> g.V()
316-
:> g.addV('person1').property(id, '1').property('name', 'somename1')
317-
:> g.addV('person2').property(id, '2').property('name', 'somename2')
318-
:> g.V()
319-
```
331+
```gremlin
332+
:remote connect tinkerpop.server conf/remote-localcompute.yaml
333+
:remote console
334+
```
335+
336+
1. Run the following commands to try various operations on the Gremlin endpont:
337+
338+
```gremlin
339+
g.V()
340+
g.addV('person1').property(id, '1').property('name', 'somename1')
341+
g.addV('person2').property(id, '2').property('name', 'somename2')
342+
g.V()
343+
```
320344
321345
## <a id="uninstall"></a>Uninstall the local emulator
322346

0 commit comments

Comments
 (0)