redis設(shè)置開機自啟動的方法

這篇文章給大家分享的是有關(guān)redis設(shè)置開機自啟動的方法的內(nèi)容。小編覺得挺實用的,因此分享給大家做個參考。一起跟隨小編過來看看吧。

創(chuàng)新互聯(lián)公司主要從事網(wǎng)頁設(shè)計、PC網(wǎng)站建設(shè)(電腦版網(wǎng)站建設(shè))、wap網(wǎng)站建設(shè)(手機版網(wǎng)站建設(shè))、響應(yīng)式網(wǎng)站開發(fā)、程序開發(fā)、網(wǎng)站優(yōu)化、微網(wǎng)站、小程序制作等,憑借多年來在互聯(lián)網(wǎng)的打拼,我們在互聯(lián)網(wǎng)網(wǎng)站建設(shè)行業(yè)積累了豐富的成都網(wǎng)站建設(shè)、做網(wǎng)站、網(wǎng)站設(shè)計、網(wǎng)絡(luò)營銷經(jīng)驗,集策劃、開發(fā)、設(shè)計、營銷、管理等多方位專業(yè)化運作于一體。

1、拷貝 redis 安裝目前下的 /usr/local/redis-4.0.8/utils/redis_init_script 到 /etc/init.d/redis文件中;

cp /usr/local/redis-4.0.8/utils/redis_init_script /etc/init.d/redis

2、修改/etc/init.d/redis 文件。修改redis安裝的相關(guān)文件安裝目錄

#!/bin/sh
# chkconfig: 2345 10 90
# description: Start and Stop redis

# Simple Redis init.d script conceived to work on Linux systems
# as it does use of the /proc filesystem.

REDISPORT=6379
EXEC=/usr/local/redis/bin/redis-server
CLIEXEC=/usr/local/redis/bin/redis-cli

PIDFILE=/var/run/redis_${REDISPORT}.pid
CONF="/usr/local/redis/etc/redis.conf"

redis設(shè)置開機自啟動的方法

#!/bin/sh
# chkconfig: 2345 10 90
# description: Start and Stop redis

備注:

上面的注釋的意思是,redis服務(wù)必須在運行級2,3,4,5下被啟動或關(guān)閉,啟動的優(yōu)先級是90,關(guān)閉的優(yōu)先級是10。從redis 安裝目錄中拷貝過來,可能沒有,需要添加 上去; 否則 chkconfig 命令 會失敗;

3、開機啟動設(shè)置,執(zhí)行一下命令:

  • 添加redis服務(wù):

       

chkconfig --add redis
  • 設(shè)為開機啟動 :

       

chkconfig redis on
  • 常用命令

       

service redis start
service redis stop

感謝各位的閱讀!關(guān)于redis設(shè)置開機自啟動的方法就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,讓大家可以學(xué)到更多知識。如果覺得文章不錯,可以把它分享出去讓更多的人看到吧!

本文名稱:redis設(shè)置開機自啟動的方法
瀏覽地址:http://bm7419.com/article30/pceipo.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供做網(wǎng)站、微信公眾號、域名注冊、小程序開發(fā)、面包屑導(dǎo)航、網(wǎng)站收錄

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

外貿(mào)網(wǎng)站建設(shè)