redis:
[root@server_222 redis]# cat /etc/systemd/system/redis.service [Unit] Description=Redis In-Memory Data Store After=network.target [Service] User=redis Group=redis ExecStart=/usr/local/bin/redis-server /usr/local/redis/redis.conf ExecStop=/usr/local/bin/redis-cli shutdown Restart=always RestartSec=3 PIDFile=/var/run/redis_6379.pid PrivateTmp=yes [Install] WantedBy=multi-user.target
systemctl enable redis
mongodb开机启动:
[Unit] Description=High-performance, schema-free document-oriented database After=network.target [Service] User=mongodb ExecStart=/usr/bin/mongod --config /etc/mongod.conf PIDFile=/var/run/mongodb/mongod.pid [Install] WantedBy=multi-user.target
systemctl enable mongod.service