Neo4j协议错误:服务器已关闭连接

时间:2017-01-12 07:56:46

标签: python linux neo4j

我是neo4j世界的新手。我已成功在我的macbook上使用它。现在我将它部署在具有相同设置的远程Linux机器上。但我不断收到此协议错误。是什么导致了这个问题如何解决这个问题?几天来,我一直在纠结这个错误。

Traceback (most recent call last):
  File "/root/dev/knowledgeGraphH/knowledge/media_entity_mapper.py", line 31, in <module>
    main()
  File "/root/dev/knowledgeGraphH/knowledge/media_entity_mapper.py", line 28, in main
    map_media_to_entities()
  File "/root/dev/knowledgeGraphH/knowledge/media_entity_mapper.py", line 7, in map_media_to_entities
    data_manager = DataManager()
  File "/root/dev/knowledgeGraphH/knowledge/data_manager/data_manager.py", line 13, in __init__
    self.graphDB = Neo4jManager()
  File "/root/dev/knowledgeGraphH/knowledge/neo4j_manager.py", line 10, in __init__
    self.session = self.driver.session()
  File "/root/dev/knowledgeGraphH/env/lib/python2.7/site-packages/neo4j/v1/session.py", line 148, in session
    session = Session(self)
  File "/root/dev/knowledgeGraphH/env/lib/python2.7/site-packages/neo4j/v1/session.py", line 461, in __init__
    self.connection = connect(driver.host, driver.port, driver.ssl_context, **driver.config)
  File "/root/dev/knowledgeGraphH/env/lib/python2.7/site-packages/neo4j/v1/connection.py", line 465, in connect
    return Connection(s, der_encoded_server_certificate=der_encoded_server_certificate, **config)
  File "/root/dev/knowledgeGraphH/env/lib/python2.7/site-packages/neo4j/v1/connection.py", line 237, in __init__
    self.fetch()
  File "/root/dev/knowledgeGraphH/env/lib/python2.7/site-packages/neo4j/v1/connection.py", line 326, in fetch
    self.acknowledge_failure()
  File "/root/dev/knowledgeGraphH/env/lib/python2.7/site-packages/neo4j/v1/connection.py", line 273, in acknowledge_failure
    fetch()
  File "/root/dev/knowledgeGraphH/env/lib/python2.7/site-packages/neo4j/v1/connection.py", line 311, in fetch
    raw.writelines(self.channel.chunk_reader())
  File "/root/dev/knowledgeGraphH/env/lib/python2.7/site-packages/neo4j/v1/connection.py", line 169, in chunk_reader
    chunk_header = self._recv(2)
  File "/root/dev/knowledgeGraphH/env/lib/python2.7/site-packages/neo4j/v1/connection.py", line 152, in _recv
    raise ProtocolError("Server closed connection")
neo4j.v1.exceptions.ProtocolError: Server closed connection

2 个答案:

答案 0 :(得分:0)

似乎是港口问题。螺栓端口是否打开?您是否可以访问该端口?

检查以下命令的输出:

lsof -i tcp:7687
如果您更改了螺栓端口地址,请

更改端口号。

答案 1 :(得分:0)

事实证明这是因为我使用了错误的凭据来进行此连接。