redis中重啟的方法-創(chuàng)新互聯(lián)

這篇文章主要介紹了redis中重啟的方法,具有一定借鑒價(jià)值,需要的朋友可以參考下。希望大家閱讀完這篇文章后大有收獲。下面讓小編帶著大家一起了解一下。

創(chuàng)新互聯(lián)是一家專注于成都網(wǎng)站設(shè)計(jì)、網(wǎng)站制作與策劃設(shè)計(jì),英吉沙網(wǎng)站建設(shè)哪家好?創(chuàng)新互聯(lián)做網(wǎng)站,專注于網(wǎng)站建設(shè)10多年,網(wǎng)設(shè)計(jì)領(lǐng)域的專業(yè)建站公司;建站業(yè)務(wù)涵蓋:英吉沙等地區(qū)。英吉沙做網(wǎng)站價(jià)格咨詢:028-86922220

redis如何重啟?

正常啟動(dòng)命令:

redis-server  # 啟動(dòng)redis服務(wù)端
[1709] 28 Feb 06:45:08.346 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
[1709] 28 Feb 06:45:08.348 * Max number of open files set to 10032
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 2.8.4 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                   
 (    '      ,       .-`  | `,    )     Running in stand alone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 1709
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           http://redis.io        
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'                                               
[1709] 28 Feb 06:45:08.349 # Server started, Redis version 2.8.4
[1709] 28 Feb 06:45:08.349 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
[1709] 28 Feb 06:45:08.349 * The server is now ready to accept connections on port 6379

啟動(dòng)redis客戶端

redis-cli 
127.0.0.1:6379>

如果是用apt-get或者yum install安裝的redis,可以直接通過(guò)下面的命令停止/啟動(dòng)/重啟redis

/etc/init.d/redis-server stop
/etc/init.d/redis-server start
/etc/init.d/redis-server restart

注意:使用/etc/init.d/redis-server start 方法啟動(dòng)redis,那么在那個(gè)目錄下啟動(dòng)redis,那么redis的備份文件就在那個(gè)目錄下。

如在/user/bin/redis/目錄下輸入命令/etc/init.d/redis-server start  ,那么redis備份文件就在/user/bin/redis/dump.rdb

如果是通過(guò)源碼安裝的redis,則可以通過(guò)redis的客戶端程序redis-cli的shutdown命令來(lái)重啟redis

redis-cli -h 127.0.0.1 -p 6379 shutdown

如果上述方式都沒(méi)有成功停止redis,則可以使用終極武器 kill -9

感謝你能夠認(rèn)真閱讀完這篇文章,希望小編分享redis中重啟的方法內(nèi)容對(duì)大家有幫助,同時(shí)也希望大家多多支持創(chuàng)新互聯(lián)建站,關(guān)注創(chuàng)新互聯(lián)網(wǎng)站制作公司行業(yè)資訊頻道,遇到問(wèn)題就找創(chuàng)新互聯(lián)建站,詳細(xì)的解決方法等著你來(lái)學(xué)習(xí)!

文章題目:redis中重啟的方法-創(chuàng)新互聯(lián)
瀏覽路徑:http://muchs.cn/article6/dhgdig.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站排名、商城網(wǎng)站、動(dòng)態(tài)網(wǎng)站虛擬主機(jī)、外貿(mào)建站Google

廣告

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

外貿(mào)網(wǎng)站制作