redis 安装

redis 官网 http://redis.io

===安装===
yum -y install gcc gcc-c++ libstdc++-devel
wget http://download.redis.io/releases/redis-5.0.5.tar.gz
tar -zxvf redis-5.0.5.tar.gz
cd redis-5.0.5
make
===运行===
cp /data/src/redis-5.0.5/redis.conf /etc/redis/
vim /etc/redis/redis.conf
;开启
deamonize on

redis-server /etc/redis/redis.conf

===开机自启动===
echo "redis-server /etc/redis/redis.conf" >>/etc/rc.local
===设置密码(需要重启redis才能生效)===
CONFIG get requirepass
CONFIG set requirepass “****”
设置后访问
redis-cli -h 127.0.0.1 -p 6379 -a ****
===关闭===
redis-cli shutdown
===修改 Redis 服务运行账号===
useradd -M -s /sbin/nologin [username]

===安全参考===
https://help.aliyun.com/knowledge_detail/37447.html

发表评论

电子邮件地址不会被公开。 必填项已用*标注