目标:我想建立一个图形数据库,并最终从内置于Node.js应用程序中的一组静态遍历访问数据]
中间目标1:作为一项学习练习,我最初将在本地计算机上的docker容器中使用gremlin-console,而不是使用Nodejs应用程序。 -我正在使用Docker容器tinkerpop/gremlin-console:latest
中间目标2:在我的组织中远程服务器上的VM上的docker容器中运行Janusgraph(Berkeleyje / Lucern / gremlin-server)(我不希望有任何多云的建议)-我使用docker容器janusgraph/janusgraph:latest
v3.4.4
修订后的中级目标2:由于我遇到的连接问题,请在本地计算机上的Docker容器中与运行中的Docker容器位于同一位置的Janusgraph(Berkeleyje / Lucern / gremlin-server)运行gremlin-控制台
步骤:
- 我用
docker pull janusgraph/janusgraph:latest
拉出了服务器泊坞窗图像> - 我使用
docker run -it -p 8182:8182 janusgraph/janusgraph:latest /bin/bash
(也使用imageID)运行图像 - 从正在运行的容器
/opt/janusgraph/bin/gremlin-server.sh
中的控制台中> 此返回:(已剪切)
3321 [main] WARN org.apache.tinkerpop.gremlin.server.AbstractChannelizer - The org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0 serialization class is deprecated.
3370 [main] INFO org.apache.tinkerpop.gremlin.server.AbstractChannelizer - Configured application/vnd.gremlin-v3.0+gryo with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0
3370 [main] WARN org.apache.tinkerpop.gremlin.server.AbstractChannelizer - The org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0 serialization class is deprecated.
3371 [main] INFO org.apache.tinkerpop.gremlin.server.AbstractChannelizer - Configured application/vnd.gremlin-v3.0+gryo-stringd with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0
3395 [main] INFO org.apache.tinkerpop.gremlin.server.AbstractChannelizer - Configured application/vnd.gremlin-v3.0+json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0
3395 [main] INFO org.apache.tinkerpop.gremlin.server.AbstractChannelizer - Configured application/json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0
3397 [main] WARN org.apache.tinkerpop.gremlin.server.AbstractChannelizer - The org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0 serialization class is deprecated.
3398 [main] INFO org.apache.tinkerpop.gremlin.server.AbstractChannelizer - Configured application/vnd.gremlin-v1.0+gryo with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0
3400 [main] WARN org.apache.tinkerpop.gremlin.server.AbstractChannelizer - The org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0 serialization class is deprecated.
3400 [main] INFO org.apache.tinkerpop.gremlin.server.AbstractChannelizer - Configured application/vnd.gremlin-v1.0+gryo-lite with org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0
3400 [main] WARN org.apache.tinkerpop.gremlin.server.AbstractChannelizer - The org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0 serialization class is deprecated.
3401 [main] INFO org.apache.tinkerpop.gremlin.server.AbstractChannelizer - Configured application/vnd.gremlin-v1.0+gryo-stringd with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0
3401 [main] WARN org.apache.tinkerpop.gremlin.server.AbstractChannelizer - The org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0 serialization class is deprecated.
3405 [main] INFO org.apache.tinkerpop.gremlin.server.AbstractChannelizer - Configured application/vnd.gremlin-v2.0+json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0
3405 [main] INFO org.apache.tinkerpop.gremlin.server.AbstractChannelizer - application/json already has org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0 configured - it will not be replaced by org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0, change order of serialization configuration if this is not desired.
3410 [main] INFO org.apache.tinkerpop.gremlin.server.AbstractChannelizer - Configured application/vnd.gremlin-v1.0+json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0
3411 [main] INFO org.apache.tinkerpop.gremlin.server.AbstractChannelizer - application/json already has org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0 configured - it will not be replaced by org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0, change order of serialization configuration if this is not desired.
3458 [gremlin-server-boss-1] INFO org.apache.tinkerpop.gremlin.server.GremlinServer - Gremlin Server configured with worker thread pool of 1, gremlin pool of 8 and boss thread pool of 1.
3458 [gremlin-server-boss-1] INFO org.apache.tinkerpop.gremlin.server.GremlinServer - Channel started at port 8182.
我希望序列化类警告不重要
- 我用
docker pull tinkerpop/gremlin-console:latest
拉出控制台泊坞窗图像> - 我使用
docker run -it -p 8182:8182 tinkerpop/gremlin-console:latest /bin/bash
(也使用imageID)运行图像 - (在非托管版本中,我将
/opt/gremlin-console/conf/remote.yaml
调整为将服务器主机名上的host
指向-可以从容器将其解析为IP) hosts: [localhost] # OR [ the remote hostname ] as per the two versions of goal 2
port: 8182
serializer: { className: org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1, config: { serializeResultToString: true }}
- 从正在运行的容器
/opt/janusgraph/bin/gremlin.sh
中的控制台中> - 从返回的gremlin控制台
remote connect tinkerpop.server conf/remote.yaml
中> gremlin> :remote connect tinkerpop.server conf/remote.yaml
==>Configured localhost/127.0.0.1:8182
- 从gremlin控制台
:remote console
(将所有后续命令切换到远程gremlin服务器)
问题好像控制台正在连接到服务器,但是当我运行时gremlin> :> graph = TinkerGraph.open(conf/gremlin-server/conf/gremlin-server/janusgraph-berkeleyje-server.properties)
它回应Host did not respond in a timely fashion - check the server status and submit again.
无论我尝试连接同位还是远程gremlin服务器,都相同。
现在该怎么办?在哪里看?为什么Gremlin如此困难!
元问题我不清楚(文档未解释):> TinkerGraph.open(server.properties)
是否期望指向控制台本地服务器.properties
文件的路径,还是期望相对于远程服务器的路径我希望文档能被视为理所当然,并且(必须仅是有限数量的架构模式*)得到了全面的解释,并且分别地所需的一切]
*
- 服务器和客户端位于一台机器上,共享资源/网络等。>>
- 服务器和客户端在计算机上进行了容器化,因此如何使它们交谈(通过容器隔离)
远程计算机上的服务器到客户端(有和没有容器化) 目标:我想建立一个图形数据库,并最终从内置于Node.js应用程序中的一组静态遍历访问数据。中间目标1:作为学习练习,而不是使用...
这是一个对我有用的快速版本:
docker run --name janusgraph-default \
-e janusgraph.storage.berkeleyje.cache-percentage=80 \
-e gremlinserver.threadPoolWorker=2 \
-e gremlinserver.channelizer=org.apache.tinkerpop.gremlin.server.channel.WsAndHttpChannelizer \
-p 8182:8182 \
janusgraph/janusgraph:latest
我在这里有一个自定义的通道生成器,如果您只需要websocket而不是Http,则可以避免。
在gremlin控制台中:
:remote connect tinkerpop.server conf/remote.yaml
:remote console
graph
==>standardjanusgraph[berkeleyje:/var/lib/janusgraph/data]
- 确保
remote.yaml
指向localhost:8182(来自docker run命令的端口)
第二行remote console
仅是为了避免每个命令使用:>
我相信服务器会在其相对路径中查找属性文件。码头工人版本将属性文件复制到/etc/opt/
,如下所述:https://github.com/JanusGraph/janusgraph-docker