干货,干货,纯干货!
1,下载
wget https://download.redis.io/releases/redis-6.2.3.tar.gz
2,解压
tar -xvzf redis-6.2.3.tar.gz
3,编译
cd redis-6.2.3
make
4,安装
cd src/
make install PREFIX=/usr/local/redis
5,配置
cp redis-6.2.3/redis.conf /etc/redis/
vi /usr/local/redis/etc/redis.conf
daemonize yes #开启daemonize 模式
protected-mode yes #开启密码保护
requirepass loading #设置密码
6,配置开机启动
cp redis-6.2.3/utils/redis_init_script /etc/init.d/redis
chmod +x /etc/rc.d/init.d/redis
vi /etc/init.d/redis
EXEC=/usr/local/redis/bin/redis-server
CLIEXEC=/usr/local/redis/bin/redis-cli
CONF="/etc/redis/redis.conf"
7,设置开机启动
chkconfig redis on
8,启动redis
service redis-server start
9,停止 redis
service redis-server stop