janusgraph 引入 java,janusgraph 默认server使用手记

启动server(with Cassandra/ES)

janusgraph-0.3.0-hadoop2 bin/janusgraph.sh start

Forking Cassandra...

Running `nodetool statusthrift`. OK (returned exit status 0 and printed string "running").

Forking Elasticsearch...

Connecting to Elasticsearch (127.0.0.1:9200)...... OK (connected to 127.0.0.1:9200).

Forking Gremlin-Server...

Connecting to Gremlin-Server (127.0.0.1:8182)...... OK (connected to 127.0.0.1:8182).

Run gremlin.sh to connect.

测试(用:remote用连接,用:>提交命令)

janusgraph-0.3.0-hadoop2 bin/gremlin.sh

\,,,/

(o o)

-----oOOo-(3)-oOOo-----

SLF4J: Class path contains multiple SLF4J bindings.

SLF4J: Found binding in [jar:file:/Users/didi/Softwares/bigdata/janusgraph-0.3.0-hadoop2/lib/slf4j-log4j12-1.7.12.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: Found binding in [jar:file:/Users/didi/Softwares/bigdata/janusgraph-0.3.0-hadoop2/lib/logback-classic-1.1.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]

plugin activated: janusgraph.imports

plugin activated: tinkerpop.server

plugin activated: tinkerpop.utilities

16:22:13 WARN org.apache.hadoop.util.NativeCodeLoader - Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

plugin activated: tinkerpop.hadoop

plugin activated: tinkerpop.spark

plugin activated: tinkerpop.tinkergraph

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

==>Configured localhost/127.0.0.1:8182

gremlin> :> graph.addVertex("name", "stephen")

==>v[4184]

gremlin> :> g.V().values('name')

==>stephen

session测试

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

==>Configured localhost/127.0.0.1:8182-[710a60e5-a2eb-4fb1-a59d-5025e0445e06]

gremlin> graph = EmptyGraph.instance()

==>emptygraph[empty]

gremlin> g = graph.traversal().withRemote("remote-graph.properties")

==>graphtraversalsource[emptygraph[empty], standard]

gremlin> herculesAge = g.V().has("name", "stephen").values("name").next()

==>stephen

gremlin> g.V().values('name')

==>stephen

==>stephen

关闭和清理

➜ janusgraph-0.3.0-hadoop2 bin/janusgraph.sh stop

Killing Gremlin-Server (pid 68363)...

Killing Elasticsearch (pid 68310)...

Cassandra (org.apache.cassandra.service.CassandraDaemon) not found in the java process table

➜ janusgraph-0.3.0-hadoop2 bin/janusgraph.sh clean

Are you sure you want to delete all stored data and logs? [y/N] y

Deleted data in /Users/didi/Softwares/bigdata/janusgraph-0.3.0-hadoop2/db

Deleted logs in /Users/didi/Softwares/bigdata/janusgraph-0.3.0-hadoop2/log

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值