Azure VM未连接到Azure Redis缓存,但本地正在连接到Azure Redis缓存 [英] Azure VM not connecting to Azure Redis Cache but local is connecting to Azure Redis Cache

查看:61
本文介绍了Azure VM未连接到Azure Redis缓存,但本地正在连接到Azure Redis缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

相同的Azure Redis缓存正通过本地设备进行连接.正在运行缓存的端口6380在VM的入站和出站防火墙中都是打开的.

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.

我在NodeJ和Java中都尝试过.两者都从本地连接到远程Azure Redis,NodeJS和Java完全相同的代码并不意味着从VM连接到Azure Redis缓存.

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配置:

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

spring.redis.password=<password>

spring.redis.port=6380

spring.redis.ssl=true

NodeJS配置:

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

推荐答案

此问题通过我的Windows桌面VM上的以下问题解决:

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

  1. 单击开始.
  2. 在开始"菜单搜索文本框中输入cmd.
  3. 右键单击命令提示符",然后选择以管理员身份运行".
  4. 运行以下命令:ipconfig/flushdns
  5. 运行以下命令:ipconfig/registerdns

这篇关于Azure VM未连接到Azure Redis缓存,但本地正在连接到Azure Redis缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆