Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have an application server that is connecting to an external redis server for pub/sub, I am currently using a redis python library, when I connect using the library it assumes the redis server is started locally at 127.0.0.1:6379. Is there an environment variable that sets the default redis connection to 127.0.0.1:6379? I can specify the server end point in my application code but I would prefer to use an environment variable if one is available.

share|improve this question
    
What is the library you are using ? –  Spredzy May 27 '13 at 17:57
    
brukva library for tornado –  S-K' May 27 '13 at 18:17

1 Answer 1

up vote 3 down vote accepted

It is not an environmental setting, but a default setting. Check the source code:

def __init__(self, host='localhost', port=6379, password=None,
...
)

Change it in the configuration file:

# Accept connections on the specified port, default is 6379.
# If port 0 is specified Redis will not listen on a TCP socket.
#port 6379

# If you want you can bind a single interface, if the bind option is not
# specified all the interfaces will listen for incoming connections.
#
# bind 127.0.0.1
share|improve this answer
    
Redis is on a separate server, what configuration file are you referring to? –  S-K' May 28 '13 at 19:37
    
@S-K' the one I linked –  dawud May 28 '13 at 19:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.