0

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

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

  1. 运行 atlas server + hbase + solr - 插入虚拟实体
  2. 使用正确的配置运行 gremlin 服务器
    • 我已经设置graph: { ConfigurationManagementGraph: ..}janusgraph-hbase-solr.properties
  3. 运行 gremlin cli,连接:remote connect tinkerpop.server conf/remote.yaml sessiongremlin 服务器就好了。
  4. 我做graph = JanusGraphFactory.open(..../janusgraph-hbase-solr.properties)和创造g = graph.traversal()

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

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

谢谢

4

3 回答 3

3

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

您可以从 Atlas maven repo或本地构建中获取 jars。

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

JAR 列表

  • atlas-common-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
  • atlas-intg-1.1.0.jar
  • atlas-repository-1.1.0.jar

示例查询可能是:

gremlin> :> g.V().has('__typeName','hive_table').count()
==>10
于 2019-10-25T08:15:13.823 回答
2

正如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
于 2020-08-20T09:23:26.313 回答
0

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

在将 atlas jar 移动到 JanusGraph lib 文件夹后,我得到了解决,正如anand所说,然后配置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

于 2020-07-03T13:53:49.820 回答