microsoftarchive / redis

Redis is an in-memory database that persists on disk. The data model is key-value, but many different kind of values are supported: Strings, Lists, Sets, Sorted Sets, Hashes
http://redis.io
Other
20.81k stars 5.37k forks source link

Redis on Windows, not accepting external IPs #456

Open purnashree opened 8 years ago

purnashree commented 8 years ago

Hi,

I installed redis for windows (Redis-x64-2.8.2400) on my system. I am trying to access the server from Java using jedis from a different machine. So I want to be able to provide the IP address of the redis server. I changed the redis.windows.config file, added following bind 0.0.0.0 #This did not work I added my specific ip bind #This also did not work. Then started the redis server by the following command: redis-server.exe redis.windows.config The server is up, but does not show anything about this IP. I then go ahead and start the client as below: redis-client.exe -h And the client hangs. If I only start it without the mention of the host ip as below, then it works fine but opens at ip 127.0.0.1: redis-client.exe

How can I make it work with a specific ip? I do need to change the port number? Is there any firewall check that I need to do?

Thanks

enricogior commented 8 years ago

Hi @purnashree, by default Redis binds to all available network adapters, so you don't have to change anything in the config file in order to be able to connect to the server from another machine, just use the command redis-cli.exe -h 10.20.30.10 (replace 10.20.30.10 with the IP address of your server). If the server uses a different port from the default 6379, use the command redis-cli.exe -h 10.20.30.10 -p 8080 (replace 8080 with the port number used by your server). If you use the MSI installer, it already asks if you want to open the port on the firewall, if you don't use the MSI you have to open the port manually.