小編給大家分享一下CentOS中如何將Redis配置為系統(tǒng)服務(wù),相信大部分人都還不怎么了解,因此分享這篇文章給大家參考一下,希望大家閱讀完這篇文章后大有收獲,下面讓我們一起去了解一下吧!
CentOS 將 Redis 配置為系統(tǒng)服務(wù)
創(chuàng)建 redis.service
cd /usr/lib/systemd/system touch redis.service
編輯內(nèi)容
[Unit] Description=Redis Server After=network.target [Service] PIDFile=/var/run/redis_6379.pid ExecStart=/usr/local/bin/redis-server /etc/redis.conf ExecStop=/usr/local/bin/redis-cli -a passwd shutdown ExecReload=/bin/kill -s HUP $MAINPID [Install] WantedBy=mutli-user.target
重新載入 systemctl 并啟動服務(wù)
systemctl daemon-reload systemctl start redis.service
查看狀態(tài)
systemctl status redis.service
關(guān)閉 Redis
systemctl stop redis.service
開機(jī)自啟
systemctl enable redis.service
是否開機(jī)自啟
systemctl is-enabled redis.service
以上是CentOS中如何將Redis配置為系統(tǒng)服務(wù)的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對大家有所幫助,如果還想學(xué)習(xí)更多知識,歡迎關(guān)注創(chuàng)新互聯(lián)-成都網(wǎng)站建設(shè)公司行業(yè)資訊頻道!
當(dāng)前文章:CentOS中如何將Redis配置為系統(tǒng)服務(wù)-創(chuàng)新互聯(lián)
文章起源:http://sd-ha.com/article14/dchoge.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站營銷、自適應(yīng)網(wǎng)站、ChatGPT、企業(yè)建站、外貿(mào)建站、全網(wǎng)營銷推廣
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容