JanusGraph入门实操
本篇博客主要记录在centos上安装janusgraph以及在idea中开发图应用的简单示例过程,对于janusgraph和gremlin相关的概念和语法不做介绍。具体可自行查阅相关资料:
- janusgraph官网
- gremlin语法
- janusgraph github地址
- gremlin-graph-guide
- TinkerPop Documentation
- gremlin入门教程(建议先看)
- tinkerPop进阶(建议后看)
前置条件
- 安装jdk1.8
安装hbase

上图表格中是与janusgraph适配的其他组件。这里使用的是hbase2.1.10版本。下载后直接解压运行即可(只为了快速入门janusgraph,这里不需要对hbase做多余的配置):
[root@asn417-01 soft]# cd hbase-2.1.10/
[root@asn417-01 hbase-2.1.10]# ll
总用量 880
drwxr-xr-x. 4 10003 10003 4096 7月 26 03:17 bin
-rw-r--r--. 1 10003 10003 169269 3月 31 2020 CHANGES.md
drwxr-xr-x. 2 10003 10003 208 3月 31 2020 conf
drwxr-xr-x. 11 10003 10003 4096 3月 31 2020 docs
drwxr-xr-x. 7 10003 10003 80 3月 31 2020 hbase-webapps
-rw-r--r--. 1 10003 10003 262 3月 31 2020 LEGAL
drwxr-xr-x. 6 root root 8192 7月 26 03:14 lib
-rw-r--r--. 1 10003 10003 129382 3月 31 2020 LICENSE.txt
drwxr-xr-x. 2 root root 151 7月 26 03:43 logs
-rw-r--r--. 1 10003 10003 479625 3月 31 2020 NOTICE.txt
-rw-r--r--. 1 10003 10003 1477 3月 31 2020 README.txt
-rw-r--r--. 1 10003 10003 84456 3月 31 2020 RELEASENOTES.md
[root@asn417-01 hbase-2.1.10]# ./bin/start-hbase.sh
查看hbase web UI
http://xxx:16010/

安装janusgraph
https://github.com/JanusGraph/janusgraph/releases
打开上面的地址选择具体的版本下载janusgraph,这里以janusgraph-full-0.5.3.zip为例。(完整版和非完整版好像没有太大的区别,只是完整版的bin目录下多了一个janusgraph.sh脚本,它自带了Cassandra存储后端和elasticsearch索引后端,且初始化的图比gremlin-server.sh的图复杂一些)
下载解压后目录结构如下:

启动janusgraph服务
配置conf/janusgraph-hbase-test01.properties
复制一份janusgraph-hbase.properties到janusgraph-hbase-test01.properties。然后不用做修改,里面默认的hbase就是本地启动的。
修改gremlin-server.yaml配置
修改conf/gremlin-server/gremlin-server.yaml里的graph,配置为步骤1的路径:

启动janusgraph服务
janusgraph服务其实就是gremlin服务,bin/gremlin-server.sh这个脚本默认就是以gremlin-server.yaml为配置,以org.apache.tinkerpop.gremlin.server.GremlinServer为启动类启动的janusgraph服务。

本文详细介绍在CentOS上安装JanusGraph及使用IDEA进行图应用开发的过程。包括HBase安装配置、JanusGraph服务启动、配置文件修改等内容,并通过控制台及IDEA应用交互验证服务正常运行。
最低0.47元/天 解锁文章
3831

被折叠的 条评论
为什么被折叠?



