访问mongodb 报错如下
Traceback (most recent call last): File "chem.py", line 47, in <module>
chem().chemdata()
File "chem.py", line 42, in chemdata
chemCollection.insert_one({msdsRefer:conData,"backData":backData})
File "/usr/local/lib/python3.6/site-packages/pymongo/collection.py", line 698, in insert_one
session=session),
File "/usr/local/lib/python3.6/site-packages/pymongo/collection.py", line 612, in _insert
bypass_doc_val, session)
File "/usr/local/lib/python3.6/site-packages/pymongo/collection.py", line 600, in _insert_one
acknowledged, _insert_command, session)
File "/usr/local/lib/python3.6/site-packages/pymongo/mongo_client.py", line 1490, in _retryable_write
with self._tmp_session(session) as s:
File "/usr/local/lib/python3.6/contextlib.py", line 81, in __enter__
return next(self.gen)
File "/usr/local/lib/python3.6/site-packages/pymongo/mongo_client.py", line 1819, in _tmp_session
s = self._ensure_session(session)
File "/usr/local/lib/python3.6/site-packages/pymongo/mongo_client.py", line 1806, in _ensure_session
return self.__start_session(True, causal_consistency=False)
File "/usr/local/lib/python3.6/site-packages/pymongo/mongo_client.py", line 1759, in __start_session
server_session = self._get_server_session()
File "/usr/local/lib/python3.6/site-packages/pymongo/mongo_client.py", line 1792, in _get_server_session
return self._topology.get_server_session()
File "/usr/local/lib/python3.6/site-packages/pymongo/topology.py", line 485, in get_server_session
None)
File "/usr/local/lib/python3.6/site-packages/pymongo/topology.py", line 209, in _select_servers_loop
self._error_message(selector))
pymongo.errors.ServerSelectionTimeoutError: 115.125.32.147:27017: timed out
我的服务器是115.125.32.147 ,端口是27017 我在插入数据的时127.0.0.1:27017可以,这是为啥?我的配置里面build_ip改成了0.0.0.0,无论是win远程访问,还是本地访问只要ip 写115.125.32.147 就报错 pymongo.errors.ServerSelectionTimeoutError: 115.125.32.147:27017: timed out
mongodb 我没有设置密码,远程的服务器防火墙是关闭的
以上是 访问mongodb 报错如下 的全部内容, 来源链接: utcz.com/a/157034.html