我使用的是pyorient 1.5.4和orientdb 2.2.5的docker
如果我使用浏览器连接到数据库,服务器显然正在运行。如果我连接pyorient,我会得到一个错误。
下面是我用来连接数据库的代码:
import pyorient
database = pyorient.OrientDB('127.0.0.1', 2424)
database.db_open(
'myDB',
'root',
'mypassword',
db_type='graph'
)我得到以下错误:
pyorient.exceptions.PyOrientConnectionException: Server seems to have went down我使用以下命令创建了docker容器:
docker run -d --name orientdb -p 2424:2424 -p 2480:2480 -v /home/myuser/Code/database:/orientdb/databases -e ORIENTDB_ROOT_PASSWORD=mypassword orientdb:latest /orientdb/bin/server.sh -Ddistributed=true服务器正在运行,因为通过浏览器连接工作正常。
看起来必要的端口已经打开了,那么为什么pyorient会认为数据库是关闭的呢?
发布于 2016-07-21 05:47:24
我找到我的问题了。我使用以下命令启动docker容器:
-Ddistributed=true删除参数使我能够很好地连接。
然而,我发现pyorient在尝试解析分布式模式下从orientDB返回的数据包时会陷入无限循环。这是由于pyorient上的一个bug。这里更详细地解释了这个bug:
https://github.com/mogui/pyorient/issues/215#issuecomment-245007336
https://stackoverflow.com/questions/38487197
复制相似问题