jhao104 / proxy_pool

Python ProxyPool for web spider
https://jhao104.github.io/proxy_pool/
MIT License
21.48k stars 5.17k forks source link

用docker启动提示了这个错误请问是为什么? #402

Open mooneee opened 4 years ago

mooneee commented 4 years ago

是一个小白,他提示了 for _proxy in pm.db.getAll(): File "../DB/DbClient.py", line 102, in getAll return self.client.getAll() File "/usr/src/app/DB/RedisClient.py", line 107, in getAll item_dict = self.__conn.hgetall(self.name) File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 2717, in hgetall return self.execute_command('HGETALL', name) File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 836, 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 1224, in get_connection connection.connect() File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 544, in connect raise ConnectionError(self._error_message(e)) redis.exceptions.ConnectionError: Error 111 connecting to 127.0.0.1:6379. Connection refused. 一直在报错。请问怎么解决 谢谢

mooneee commented 4 years ago

2019-12-10 10:21:50,674 ProxyManager.py[line:46] INFO ProxyFetch - freeProxy04: start 2019-12-10 10:21:50,878 ProxyManager.py[line:61] INFO ProxyFetch - freeProxy04: 61.145.8.13:12219 success 2019-12-10 10:21:50,879 ProxyManager.py[line:65] ERROR ProxyFetch - freeProxy04: error 2019-12-10 10:21:50,879 ProxyManager.py[line:66] ERROR Error 111 connecting to 127.0.0.1:6379. Connection refused. 2019-12-10 10:21:50,879 ProxyManager.py[line:46] INFO ProxyFetch - freeProxy05: start 2019-12-10 10:21:52,024 ProxyManager.py[line:61] INFO ProxyFetch - freeProxy05: 183.154.54.156:9999 success 2019-12-10 10:21:52,025 ProxyManager.py[line:65] ERROR ProxyFetch - freeProxy05: error 2019-12-10 10:21:52,025 ProxyManager.py[line:66] ERROR Error 111 connecting to 127.0.0.1:6379. Connection refused. 2019-12-10 10:21:52,025 ProxyManager.py[line:46] INFO ProxyFetch - freeProxy06: start 2019-12-10 10:23:02,335 ProxyManager.py[line:65] ERROR ProxyFetch - freeProxy06: error 2019-12-10 10:23:02,335 ProxyManager.py[line:66] ERROR can only parse strings 2019-12-10 10:23:02,335 ProxyManager.py[line:46] INFO ProxyFetch - freeProxy07: start

jhao104 commented 4 years ago

数据库配错了 1.检查db_type 2.在你的运行环境检查是否和数据库是通的, 比如你配置的是127.0.0.1:6379, 可以使用 telnet命令检查端口是否是通的

ghost commented 4 years ago

@mooneee 请问老兄这个问题后来解决了吗

YumeMichi commented 4 years ago

@mooneee 请问老兄这个问题后来解决了吗

https://www.bilibili.com/video/av86903861/

ghost commented 4 years ago

@mooneee 请问老兄这个问题后来解决了吗

https://www.bilibili.com/video/av86903861/

非常感谢老哥! 刚好刚刚在几个 issue 下面连问了几个问题,突然想到了。 去试了一下完全不用 docker 的,成功了。 能 fetch -> raw -> useful 几个阶段,这样成功获取到 代理IP。

不过新问题又来了!

在 cli 目录下,执行 python proxyPool.py webserver 会正常显示 cmd header 那幅图,然后显示

ghost commented 4 years ago

@mooneee 请问老兄这个问题后来解决了吗

https://www.bilibili.com/video/av86903861/

你好,又接着搞了一晚上,终于OK了。

  1. 跟着老哥的bilibili视频,把 使用docker 的方式,也跑通了,但是同样存在无法访问 webserver 的问题;
  2. 后面又搜索了一些关于IP的帖子之后,尝试将 webserver 配置进行了调整,IP 修改为 127.0.0.x,然后通过浏览器访问成功(不使用 docker 的方式成功;使用 docker 的方式现在还没测试,不过估计应该也OK)