安装:
1.cd /usr/redis //redis目录作为安装目录,没有自行创建
2.tar xzf redis-4.0.6.tar.gz
3. cd redis-4.0.6
4.make 如果有commond not found 我在make时出现commond gcc not found ,gcc没有安装,执行yum install gcc ,然后删除解压文件,重新解压
5.cp /usr/redis/redis-4.0.6/redis.conf /usr/redis/redis-4.0.6/src 复制配置文件作为启动文件
6.修改参数:注释bind 127.0.01 protected-model no
7.启动 cd src/ redis-server redis.conf
8.windows下 :telnet 192.168.1.17 6379 表示端口注册进防火墙,可以访问,安装成功
常规排查:
1.查看监听ip是否被绑定 bind 127.0.0.1 一般是需要注释
2.protected-mode no
3.port 6379
4.daemonize no
5.require password 如果开就要写密码,如果没开jedis客户端写密码也会错
环境排查:
1.vi /etc/sysconfig/iptables 查看防火墙文件是否将6379端口加进去
2.firewall-cmd –query-port=6379/tcp 查看防火墙是否公开6379端口 如果为no 执行第三步
3.firewall-cmd --add-port=6379/tcp 公开6379
Windows访问linux redis:
telnet ip port 如果出现黑屏表示外部可以访问
telent不是内部命令:打开控制台,control.exe ,选择左侧启用或关闭Windows功能,telnet客户端打对勾