使用gremlin cli连接到apache atlas+hbase+solr安装程序

fcy6dtqo  于 2021-06-09  发布在  Hbase
关注(0)|答案(3)|浏览(839)

我对atlas和janusgraph是个新手,我有一个本地的atlas设置,用hbase和solr作为后端,使用虚拟数据。我想使用gremlincli+gremlin服务器并连接到hbase中的现有数据。ie:查看和遍历虚拟atlas元数据对象。
这就是我目前所做的:
运行atlas server+hbase+solr-插入的虚拟实体
使用正确的配置运行gremlin服务器
我已经定好了 graph: { ConfigurationManagementGraph: ..}janusgraph-hbase-solr.properties 运行gremlin cli,连接 :remote connect tinkerpop.server conf/remote.yaml session 连接gremlin服务器很好。
我愿意 graph = JanusGraphFactory.open(..../janusgraph-hbase-solr.properties) 创造 g = graph.traversal() 我可以创建自己的顶点和边,并列出它们,但不能列出任何与Map集有关的东西,如:实体等。
我错过了什么?我想连接到现有的atlas设置并用gremlincli遍历图形。
谢谢

oxf4rvwz

oxf4rvwz1#

我在尝试连接到apacheatlasjanusgraph数据库时遇到了同样的问题( org.janusgraph.diskstorage.solr.Solr6Index ).
我把atlas jars移到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

rggaifut

rggaifut2#

为了能够从gremlincli访问atlas工件,您必须将atlas依赖jar添加到janusgraph的lib目录中。
您可以从atlas maven repo或您的本地版本中获得jar。

$ 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
62lalag4

62lalag43#

正如thiagoalvez所提到的,atlas docker图像可以使用,因为tinknerpop gremlin支持现在已经内置在其中,可以很容易地使用janusgraph和atlas工件来使用gremlin cli:
拉取图像:

docker pull sburn/apache-atlas

在暴露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

通过运行包含的自动化脚本,将gremlin服务器和gremlin控制台安装到容器中:

docker exec -ti atlas /opt/gremlin/install-gremlin.sh

在同一容器中启动gremlin服务器:

docker exec -d atlas /opt/gremlin/start-gremlin-server.sh

最后,以交互方式运行gremlin控制台:

docker exec -ti atlas /opt/gremlin/run-gremlin-console.sh

相关问题