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?
ping xxx.xxx.xxx.xxx 6379PING 6379 (0.0.24.235) 56(124) bytes of data. ^C --- 6379 ping statistics --- 32 packets transmitted, 0 received, 100% packet loss, time 31081ms