码迷,mamicode.com
首页 > 其他好文 > 详细

centos7使用yum方式安装redis6

时间:2021-06-07 21:16:38      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:mon   ice   lin   -o   down   network   memory   sys   var   

yum -y install epel-release wget make gcc-c++
cd /opt
wget https://download.redis.io/releases/redis-6.2.3.tar.gz


tar -xf redis-6.2.3.tar.gz
cd redis-6.2.3
make
make install PREFIX=/usr/local/redis


cp redis.conf /etc/redis.conf
sed -i "s/bind 127.0.0.1/bind 0.0.0.0/g" /etc/redis.conf
sed -i "s/daemonize no/daemonize yes/g" /etc/redis.conf
sed -i "561i maxmemory-policy allkeys-lru" /etc/redis.conf
sed -i "481i requirepass weakPassword" /etc/redis.conf

vi /etc/systemd/system/redis.service
[Unit]
Description=Redis persistent key-value database
After=network.target
After=network-online.target
Wants=network-online.target

[Service]
Type=forking
PIDFile=/var/run/redis_6379.pid
ExecStart=/usr/local/redis/bin/redis-server /etc/redis.conf
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID

[Install]
WantedBy=multi-user.target


systemctl enable redis
systemctl start redis

centos7使用yum方式安装redis6

标签:mon   ice   lin   -o   down   network   memory   sys   var   

原文地址:https://www.cnblogs.com/sanduzxcvbnm/p/14860022.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!