杨梅冲
每天在想什么呢?

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

posted on 2025-05-26 11:21  杨梅冲  阅读(21)  评论(0)    收藏  举报