我按照网址https://neo4j.com/developer/neo4j-doc-manager/提供的步骤连接mongoDb和neo4j。
但我得到一个错误:
线程Thread-1中的异常: 回溯(最近一次调用最后一次):File" /Users/gauravvashisth/anaconda/lib/python3.5/threading.py" ;,第914行, 在_bootstrap_inner中 self.run()File" /Users/gauravvashisth/anaconda/lib/python3.5/site-packages/mongo_connector/util.py", 第104行,包裹着 func(* args,** kwargs)File" /Users/gauravvashisth/anaconda/lib/python3.5/site-packages/mongo_connector/connector.py", 第382行,在奔跑中 self.update_version_from_client(self.main_conn)File" /Users/gauravvashisth/anaconda/lib/python3.5/site-packages/mongo_connector/connector.py", 第334行,在update_version_from_client中 is_master = client.admin.command(" isMaster")File" /Users/gauravvashisth/anaconda/lib/python3.5/site-packages/pymongo/database.py", 第491行,在命令中 client._socket_for_reads(read_preference)as(sock_info,slave_ok):File " /Users/gauravvashisth/anaconda/lib/python3.5/contextlib.py" ;,第59行, 在输入 return next(self.gen)File" /Users/gauravvashisth/anaconda/lib/python3.5/site-packages/pymongo/mongo_client.py", 第859行,在_socket_for_reads中 self._get_socket(read_preference)as sock_info:File" /Users/gauravvashisth/anaconda/lib/python3.5/contextlib.py" ;,第59行, 在输入 return next(self.gen)File" /Users/gauravvashisth/anaconda/lib/python3.5/site-packages/pymongo/mongo_client.py", 第823行,在_get_socket中 server = self._get_topology()。select_server(selector)File" /Users/gauravvashisth/anaconda/lib/python3.5/site-packages/pymongo/topology.py", 第214行,在select_server中 地址))文件" /Users/gauravvashisth/anaconda/lib/python3.5/site-packages/pymongo/topology.py", 第189行,在select_servers中 self._error_message(选择器))
pymongo.errors.ServerSelectionTimeoutError:没有副本集成员 匹配选择器"主要()"
答案 0 :(得分:0)
您应该在MongoDB中至少有一个replicaset成员。 您可以在mongo shell中使用rs.conf()命令查询成员。 如果它没有成员,那么你可以这样做:
cfg = {
... "_id" : "rs0",
... "version" : 1,
... "members" : [
... {
... "_id" : 0,
... "host" : "localhost:27017"
... }
... ]
... }
>rs.reconfig(cfg, {force:true})