yugabyte 集成JanusGraph测试

yugabyte 集成图数据库JanusGraph,原理比较简单就是yugabyte 内置Cassandra,配置好JanusGraph
的访问就可以了。

使用docker 模式部署

创建yugabyte 集群(docker cli )

  • 下载部署工具
mkdir ~/yugabyte && cd ~/yugabyte
wget https://downloads.yugabyte.com/yb-docker-ctl && chmod +x yb-docker-ctl
  • 创建简单集群
./yb-docker-ctl create
  • 效果

配置janusGraph

  • 下载janusGraph
wget https://github.com/JanusGraph/janusgraph/releases/download/v0.2.0/janusgraph-0.2.0-hadoop2.zip
unzip janusgraph-0.2.0-hadoop2.zip
cd janusgraph-0.2.0-hadoop2
  • 配置
./bin/gremlin.sh
graph = JanusGraphFactory.open('conf/janusgraph-cql.properties')
  • 效果
  • 加载数据测试
加载测试数据
GraphOfTheGodsFactory.loadWithoutMixedIndex(graph,true)
g = graph.traversal()
简单查询
g.V(saturn).in('father').in('father').values('name')
  • 效果

说明

使用yugabyte 内置的Cassandra 进行应用开发还是比较方便的,同时我们不用太多关注Cassandra的部署安装,yugabyte部署起来比较方便

参考资料

https://docs.yugabyte.com/latest/develop/ecosystem-integrations/janusgraph/
https://docs.yugabyte.com/latest/quick-start/install/#docker

posted on 2018-10-15 15:12  荣锋亮  阅读(791)  评论(0编辑  收藏  举报

导航