使用 gremlin CLI 连接到 apache atlas + hbase + solr 设置



我是atlas和janusgraph的新手,我有一个本地设置的atlas,hbase和solr作为虚拟数据的后端。 我想使用 gremlin cli + gremlin 服务器并连接到 hbase 中的现有数据。即:查看和遍历虚拟 Atlas 元数据对象。

这是我到目前为止所做的:

  1. 运行图集服务器 + hbase + solr - 插入的虚拟实体
  2. 使用正确的配置运行 gremlin 服务器
    • 我已将graph: { ConfigurationManagementGraph: ..}设置为janusgraph-hbase-solr.properties
  3. 运行 gremlin cli,连接:remote connect tinkerpop.server conf/remote.yaml session它可以很好地连接 gremlin 服务器。
  4. 我做graph = JanusGraphFactory.open(..../janusgraph-hbase-solr.properties)并创造g = graph.traversal()

我能够创建自己的顶点和边并列出它们,但无法列出与图集相关的任何内容,即:实体等。

我错过了什么? 我想连接到现有的地图集设置并使用 gremlin cli 遍历图形。

谢谢

为了能够从 gremlin cli 访问 Atlas 工件,您必须将 Atlas 依赖项 jar 添加到 Janusgraph 的 lib 目录中。

您可以从 Atlas maven 存储库或本地构建中获取 jar。

$ cp atlas-*  janusgraph-0.3.1-hadoop2/lib/ 

罐子列表

  • 地图集通用-1.1.0.jar
  • atlas-graphdb-api-1.1.0.jar
  • atlas-graphdb-common-1.1.0.jar
  • Atlas-graphdb-janus-1.1.0.jar
  • 阿特拉斯-intg-1.1.0.jar
  • 地图集存储库-1.1.0.jar

示例查询可以是:

gremlin> :> g.V().has('__typeName','hive_table').count()
==>10

正如 ThiagoAlvez 所提到的,可以使用 Atlas docker 镜像,因为 Tinknerpop Gremlin 支持现在内置在其中,可以很容易地用于玩 Janusgraph,以及使用 gremlin CLI 的 Atlas 工件:

  1. 拉取映像:
docker pull sburn/apache-atlas
  1. 在公开 Web-UI 端口 21000 的容器中启动 Apache Atlas:
docker run -d 
-p 21000:21000 
--name atlas 
sburn/apache-atlas 
/opt/apache-atlas-2.1.0/bin/atlas_start.py
  1. 通过运行包含的自动化脚本将 gremlin-server 和 gremlin-console 安装到容器中:
docker exec -ti atlas /opt/gremlin/install-gremlin.sh
  1. 在同一容器中启动 gremlin-server:
docker exec -d atlas /opt/gremlin/start-gremlin-server.sh
  1. 最后,以交互方式运行 gremlin-console:
docker exec -ti atlas /opt/gremlin/run-gremlin-console.sh

我在尝试连接到Apache Atlas JanusGraph数据库(org.janusgraph.diskstorage.solr.Solr6Index(时遇到了同样的问题。

按照 anand 所说将图集罐子移动到 JanusGraph lib 文件夹,然后配置janusgraph-hbase-solr.properties后,我解决了它。

这些是在janusgraph-hbase-solr.properties上设置的配置:

gremlin.graph=org.janusgraph.core.JanusGraphFactory
storage.backend=hbase
storage.hostname=localhost
cache.db-cache = true
cache.db-cache-clean-wait = 20
cache.db-cache-time = 180000
cache.db-cache-size = 0.5
index.search.backend=solr
index.search.solr.mode=http
index.search.solr.http-urls=http://localhost:9838/solr
index.search.solr.zookeeper-url=localhost:2181
index.search.solr.configset=_default
atlas.graph.storage.hbase.table=apache_atlas_janus
storage.hbase.table=apache_atlas_janus

我正在使用这个docker镜像运行Atlas:https://github.com/sburn/docker-apache-atlas

最新更新