這個zip包,同時在zip壓縮包裡面有一片文章windows service documentation.docx
running redis as a service
if you installed redis using the msi package, then redis was already
installed as a windows service. nothing further to do. if you would
like to change its settings, you can update the redis.windows-service.
conf file and then restart the redis service (run -> services.msc ->
redis -> restart).
if you did not install redis using the msi package, then you still
run redis as a windows service by following these instructions:
這是我採用msi包安裝後的服務
可以開啟redis-cli.exe客戶端包,進行簡單的操作。目前多半採用redis desktop manager這個桌面redis客戶端軟體進行操作,比較方便,redis預設資料庫從db0到db15,一般進去預設使用db0資料庫。
下面的這篇文章就是採用的命令列形式,個人感覺還是msi比較方便,下面的文章僅作參考
直接在上圖的目錄開啟命令視窗,執行:
redis-server redis
.windows
.conf
--
maxmemory命令限制redis的記憶體:
redis第二種方法就是修改配置檔案-server redis
.windows
.conf
--maxmemory
200m
redis.windows.conf
:
maxmemory注意單位是位元組,改完後如下:209715200
之後再執行redis-server redis.windows.conf
就可以啟動了:
但是問題又來了,關閉cmd視窗就會關閉redis,難道伺服器上要一直開著嗎?這顯然是不科學的,下面看怎麼在伺服器上部署。
其實redis是可以安裝成windows服務的,開機自啟動,命令如下:
redis安裝完之後,就可看到redis已經作為windows服務了:-server
--service
-install redis
.windows
.conf
但是安裝好之後,redis並沒有啟動,啟動命令如下:
redis停止命令:-server
--service
-start
redis還可以安裝多個例項-server
--service
-stop
redis解除安裝命令:-server
--service
-install
–service
-name redisservice1
–port
10001
redis
-server
--service
-start
–service
-name redisservice1
redis
-server
--service
-install
–service
-name redisservice2
–port
10002
redis
-server
--service
-start
–service
-name redisservice2
redis
-server
--service
-install
–service
-name redisservice3
–port
10003
redis
-server
--service
-start
–service
-name redisservice3
redis-server
--service
-uninstall
在windows上部署使用Redis
這兩天在重新做公司內網首頁,資訊都是從別的系統獲取的,產品原來打算直接上靜態頁,jsonp非同步取資料。但是一來jsonp比較坑 一直不喜歡 二來整個頁面的資料都非同步獲取的話,剛剛開啟頁面的時候會空白一片,體驗極其差。所以決定用node.js express redis簡單搞下。今天早晨一直在折騰...
在windows上部署使用Redis
直接在上圖的目錄開啟命令視窗,執行 redis server redis windows conf redis server redis windows conf maxmemory 200m 第二種方法就是修改配置檔案redis.windows.conf maxmemory 209715200 注...
在windows上部署使用Redis
這兩天在重新做公司內網首頁,資訊都是從別的系統獲取的,產品原來打算直接上靜態頁,jsonp非同步取資料。但是一來jsonp比較坑 一直不喜歡 二來整個頁面的資料都非同步獲取的話,剛剛開啟頁面的時候會空白一片,體驗極其差。所以決定用node.js express redis簡單搞下。今天早晨一直在折騰...