linux 開(kāi)機(jī)自啟動(dòng)redis服務(wù)的方法
[Unit] Description=The redis-server Process Manager Documentation=https://redis.io/ After=network.target [Service] Type=forking ExecStart=/root/redis-5.0.7/src/redis-server /root/redis-5.0.7/redis.conf #有密碼則需要在cli后面加 -a "密碼" ExecStop=/root/redis-5.0.7/src/redis-cli shutdown [Install] WantedBy=multi-user.target
1.先輸入
vi /lib/systemd/system/redis.service
把上述配置復(fù)制進(jìn)去,保存退出
2.設(shè)置開(kāi)機(jī)自啟動(dòng)
systemctl enable redis
3.使用命令
#開(kāi)啟服務(wù) systemctl start redis #停止服務(wù) systemctl stop redis #查看運(yùn)行狀態(tài) system status redis
總結(jié)
以上所述是小編給大家介紹的linux 開(kāi)機(jī)自啟動(dòng)redis服務(wù)的方法,希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!
如果你覺(jué)得本文對(duì)你有幫助,歡迎轉(zhuǎn)載,煩請(qǐng)注明出處,謝謝!
相關(guān)文章
Linux 中可重入函數(shù)與不可重入函數(shù)詳解
這篇文章主要介紹了Linux 中可重入函數(shù)與不可重入函數(shù)詳解的相關(guān)資料,需要的朋友可以參考下2017-06-06Linux文本查看命令及其選項(xiàng)詳解(cat,head,tail)
這篇文章主要介紹了Linux文本查看命令及其選項(xiàng)詳解(cat,head,tail),本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2020-08-08Shell腳本實(shí)現(xiàn)防止國(guó)外ip訪問(wèn)服務(wù)器
這篇文章主要介紹了Shell腳本實(shí)現(xiàn)防止國(guó)外ip訪問(wèn)服務(wù)器,本文通過(guò)分析使用IP地址庫(kù),然后把國(guó)外IP指導(dǎo)入iptables并禁止訪問(wèn)實(shí)現(xiàn),需要的朋友可以參考下2014-12-12nagios 分發(fā)文件實(shí)現(xiàn)代碼
這篇文章主要介紹了nagios 分發(fā)文件實(shí)現(xiàn)代碼,需要的朋友可以參考下2014-09-09