proxy_pool icon indicating copy to clipboard operation
proxy_pool copied to clipboard

求助:ConnectionRefusedError: [Errno 111] Connection refused

Open zeajie opened this issue 4 years ago • 3 comments

Traceback (most recent call last): File "/app/db/redisClient.py", line 144, in test self.getCount() File "/app/db/redisClient.py", line 130, in getCount proxies = self.getAll(https=False) File "/app/db/redisClient.py", line 112, in getAll items = self.__conn.hvals(self.name) File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 3084, in hvals return self.execute_command('HVALS', name) File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 898, in execute_command conn = self.connection or pool.get_connection(command_name, **options) File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 1379, in get_connection connection.connect() File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 563, in connect raise ConnectionError(self._error_message(e)) redis.exceptions.ConnectionError: Error 111 connecting to 127.0.0.1:6379. Connection refused.

zeajie avatar Oct 04 '21 13:10 zeajie

数据库配置不对,连不上这个 127.0.0.1:6379

jhao104 avatar Oct 08 '21 02:10 jhao104

容器与主机上的redis通信 docker run --net=host --env DB_CONN=redis://:[email protected]:6379/0 -p 5010:5010 jhao104/proxy_pool:latest

2020263225 avatar Oct 09 '21 07:10 2020263225

容器与主机上的redis通信 docker run --net=host --env DB_CONN=redis://:[email protected]:6379/0 -p 5010:5010 jhao104/proxy_pool:latest

对的, 容器内的127.0.0.1并不是宿主机上的127.0.0.1

jhao104 avatar Oct 11 '21 08:10 jhao104