Azure VM not connecting to Azure Redis Cache but local is connecting to Azure Redis Cache

故事扮演 提交于 2021-01-29 12:40:30

问题


The same Azure Redis cache is getting connected from local machince. The port 6380, on which cache is running is open in firewall of both inbound and outbound in the VM.

I tried in both NodeJs and Java. Both are connecting to remote Azure Redis from local and the exact same code for NodeJS and Java is not connceting to Azure Redis cache from VM.

Java config:

spring.redis.host=my-cache.redis.cache.windows.net

spring.redis.password=<password>

spring.redis.port=6380

spring.redis.ssl=true

NodeJS config:

const client = redis.createClient(6380,
  'my-cache.redis.cache.windows.net',
  {
    auth_pass: <password>,
    tls: { servername: 'my-cache.redis.cache.windows.net' }
  });


回答1:


well, the other end must accept connection as well, so you mist allow connections from the VM if you have any firewall rules at all:

https://docs.microsoft.com/en-us/azure/azure-cache-for-redis/cache-configure#firewall




回答2:


This is solved by the following on my Windows Desktop VM:

  1. Click Start.
  2. Enter cmd in the Start menu search text box.
  3. Right-click Command Prompt and select Run as Administrator.
  4. Run the following command: ipconfig /flushdns
  5. Run the following command: ipconfig /registerdns


来源:https://stackoverflow.com/questions/63008459/azure-vm-not-connecting-to-azure-redis-cache-but-local-is-connecting-to-azure-re

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!