redis7的redis.service启动配置
[Unit] Description=Redis Server After=network.target [Service] User=redis Group=redis ExecStart=/usr/bin/redis-server /etc/redis.conf ExecStop=/usr/bin/redis-cli shutdown Restart=always [Install] WantedBy=multi-user.target
redis.service(/usr/lib/systemd/system/)
redis.conf(/etc/redis/)
redis-server(/usr/local/bin/)
# 使服务自动运行 systemctl daemon-reload systemctl enable redis # 启动服务 systemctl restart redis systemctl status redis