连接到聊天信使中的redis-server时出错

时间:2013-10-18 14:09:28

标签: python redis

我开发了Python的聊天系统。使用的库:easygui,pycrypto,netifaces,stepic,redis,rabbitmq,pika,PIL和setuptools。 所有库似乎安装好参考:python>导入库 通过在localhost上使用redis-server,用户可以连接到redis并注册,登录,聊天......但是当在不同的设备上设置redis并在代码中将localhost更改为redis server ip时,我收到以下错误。 (我在oracle虚拟机中使用了lubuntu的最新版本)

enter code here
Traceback (most recent call last):
File "kiducb.py", line 392, in <module>
g = Gui()
File "kiducb.py", line 19, in __init__
self.welcome()
File "kiducb.py", line 33, in welcome
rl = self.login()
File "kiducb.py", line 126, in login
resp = self.check_up(fvals[0], fvals[1], mac)
File "kiducb.py", line 76, in check_up
val = self.re.get(username)
File "/usr/lib/python2.7/dist-packages/redis/client.py", line 423, in get
return self.execute_command('GET', name)
File "/usr/lib/python2.7/dist-packages/redis/client.py", line 283, in execute_command
connection.send_command(*args)
File "/usr/lib/python2.7/dist-packages/redis/connection.py", line 260, in send_command
self.send_packed_command(self.pack_command(*args))
File "/usr/lib/python2.7/dist-packages/redis/connection.py", line 243, in 
send_packed_command        
self.connect()
File "/usr/lib/python2.7/dist-packages/redis/connection.py", line 191, in connect
raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error 111 connecting 10.1.1.12:6379. Connection refused.

1 个答案:

答案 0 :(得分:3)

为了解决这个问题,我通过使用apt-get从系统中删除了之前安装的redis-server,然后我发现了这个链接指令:https://www.digitalocean.com/community/articles/how-to-install-and-use-redis