neomodel 因为数据库关闭不能访问报错

今天的第一单生意:出现错误,然后解决,就是我的生意。

Traceback (most recent call last):
  File "/home/py/PycharmProjects/ThirdTest/questionanswer/neo4joperate.py", line 157, in <module>
    get_question_id(query, params_json_string)
  File "/home/py/PycharmProjects/ThirdTest/questionanswer/neo4joperate.py", line 130, in get_question_id
    results, columns = db.cypher_query(query_string, params_json_string)
  File "/usr/local/lib/python2.7/dist-packages/neomodel/util.py", line 27, in wrapper
    self.set_connection(config.DATABASE_URL)
  File "/usr/local/lib/python2.7/dist-packages/neomodel/util.py", line 61, in set_connection
    max_pool_size=config.MAX_POOL_SIZE)
  File "/usr/local/lib/python2.7/dist-packages/neo4j/v1/api.py", line 112, in driver
    return driver_class(uri, **config)
  File "/usr/local/lib/python2.7/dist-packages/neo4j/v1/direct.py", line 63, in __init__
    pool.acquire()
  File "/usr/local/lib/python2.7/dist-packages/neo4j/v1/direct.py", line 44, in acquire
    raise ServiceUnavailable("Cannot acquire connection to {!r}".format(self.address))
neo4j.exceptions.ServiceUnavailable: Cannot acquire connection to Address(host='localhost', port=7687)

解决办法当然是开启数据库: 到neo4j的bin目录下./neo4j start

posted @ 2017-11-28 09:28  深渊中的鱼  阅读(489)  评论(0编辑  收藏  举报