转载 https://groups.google.com/forum/#!msg/aureliusgraphs/v4UcYwE5UVU/samrajw6CgAJ
1. If you're starting from the titan-1.0.0-hadoop1.zip, I'd suggest making a copy of conf/gremlin-server/gremlin-
cp conf/gremlin-server/gremlin-se rver.yaml conf/rest-gremlin-server.yaml
cp conf/titan-cassandra.propertie s conf/gremlin-server/titan-cass andra-server.properties
2. If you're planning to connect to Gremlin Server from something other than localhost, you'll want to update the host with its IP address or 0.0.0.0 in rest-gremlin-server.yaml
host: 0.0.0.0
3. Configure the Gremlin Server for REST instead of WebSockets (refer to the Gremlin Server documentation). In the rest-gremlin-server.yaml, update the channelizer
channelizer: org.apache.tinkerpop.gremlin.s erver.channel.HttpChannelizer
4. Configure the Gremlin Server mapping with the Cassandra properties file with your graph configuration
graphs: {
graph: conf/gremlin-server/titan-cass andra-server.properties}
5. Update the titan-cassandra-server.
storage.hostname=127.0.0.1
storage.cassandra.keyspace=TIT AN_DEMO
6. Sending Gremlin to the Gremlin Server configured for REST is the same, regardless of the actual Gremlin query. Do a HTTP POST of a JSON object with a pair { "gremlin": "g.V().count()" } to the Gremlin Server. Here's what it looks like with a curl:
curl -XPOST -Hcontent-type:application/jso n -d '{"gremlin":"g.V().count()"}' http://localhost:8182
-- Jason