gremlin> graph = TinkerGraph.open();
==>tinkergraph[vertices:0 edges:0]
gremlin> marko = graph.addVertex(T.label, "person", T.id, 1, "name", "marko", "age", 29);
==>v[1]
gremlin> g = TinkerFactory.createModern().traversal(standard())
==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard]
gremlin> g.V()
==>v[1]
==>v[2]
==>v[3]
==>v[4]
==>v[5]
==>v[6]
gremlin> g.V().values('name')
==>marko
==>vadas
==>lop
==>josh
==>ripple
==>peter
gremlin> g.V().has('name','marko').out('knows').values('name')
==>vadas
==>josh
$ bin/gremlin-server.sh /home/appsec/gremlin-server-3.0.0.M6/conf/remote-gremlin-server.yaml
[INFO] GremlinServer -
\,,,/
(o o)
-----oOOo-(3)-oOOo-----
[INFO] GremlinServer - Configuring Gremlin Server from /home/appsec/gremlin-server-3.0.0.M6/conf/remote-gremlin-server.yaml
[INFO] MetricManager - Configured Metrics ConsoleReporter configured with report interval=180000ms
[INFO] MetricManager - Configured Metrics CsvReporter configured with report interval=180000ms to fileName=/tmp/gremlin-server-metrics.csv
[INFO] MetricManager - Configured Metrics JmxReporter configured with domain= and agentId=
[INFO] MetricManager - Configured Metrics Slf4jReporter configured with interval=180000ms and loggerName=com.tinkerpop.gremlin.server.Settings$Slf4jReporterMetrics
[WARN] Graphs - Graph [g] configured at [conf/remote-titan-cassandra.properties] could not be instantiated and will not be available in Gremlin Server. GraphFactory message: GraphFactory could not instantiate this Graph implementation [com.thinkaurelius.titan.core.TitanFactory]
java.lang.RuntimeException: GraphFactory could not instantiate this Graph implementation [com.thinkaurelius.titan.core.TitanFactory]
:
:
[ERROR] GremlinServer - Gremlin Server Error
java.net.BindException: Cannot assign requested address
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:433)
at sun.nio.ch.Net.bind(Net.java:425)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:125)
at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:475)
at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1021)
at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:455)
at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:440)
at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:844)
at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:194)
at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:340)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:380)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
at java.lang.Thread.run(Thread.java:745)
[INFO] GremlinServer - Shutting down thread pools
[INFO] GremlinServer - Gremlin Server - shutdown complete
2. Directly using the gremlin shell to connect to a remote Cassandra server (This command basically hangs) :
gremlin> :remote connect tinkerpop.server /home/appsec/titan-1.0.0-hadoop1/conf/remote-cassandra-settings.yaml
# Get Apache TinkerPop's Gremlin Server (Titan 1.0.0 uses TinkerPop 3.0.1)
unzip apache-gremlin-server-3.0.1-incubating-bin.zip
cd apache-gremlin-server-3.0.1-incubating
# This will install Titan-Cassandra as a plugin under ext/titan-cassandra
./bin/gremlin-server.sh -i com.thinkaurelius.titan titan-cassandra 1.0.0
# Copy over some Titan configuration files
# https://gist.github.com/pluradj/8437255e831d2b640b6fea4f815a79c5
# * conf/titan-server.yaml
# * conf/titan-cassandra.properties
# start the server with Titan configuration
./bin/gremlin-server.sh conf/titan-server.yaml