centos7 配置redis

文件上传 yum -y install lrzsz

安装redis部署前操作  同时下载redis-3.0.4.tar.gz安装包

yum -y install gcc-c++

yum -y install tcl

tar -xf redis-3.0.4.tar.gz
cd redis-3.0.4
make && make install 

mkdir /etc/redis

cp redis.conf /etc/redis/

vim redis.conf
将daemonize no改为 daemonize yes 守护进程

requirepass onlinE88  设置密码

启动方式
redis-server /etc/redis/redis.conf
vim /etc/hosts
127.0.0.1 redis.hq88.com

防火墙
iptables I INPUT -p tcp -m state --state NeW -m tcp --dport xxxx -j ACCEPT 
service iptables save

远程连接
redis-cli -h 192.168.1.1 -p xxxx

本地连接
redis-cli
1   auth "password " 验证密码是否正确2   ping  返回PONG
3   quit  关闭连接

猜你喜欢

转载自www.cnblogs.com/Liang-jc/p/9274452.html