欢迎访问我的个人博客网站:http://www.yanmin99.com/
Reids 设置远程登陆
一、Redis 远程登陆的命令
-
Redis远程登陆语法
redis-cli -h host -p port [-a password]
host:服务器地址 port:端口 password:密码(可选)
二、Redis设置远程登陆
-
1、Redis默认配置远程登陆
caiwenhua-d1:notes yanmin$ redis-cli -h 47.88.76.55 -p 6379 Could not connect to Redis at 47.88.76.55:6379: Connection refused Could not connect to Redis at 47.88.76.55:6379: Connection refused
-
2、修改Redis.conf配置,远程登陆
-
A、修改该redis.conf配置文件。yum安装redis.conf位置
/etc/redis.conf
,redis源码安装和apt-get一般位置/etc/redis/redis./conf
,把bind 127.0.0.1
修改称为bind 0.0.0.0
# If you want you can bind a single interface, if the bind option is not # specified all the interfaces will listen for incoming connections. # bind 127.0.0.1
127.0.0.1 代表只能本机访问,0.0.0.0代表所有机器都可以访问
-
B、重启
Redis服务
//yum安装启动方式 service redis restart //源码安装启动方式 redis-server /etc/redis/redis.conf &
-