首先虚拟机需要能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