Titan Graph DataBase 研究 (二)----Titan Server 发布

来源:互联网 发布:呼叫器软件设置 编辑:程序博客网 时间:2024/05/19 20:47

from:http://blog.csdn.net/q2365921/article/details/54744446


上一篇讲到如何搭建titan,那么今天就来说说如何进行Titan Server的发布,以及如何插入数据 
由于上篇讲的是如何搭建基于hbase-solr的titan graph database,那么直接复用上篇的配置文件。 
/conf/titan-hbase-solr.properties 
那么下面就说一下发布titan Server的几个步骤 
官方文档说明远程连接TitanServer需要启动一个TitanServer,在Titan内部实现,Titan使用Gremlin Server中的TinkerPop Stack 请求客户端服务,因此,配置Titan Server是通过一个Gremlin Server配置文件来进行配置的。 
1.首先将/conf/titan-hbase-solr.properties文件复制 $TITAN_HOME/conf/gremlin-server中并且在配置文件中添加如下配置

gremlin.graph=com.thinkaurelius.titan.core.TitanFactory
  • 1

并且删除

scriptEngines: {  gremlin-groovy: {    imports: [java.lang.Math],    staticImports: [java.lang.Math.PI],    scripts: [scripts/empty-sample.groovy]},  nashorn: {      imports: [java.lang.Math],      staticImports: [java.lang.Math.PI]}}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

2.修改$TITAN_HOME/conf/gremlin-server/gremlin-server.yaml文件,修改graphs配置如下

graphs: {  graph: conf/gremlin-server/titan-hbase-solr.properties}plugins:  - aurelius.titan ...
  • 1
  • 2
  • 3
  • 4
  • 5

3.启动TitanServer

nohup sh $TITAN_HOME/bin/gremlin-server.sh &
  • 1

4.验证TitanServer

#进入Gremlin console./$TITAN_HOME/bin/gremlin.sh#连接Gremlin Servergremlin> :remote  connect tinkerpop.server ../conf/remote.yamllog4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.==>Connected - localhost/127.0.0.1:8182gremlin> :> g.V().values('name')==>neptune==>jupiter==>hercules==>hydra==>sky==>nemean==>cerberus==>sea==>alcmene==>saturn==>pluto==>tartarus
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19

这样就证明TitanServer已经正确发布,ok下一篇研究一下java APi 操作

如果想要详细的了解Gremlin Server的,可以参考一下下面的文档, 搜索Gremlin Server

http://tinkerpop.apache.org/docs/3.0.1-incubating/#gremlin-server