centos7 配置redis

Posted 想翻身的猫

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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  关闭连接

 


以上是关于centos7 配置redis的主要内容,如果未能解决你的问题,请参考以下文章