图数据库titan 和 rexster安装手册

图数据库titan 和 rexster安装手册


titan是图数据库, rexster是图显示服务 titan 安装 下载 titan 0.3.2 解压 titan-all-0.3.2.zip 到 /opt/hugedata/share/ 解压后得到 /opt/hugedata/share/titan-all-0.3.2/ 建立软连接 cd /opt/hugedata/share/ ln -s titan-all

titan是图数据库, rexster是图显示服务

titan 安装

下载 titan 0.3.2

解压 titan-all-0.3.2.zip 到 /opt/hugedata/share/
解压后得到 /opt/hugedata/share/titan-all-0.3.2/
建立软连接
cd /opt/hugedata/share/
ln -s titan-all-0.3.2 titan

/etc/profile 增加
export TITAN_HOME=/opt/hugedata/share/titan
source /etc/profile
----------------------
测试titan, 生成graph
cd $TITAN_HOME
bin/gremlin.sh

gremlin> g = GraphOfTheGodsFactory.create('/tmp/titan') 
==>titangraph[local:/tmp/titan]
gremlin> saturn = g.V('name','saturn').next()
==>v[4]
gremlin> saturn.map()
==>name=saturn
==>age=10000
==>type=titan
gremlin> saturn.in('father').in('father').name
==>hercules


chmod 777 /tmp/titan

更多资料请参照 https://github.com/thinkaurelius/titan/wiki

 

rexster 安装


下载 rexster 2.3.0

解压 rexster-server-2.3.0.zip 到 /opt/hugedata/share/
解压后得到 /opt/hugedata/share/rexster-server-2.3.0/
建立软连接
cd /opt/hugedata/share/
ln -s rexster-server-2.3.0 rexster
cd /opt/hugedata/share/rexster
mkdir logs
chmod 777 logs

打开 bin/rexster-service.sh
修改变量 REXSTER_DIR="/opt/hugedata/share/rexster-server-2.3.0"
修改变量 REXSTER_LOG_DIR="/opt/hugedata/share/rexster-server-2.3.0/logs"

ln -s /opt/hugedata/share/rexster/bin/rexster-service.sh /etc/init.d/rexster
chkconfig --add rexster

cd /opt/hugedata/share/rexster
修改 rexster.xml
修改配置 <rexster>/<http>/<server-host> 到安装机器 <host ip>

修改配置 <rexster>/<http>/<base-uri> 到安装机器 http://<host ip>

 

/etc/profile 增加
export REXSTER_HOME=/opt/hugedata/share/rexster

source /etc/profile

cd /opt/hugedata/share/rexster
mkdir ext/titan
cp $TITAN_HOME/lib/* $REXSTER_HOME/ext/titan

bin/rexster-service.sh start
检查 logs/service.err, logs/service.log

rexster测试页面, 测试例子图是否能显示

http://<rexster 服务启动机器ip>:8182

rexster 使用  titan /local 为backend

cd /opt/hugedata/share/rexster
bin/rexster-service.sh stop

修改rexster.xml增加 <rexster>/<graphs>/<graph> 部分

<graph>
<graph-name>titanexample</graph-name>
<graph-type>com.thinkaurelius.titan.tinkerpop.rexster.TitanGraphConfiguration</graph-type>
<graph-location>/tmp/titan</graph-location>
<graph-read-only>false</graph-read-only>
<properties>
<storage.backend>local</storage.backend>
<storage.buffer-size>100</storage.buffer-size>
</properties>
<extensions>
<allows>
<allow>tp:gremlin</allow>
</allows>
</extensions>
</graph>

 

bin/rexster-service.sh start

rexster测试页面: http://<rexster host ip>:8182

 

rexster 使用  titan /hbase 为backend


cd /opt/hugedata/share/rexster
bin/rexster-service.sh stop

导入数据到 hbase

修改 rexster.xml, 增加一下

<graph>
<graph-enabled>true</graph-enabled>
<graph-name>ipgraph</graph-name>
<graph-type>com.thinkaurelius.titan.tinkerpop.rexster.TitanGraphConfiguration</graph-type>
<graph-location></graph-location>
<graph-read-only>false</graph-read-only>
<properties>
<storage.backend>hbase</storage.backend>
<storage.hostname>hbase zookeeper quorum ip, 逗号分隔</storage.hostname>
<storage.tablename>表名</storage.tablename>
</properties>
<extensions>
<allows>
<allow>tp:gremlin</allow>
</allows>
</extensions>
</graph>

bin/rexster-service.sh start

rexster测试页面: http://<rexster host ip>:8182

 

更多资料,参照 https://github.com/thinkaurelius/titan/wiki/Rexster-Graph-Server

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值