如何修复 rethinkdb 连接被拒绝的问题?
How to fix rethinkdb connection refused problem?
我在此处遵循本指南 https://github.com/flaree/Flare-Cogs/tree/master/dankmemer。我进入了 import rethinkdb 部分,但是当 运行 r.connect('localhost', 28015).repl() 时出现此错误
命令。昨天一直在寻找修复程序,但找不到。
r.connect('localhost', 28015).repl()
Traceback (most recent call last):
File "/root/venv/lib/python3.8/site-packages/rethinkdb/net.py", line 349, in __init__
self._socket = socket.create_connection((self.host, self.port), timeout)
File "/usr/lib/python3.8/socket.py", line 808, in create_connection
raise err
File "/usr/lib/python3.8/socket.py", line 796, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/root/venv/lib/python3.8/site-packages/rethinkdb/__init__.py", line 93, in connect
return self.make_connection(self.connection_type, *args, **kwargs)
File "/root/venv/lib/python3.8/site-packages/rethinkdb/net.py", line 830, in make_connection
return conn.reconnect(timeout=timeout)
File "/root/venv/lib/python3.8/site-packages/rethinkdb/net.py", line 696, in reconnect
return self._instance.connect(timeout)
File "/root/venv/lib/python3.8/site-packages/rethinkdb/net.py", line 538, in connect
self._socket = SocketWrapper(self, timeout)
File "/root/venv/lib/python3.8/site-packages/rethinkdb/net.py", line 437, in __init__
raise ReqlDriverError(
rethinkdb.errors.ReqlDriverError: Could not connect to localhost:28015. Error: [Errno 111] Connection refused```
您需要先 运行 rethinkdb。
输入您的 venv,然后 运行 tmux
。然后 运行 rethinkdb
在你的 tmux shell 里面。这将启动 rethinkdb 服务器,并将其保持 运行ning。关闭 SSH 会话,然后打开另一个会话。再次尝试 运行ning 您的代码。
我在此处遵循本指南 https://github.com/flaree/Flare-Cogs/tree/master/dankmemer。我进入了 import rethinkdb 部分,但是当 运行 r.connect('localhost', 28015).repl() 时出现此错误 命令。昨天一直在寻找修复程序,但找不到。
r.connect('localhost', 28015).repl()
Traceback (most recent call last):
File "/root/venv/lib/python3.8/site-packages/rethinkdb/net.py", line 349, in __init__
self._socket = socket.create_connection((self.host, self.port), timeout)
File "/usr/lib/python3.8/socket.py", line 808, in create_connection
raise err
File "/usr/lib/python3.8/socket.py", line 796, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/root/venv/lib/python3.8/site-packages/rethinkdb/__init__.py", line 93, in connect
return self.make_connection(self.connection_type, *args, **kwargs)
File "/root/venv/lib/python3.8/site-packages/rethinkdb/net.py", line 830, in make_connection
return conn.reconnect(timeout=timeout)
File "/root/venv/lib/python3.8/site-packages/rethinkdb/net.py", line 696, in reconnect
return self._instance.connect(timeout)
File "/root/venv/lib/python3.8/site-packages/rethinkdb/net.py", line 538, in connect
self._socket = SocketWrapper(self, timeout)
File "/root/venv/lib/python3.8/site-packages/rethinkdb/net.py", line 437, in __init__
raise ReqlDriverError(
rethinkdb.errors.ReqlDriverError: Could not connect to localhost:28015. Error: [Errno 111] Connection refused```
您需要先 运行 rethinkdb。
输入您的 venv,然后 运行 tmux
。然后 运行 rethinkdb
在你的 tmux shell 里面。这将启动 rethinkdb 服务器,并将其保持 运行ning。关闭 SSH 会话,然后打开另一个会话。再次尝试 运行ning 您的代码。