5

I have installed redis on an independent database server(ec2 instance). And it has been installed and configured properly. Now all that I want to do is from my webserver, I connect to it, and make changes to its key value store.

I have a python/django application running on heroku, and I am using PostgreSQL for everything else, I am using redis just to store some temporary variable in the KV sets.

Now, I install https://github.com/andymccurdy/redis-py on my localserver, and webserver.

To test the connection and check if things are working well, I try the following in my environment :

>>> pool = redis.ConnectionPool(host='MY_DBSERVER_IP_ADDRESS', port=6379, db=0)
>>> r = redis.Redis(connection_pool=pool)
>>> r.set('foo', 'bar')

this gives me an error - ConnectionError: Error 111 connecting 54.235.xxx.xxx:6379. Connection refused.

How do I connect? What am I missing?

3
  • try to see if you can access the remote server via telnet: just do "telnet MY_DBSERVER_IP PORT" in the terminal Commented May 14, 2013 at 9:08
  • ping xxx.xxx.xxx.xxx 6379 PING 6379 (0.0.24.235) 56(124) bytes of data. ^C --- 6379 ping statistics --- 32 packets transmitted, 0 received, 100% packet loss, time 31081ms Commented May 14, 2013 at 9:55
  • So there's your problem. Commented May 14, 2013 at 12:04

2 Answers 2

6

By default the config is set to only bind to 127.0.0.1 You just need to find your config (/etc/redis/redis.conf on Ubuntu) and comment out the bind 127.0.0.1 line.

Sign up to request clarification or add additional context in comments.

Comments

3

So what I ended up doing was, removing uncommenting bind 127.0.0.1 to bind 0.0.0.0

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.