10019---访问远程Redis服务。Connect to Remote Redis Server
2016-07-30 23:16
405 查看
原文
通常来说,生产环境下的Redis服务器只设置为仅本机访问(Redis默认也只允许本机访问)。有时候我们也许需要使Redi能被远程访问。此文介绍配置Redis允许远程访问。
修改Redis配置文件/etc/redis/redis.conf,找到bind那行配置:
去掉#注释并改为:
指定配置文件然后重启Redis服务即可:
关于bind配置的含义,配置文件里的注释是这样说的:
配置好Redis服务并重启服务后。就可以使用客户端远程连接Redis服务了。命令格式如下:
其中{redis_host}就是远程的Redis服务所在服务器地址,{redis_port}就是Redis服务端口(Redis默认端口是6379)。例如:
连接时redis-cli -h host -p port -a passwd
通常来说,生产环境下的Redis服务器只设置为仅本机访问(Redis默认也只允许本机访问)。有时候我们也许需要使Redi能被远程访问。此文介绍配置Redis允许远程访问。
配置
修改Redis配置文件/etc/redis/redis.conf,找到bind那行配置:# bind 127.0.0.1
去掉#注释并改为:
bind 0.0.0.0
指定配置文件然后重启Redis服务即可:
$ sudo redis-server /etc/redis/redis.conf[/code]
关于bind配置的含义,配置文件里的注释是这样说的:
# By default Redis listens for connections from all the network interfaces # available on the server. It is possible to listen to just one or multiple # interfaces using the "bind" configuration directive, followed by one or # more IP addresses. # # Examples: # # bind 192.168.1.100 10.0.0.1 # bind 127.0.0.1
远程连接
配置好Redis服务并重启服务后。就可以使用客户端远程连接Redis服务了。命令格式如下:$ redis-cli -h {redis_host} -p {redis_port}
其中{redis_host}就是远程的Redis服务所在服务器地址,{redis_port}就是Redis服务端口(Redis默认端口是6379)。例如:
$ redis-cli -h 120.120.10.10 -p 6379 redis>ping PONG如果需要密码时,则修改配置文件的requirepass test001,
连接时redis-cli -h host -p port -a passwd
相关文章推荐
- 访问vm_cnetos 远程Redis服务。Connect to Remote Redis Server
- 访问远程Redis服务。Connect to Remote Redis Server
- MySQL:远程访问权限,is not allowed to connect to this MySQL server
- mysql 远程访问不行解决方法 Host is not allowed to connect to this MySQL server
- mysql 远程访问不行解决方法 Host is not allowed to connect to this MySQL server
- mysql 远程访问不行解决方法 Host is not allowed to connect to this MySQL server
- mysql 远程访问不行解决方法,Host '' is not allowed to connect to this MySQL server
- mysql 远程访问不行解决方法 Host is not allowed to connect to this MySQL server
- 解决Navicat 报错:1130-host ... is not allowed to connect to this MySql server,MySQL不允许从远程访问的方法 .
- mysql 远程访问不行解决方法 Host is not allowed to connect to this MySQL server
- Eclispe远程调试Failed to connect to remote VM Malformed reply from SOCKS server
- mysql远程访问 登录ERROR 1130: is not allowed to connect to this MySQL server解决办法
- HOSt ip is not allowed to connect to this MySql server, MYSQL添加远程用户或允许远程访问三种方法
- 解决Navicat 报错:1130-host ... is not allowed to connect to this MySql server,MySQL不允许从远程访问的方法
- 授权访问MySQL Server(远程连接MYSQL提示Host is not allowed to connect to this MySQL server)
- 解决Navicat 报错:1130-host ... is not allowed to connect to this MySql server,MySQL不允许从远程访问的方法
- 解决Navicat 报错:1130-host ... is not allowed to connect to this MySql server,MySQL不允许从远程访问的方法 .
- 解决mysql本地可访问,远程无法访问的问题 Host is not allowed to connect to this MySQL server
- 解决Navicat 报错:1130-host ... is not allowed to connect to this MySql server,MySQL不允许从远程访问的方法
- Catalog远程访问sde时提示 :failed to connect to the specified server Operation Failed