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

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 Server
gremlin> :remote  connect tinkerpop.server ../conf/remote.yaml
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
==>Connected - localhost/127.0.0.1:8182
gremlin> :> 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


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值