解决:win10无法访问虚拟机中的redis

本文介绍了如何解决在Windows 10系统中无法访问虚拟机内Redis服务的问题。关键步骤包括确保虚拟机网络通畅,编辑Redis配置文件`redis.conf`,将`bind`设置为`0.0.0.0`以允许所有主机访问,并关闭保护模式。
摘要由CSDN通过智能技术生成

首先虚拟机需要能ping通外网,比如ping www.baidu.com

网络通畅。ok 开始解决

需要编辑一下redis的配置文件  redis.conf,在redis的根目录下

[root@slave1 redis-5.0.5]# ls
00-RELEASENOTES  CONTRIBUTING  deps     Makefile   README.md   runtest          runtest-moduleapi  sentinel.conf  tests
BUGS             COPYING       INSTALL  MANIFESTO  redis.conf  runtest-cluster  runtest-sentinel   src            utils

编辑 vim redis.conf

找到 bind 127.0.0.1     默认是只允许本机访问

修改为 bind 0.0.0.0     设置为0.0.0.0 任何主机都可以访问

同时将保护模式关闭: protected-mode no

################################## NETWORK #####################################

# By default, if no "bind" configuration directive is specified, Redis listens
# for connections from all the network interfaces available on the server.
# It is possible to listen to just one or multiple selected interfaces using
# the "bind" configuration direct
  • 3
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值