Skip to content

Commit 7f98b22

Browse files
committed
doc: gremlin server (DE-1061)
1 parent bda0073 commit 7f98b22

File tree

1 file changed

+69
-1
lines changed

1 file changed

+69
-1
lines changed

README.md

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,75 @@ gremlin> g.V().hasLabel("person").values("name")
8787

8888
### Server Plugin
8989

90-
TODO (DE-1061)
90+
To use the provider as Gremlin Server plugin, first you need to install it:
91+
92+
```text
93+
./bin/gremlin-server.sh install com.arangodb arangodb-tinkerpop-provider 3.0.0
94+
```
95+
96+
Then, you need to create the graph configuration, e.g. in the file
97+
`conf/arangodb.yaml`:
98+
99+
```yaml
100+
gremlin:
101+
graph: "com.arangodb.tinkerpop.gremlin.structure.ArangoDBGraph"
102+
arangodb:
103+
conf:
104+
graph:
105+
enableDataDefinition: true
106+
driver:
107+
hosts:
108+
- "172.28.0.1:8529"
109+
password: test
110+
```
111+
112+
and then configure the server to load the plugin and the graph configuration, e.g. in the file
113+
`conf/gremlin-server-arangodb.yaml`:
114+
115+
```yaml
116+
host: 0.0.0.0
117+
port: 8182
118+
graphs: {
119+
graph: conf/arangodb.yaml}
120+
scriptEngines: {
121+
gremlin-groovy: {
122+
plugins: { org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {},
123+
org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin: {},
124+
com.arangodb.tinkerpop.gremlin.jsr223.ArangoDBGremlinPlugin: {},
125+
org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]},
126+
org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/empty-sample.groovy]}}}}
127+
serializers:
128+
- { className: org.apache.tinkerpop.gremlin.util.ser.GraphSONMessageSerializerV3, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV3] }} # application/json
129+
- { className: org.apache.tinkerpop.gremlin.util.ser.GraphBinaryMessageSerializerV1 } # application/vnd.graphbinary-v1.0
130+
- { className: org.apache.tinkerpop.gremlin.util.ser.GraphBinaryMessageSerializerV1, config: { serializeResultToString: true }} # application/vnd.graphbinary-v1.0-stringd
131+
processors:
132+
- { className: org.apache.tinkerpop.gremlin.server.op.session.SessionOpProcessor, config: { sessionTimeout: 28800000 }}
133+
- { className: org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor}
134+
```
135+
136+
and finally start the server:
137+
138+
```shell
139+
./bin/gremlin-server.sh conf/gremlin-server-arangodb.yaml
140+
```
141+
142+
You can now connect to the server using the Gremlin Console:
143+
144+
```shell
145+
gremlin> :remote connect tinkerpop.server conf/remote.yaml
146+
147+
gremlin> :remote console
148+
==>All scripts will now be sent to Gremlin Server - [localhost/127.0.0.1:8182] - type ':remote console' to return to local mode
149+
150+
gremlin> g.addV("person").property("name", "marko")
151+
==>v[4587713]
152+
153+
gremlin> g.V().hasLabel("person").values("name")
154+
==>marko
155+
```
156+
157+
You can find the reference documentation [here](https://tinkerpop.apache.org/docs/3.7.3/reference/#_configuring_2).
158+
91159

92160
## Quick Start
93161

0 commit comments

Comments
 (0)