ProxyPool使用记录

ProxyPool启动出现错误:redis.exceptions.ConnectionError: Error 111 connecting to 127.0.0.1:6379. Connection refused.
可能与您的问题没有直接关系,但是我遇到了同样的错误,结果发现我的系统上未安装redis-server软件包,或者是没有启动。
解决方法是sudo apt-get install redis-server。别忘了开始您的服务sudo service redis-server start ,您可以使用该命令sudo service redis-server {start|stop|restart|force-reload|status}作为参考

也有可能是Redis出了问题,查看一下状态:
sudo service redis status
没运行就启动一下:
sudo service redis start
如果报错

● redis.service - LSB: starts Redis
   Loaded: loaded (/etc/init.d/redis; generated)
   Active: failed (Result: exit-code) since Thu 2021-04-15 21:08:53 CST; 14s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 20260 ExecStart=/etc/init.d/redis start (code=exited, status=1/FAILURE)

Apr 15 21:08:53 iZ2zeakg8zcsgqnx1q3txsZ systemd[1]: Starting LSB: starts Redis...
Apr 15 21:08:53 iZ2zeakg8zcsgqnx1q3txsZ redis[20260]: Redis is not running, buy pid file is exits /www/server/redis/redis.pid
Apr 15 21:08:53 iZ2zeakg8zcsgqnx1q3txsZ systemd[1]: redis.service: Control process exited, code=exited status=1
Apr 15 21:08:53 iZ2zeakg8zcsgqnx1q3txsZ systemd[1]: redis.service: Failed with result 'exit-code'.
Apr 15 21:08:53 iZ2zeakg8zcsgqnx1q3txsZ systemd[1]: Failed to start LSB: starts Redis.

原因可能是redis 没有正常关闭,redis.pid文件残留。
解决办法:
[root@localhost ]# vi /etc/init.d/redis
搜索【Redis is not running, buy pid file is exits】
大概在38行

 34 redis_start(){
 35         if [ -f "/www/server/redis/redis.pid" ]; then
 36                 ps -p $(cat ${PIDFILE}) > /dev/null 2>&1
 37                 if [ $? -ne "0" ]; then
 38                         echo Redis is not running, buy pid file is exits ${PIDFILE}
 39   
 40                         exit 1
 41                 else
 42                         echo "redis is running! ($(cat ${PIDFILE}))"
 43                         exit 0
 44                 fi
 45         fi
 46         echo "Starting redis server..."
 47         sudo -u redis $EXEC $CONF
 48         echo ${REDIS_PORT} > /www/server/redis/start.pl
 49         echo "Starting redis success!"
 50 }

在39行加入(exit 1之前 )

rm -rf /www/server/redis/redis.pid && service redis restart && service redis status

然后sudo service redis restart试试查看效果

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值