1. <ul id="0c1fb"></ul>

      <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
      <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区

      RELATEED CONSULTING
      相關(guān)咨詢
      選擇下列產(chǎn)品馬上在線溝通
      服務(wù)時(shí)間:8:30-17:00
      你可能遇到了下面的問題
      關(guān)閉右側(cè)工具欄

      新聞中心

      這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
      如何啟動(dòng)redis

      小編給大家分享一下如何啟動(dòng)redis,相信大部分人都還不怎么了解,因此分享這篇文章給大家參考一下,希望大家閱讀完這篇文章后大有收獲,下面讓我們一起去了解一下吧!

      成都創(chuàng)新互聯(lián)專注于仁化網(wǎng)站建設(shè)服務(wù)及定制,我們擁有豐富的企業(yè)做網(wǎng)站經(jīng)驗(yàn)。 熱誠為您提供仁化營銷型網(wǎng)站建設(shè),仁化網(wǎng)站制作、仁化網(wǎng)頁設(shè)計(jì)、仁化網(wǎng)站官網(wǎng)定制、成都微信小程序服務(wù),打造仁化網(wǎng)絡(luò)公司原創(chuàng)品牌,更為您提供仁化網(wǎng)站排名全網(wǎng)營銷落地服務(wù)。

      redis的啟動(dòng)方式

      1.直接啟動(dòng)

      進(jìn)入redis根目錄,執(zhí)行命令:

       #加上‘&’號(hào)使redis以后臺(tái)程序方式運(yùn)行
      ./redis-server &

      或者

      修改redis.conf參數(shù)

      daemonize yes

      2.通過指定配置文件啟動(dòng)

      可以為redis服務(wù)啟動(dòng)指定配置文件,例如配置為/etc/redis/6379.conf

      進(jìn)入redis根目錄,輸入命令:

      ./redis-server /etc/redis/6379.conf
        #如果更改了端口,使用`redis-cli`客戶端連接時(shí),也需要指定端口,例如:
      redis-cli -p 6380

      3.使用redis啟動(dòng)腳本設(shè)置開機(jī)自啟動(dòng)

      啟動(dòng)腳本 redis_init_script 位于位于Redis的 /utils/ 目錄下,redis_init_script腳本代碼如下:

      #!/bin/sh
      #
      # Simple Redis init.d script conceived to work on Linux systems
      # as it does use of the /proc filesystem.
       
      #redis服務(wù)器監(jiān)聽的端口
      REDISPORT=6379
       
      #服務(wù)端所處位置
      EXEC=/usr/local/bin/redis-server
       
      #客戶端位置
      CLIEXEC=/usr/local/bin/redis-cli
       
      #redis的PID文件位置,需要修改
      PIDFILE=/var/run/redis_${REDISPORT}.pid
       
      #redis的配置文件位置,需將${REDISPORT}修改為文件名
      CONF="/etc/redis/${REDISPORT}.conf"
       
      case "$1" in
          start)
              if [ -f $PIDFILE ]
              then
                      echo "$PIDFILE exists, process is already running or crashed"
              else
                      echo "Starting Redis server..."
                      $EXEC $CONF
              fi
              ;;
          stop)
              if [ ! -f $PIDFILE ]
              then
                      echo "$PIDFILE does not exist, process is not running"
              else
                      PID=$(cat $PIDFILE)
                      echo "Stopping ..."
                      $CLIEXEC -p $REDISPORT shutdown
                      while [ -x /proc/${PID} ]
                      do
                          echo "Waiting for Redis to shutdown ..."
                          sleep 1
                      done
                      echo "Redis stopped"
              fi
              ;;
          *)
              echo "Please use start or stop as first argument"
              ;;
      esac

      根據(jù)啟動(dòng)腳本,將修改好的配置文件復(fù)制到指定目錄下,用root用戶進(jìn)行操作:

      mkdir /etc/redis
      cp redis.conf /etc/redis/6379.conf

      將啟動(dòng)腳本復(fù)制到/etc/init.d目錄下,本例將啟動(dòng)腳本命名為redisd(通常都以d結(jié)尾表示是后臺(tái)自啟動(dòng)服務(wù))。

      cp redis_init_script /etc/init.d/redisd

      設(shè)置為開機(jī)自啟動(dòng),直接配置開啟自啟動(dòng) chkconfig redisd on 發(fā)現(xiàn)錯(cuò)誤: service redisd does not support chkconfig

      解決辦法,在啟動(dòng)腳本開頭添加如下注釋來修改運(yùn)行級(jí)別:

      #!/bin/sh
      # chkconfig:   2345 90 10

      再設(shè)置即可

      #設(shè)置為開機(jī)自啟動(dòng)服務(wù)器
      chkconfig redisd on
      #打開服務(wù)
      service redisd start
      #關(guān)閉服務(wù)
      service redisd stop

      以上是如何啟動(dòng)redis的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對(duì)大家有所幫助,如果還想學(xué)習(xí)更多知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!


      網(wǎng)站欄目:如何啟動(dòng)redis
      當(dāng)前URL:http://www.ef60e0e.cn/article/jdgedd.html
      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区
      1. <ul id="0c1fb"></ul>

        <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
        <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

        宁海县| 德令哈市| 广宁县| 新民市| 景洪市| 汨罗市| 宁乡县| 林甸县| 平顶山市| 兰考县| 黎城县| 富顺县| 邓州市| 姜堰市| 江川县| 宜川县| 弥勒县| 云林县| 晋州市| 东兰县| 偏关县| 英德市| 禹州市| 吉木萨尔县| 岗巴县| 桐乡市| 东宁县| 凤山市| 阜康市| 西青区| 江山市| 栖霞市| 天门市| 宁蒗| 上杭县| 运城市| 开封县| 三明市| 易门县| 安仁县| 邛崃市|