這篇文章主要介紹了redis中重啟的方法,具有一定借鑒價值,需要的朋友可以參考下。希望大家閱讀完這篇文章后大有收獲。下面讓小編帶著大家一起了解一下。
redis如何重啟?
正常啟動命令:
redis-server # 啟動redis服務端 [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
啟動redis客戶端
redis-cli 127.0.0.1:6379>
如果是用apt-get或者yum install安裝的redis,可以直接通過下面的命令停止/啟動/重啟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 方法啟動redis,那么在那個目錄下啟動redis,那么redis的備份文件就在那個目錄下。
如在/user/bin/redis/目錄下輸入命令/etc/init.d/redis-server start ,那么redis備份文件就在/user/bin/redis/dump.rdb
如果是通過源碼安裝的redis,則可以通過redis的客戶端程序redis-cli的shutdown命令來重啟redis
redis-cli -h 127.0.0.1 -p 6379 shutdown
如果上述方式都沒有成功停止redis,則可以使用終極武器 kill -9
感謝你能夠認真閱讀完這篇文章,希望小編分享redis中重啟的方法內容對大家有幫助,同時也希望大家多多支持創(chuàng)新互聯建站,關注創(chuàng)新互聯網站制作公司行業(yè)資訊頻道,遇到問題就找創(chuàng)新互聯建站,詳細的解決方法等著你來學習!
文章題目:redis中重啟的方法-創(chuàng)新互聯
瀏覽路徑:http://chinadenli.net/article6/dhgdig.html
成都網站建設公司_創(chuàng)新互聯,為您提供網站排名、商城網站、動態(tài)網站、虛擬主機、外貿建站、Google
聲明:本網站發(fā)布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯