wget http://download.redis.io/releases/redis-4.0.10.tar.gz git
tar xvf redis-4.0.10.tar.gz github
make redis
make install vim
which redis-cli app
vi /etc/redis/6379.conf spa
參考 命令行
https://raw.githubusercontent.com/antirez/redis/4.0/redis.conf server
修改以下配置項: ip
dir /mnt/disk1/redis/6379 get
appendonly yes
daemonize yes
pidfile /var/run/redis_6379.pid
redis-server /etc/redis/6379.conf
vim /etc/systemd/system/redis-6379.service
代碼參考:
[Unit]
Description=The redis-server Process Manager
After=syslog.target network.target
[Service]
Type=forking
PIDFile=/var/run/redis_6379.pid
ExecStart=/usr/local/bin/redis-server /etc/redis/6379.conf
ExecReload=/bin/kill -USR2 $MAINPID
ExecStop=/bin/kill -SIGINT $MAINPID
[Install]
WantedBy=multi-user.target
systemctl start redis-6379.service
systemctl stop redis-6379.service
systemctl enable redis-6379.service