安装
# wget https://download.redis.io/releases/redis-6.2.2.tar.gz # tar xzf redis-6.2.2.tar.gz # cd redis-6.2.2 # make install PREFIX=/usr/local/redis # make test
配置
新增/etc/systemd/system/redis.service
[Unit] Description=redis-server After=network.target [Service] PIDFile=/var/run/redis_6379.pid ExecStart=/usr/local/redis/bin/redis-server /usr/local/redis/bin/redis.conf --daemonize no ExecReload=/bin/kill -s HUP $MAINPID ExecStop=/bin/kill -s QUIT $MAINPID PrivateTmp=true [Install] WantedBy=multi-user.target
将src下的redis.conf复制到/usr/local/redis/bin
配置RDB、AOF、requirepass......
启动
#systemctl daemon-reload #systemctl enable redis.service #systemctl start redis.service