2

I made a Debian 9 VM on Azure, I also installed MariaDB, PHPMyAdmin, and node with pm2. With this, I set in inbound rules port 80 for HTTP, 3306 for MySQL and port 6379 for the Redis.

when i try to connect with the windows client it refuses or in code it also refuses and i get "Error: Redis connection to [someIP]:6379 failed - connect ETIMEDOUT [someIP]:6379". when I change the connection settings to another Redis I own it does work, so there shouldn't be an issue with the code.

in short: what should I check for a successful connection from my home network to the Redis on Azure.

2
  • redis-cli, the default host is localhost. If you want to access redis from Internet, the service could not listen on localhost, you should use private ip. Then use redis-cli -h <private ip> and redis-cli -h <public ip>. Hope it helps. – Shui shengbao Jan 15 '18 at 3:04
  • Hi, does it work for you? Please let me know if you need more future help. – Shui shengbao Jan 17 '18 at 0:56
0

I refer this official document and install redis on Debian 9. I could connect it with VM Public IP.

You should enable Redis is listening on VM's private IP. By default, it listens on localhost. Modify /etc/redis/6379.conf as below:

bind <vm's private ip>

Then restart Redis. systemctl restart redis_6379.

Check connection on Linux.

root@shui:~/redis-stable/utils# redis-cli -h 52.232.114.152
52.232.114.152:6379> set test HugeServer
OK
52.232.114.152:6379> get test
"HugeServer"

Note: You should open port 6379 on NSG like this screenshot.

12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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