Gremlin Server/Console 适配 Atlas JanusGraph
Atlas 底层存储使用的 JanusGraph,由于对于 Atlas 底层数据结构并不太清楚,所以希望能够通过 Gremlin Console 来操作 Atlas 的 JanusGraph,使用 Gremlin Query Language 执行一些更加灵活的查询,并直观的查询数据结构。适配的思路参考了 docker-apache-atlas 项目。
Gremlin Server
- 下载相同版本的 gremlin server ,解压,并添加 Atlas 相关的依赖包
 
1  | ATLAS_HOME=/home/anchor/apache-atlas-2.1.0/  | 
- gremlin server 配置
 
gremlin-server-atlas-wshttp.yaml 配置
1  | host: 0.0.0.0  | 
janusgraph-hbase-es.properties 配置
1  | gremlin.graph=org.janusgraph.core.JanusGraphFactory  | 
将 HBASE_CONF_DIR 加入 gramlin-server classpath 中(避免 kerberos 认证,连接失败等问题)
1  | # vim gremlin-server.sh  | 
- 启动 gramlin server
 
1  | nohup bin/gremlin-server.sh conf/gremlin-server-atlas-wshttp.yaml > gramlin-server.log 2>&1 &  | 
Gremlin Console
- 下载并解压 gremlin console ,启动
 
1  | bin/gremlin.sh  | 
- 连接 gremlin server
 
1  | :remote connect tinkerpop.server conf/remote.yaml session  | 
Gremlin Console 操作
查询一个 hive_table 节点
1  | // hive_table where qualifiedName = "aaa.test@test"  | 
查看 Graph 的一些信息
1  | mgmt = graph.openManagement()  | 
查询 Patch 节点信息
1  | g.V().has("patch.type", "TYPEDEF_PATCH")  | 
Graphexp 安装
Graphexp 是一个前端项目,结合 gremlin server 提供图数据的可视化。项目地址:https://github.com/bricaud/graphexp
拉取 github 代码,安装 Nginx 并进行如下配置。完成后访问:http://localhost:9990/graphexp.html
1  | # vim /etc/nginx/conf.d/graphexp-9990.conf  | 
其他问题
- Max frame length of 65536 has been exceeded.
 
1  | # io.netty.handler.codec.http.websocketx.CorruptedWebSocketFrameException: Max frame length of 65536 has been exceeded.  |