日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > windows >内容正文

windows

windows下redis安装,注册成系统服务

發布時間:2024/9/19 windows 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 windows下redis安装,注册成系统服务 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

前言

  • Redis-x64-3.0.504
  • win 7
  • 目標:安裝redis、redis 注冊為系統服務,及異常處理

下載

https://github.com/microsoftarchive/redis
https://github.com/microsoftarchive/redis/releases

https://github.com/ServiceStack/redis-windows
https://github.com/ServiceStack/redis-windows/tree/master/downloads

這里使用:https://github.com/microsoftarchive/redis/releases/download/win-3.0.504/Redis-x64-3.0.504.zip

解壓

解壓到目錄D:\sde\Redis\Redis-x64-3.0.504

命令行啟動

D:\sde\Redis\Redis-x64-3.0.504> redis-server redis.windows.conf

測試redis

輸入ping指令后,redis輸出PONG,則表示redis啟動正常。

注冊成系統服務

注冊成系統服務的目的是方便。
解壓后目錄中自帶文檔(《Windows Service Documentation.docx》)介紹如何注冊成為系統服務。
注冊服務命令:

D:\sde\Redis\Redis-x64-3.0.504> redis-server --service-install redis.windows-service.conf --loglevel verbose

啟動服務命令:

D:\sde\Redis\Redis-x64-3.0.504> redis-server --service-start

結束服務命令:

D:\sde\Redis\Redis-x64-3.0.504> redis-server --service-stop

刪除服務命令:

D:\sde\Redis\Redis-x64-3.0.504> redis-server --service-uninstall

在任何目錄下都可以用的啟動服務命令:

D:\>net start redis Redis 服務正在啟動 . Redis 服務已經啟動成功。

在任何目錄下都可以用的結束服務命令:

D:\>net stop redis Redis 服務正在停止. Redis 服務已成功停止。

服務管理器中操作redis服務:

其它

[11632] 11 Oct 09:54:29.663 # Redis service failed to start.


默認情況下,redis.windows-service.conf配置文件中開啟了日志文件,如下:

# Specify the log file name. Also 'stdout' can be used to force # Redis to log on the standard output. logfile "Logs/redis_log.txt"# To enable logging to the Windows EventLog, just set 'syslog-enabled' to # yes, and optionally update the other syslog parameters to suit your needs. # If Redis is installed and launched as a Windows Service, this will # automatically be enabled. syslog-enabled yes# Specify the source name of the events in the Windows Application log. syslog-ident redis

日志目錄Logsredis不能自動創建,需要啟動前手動創建Logs目錄。

redis注冊服務成功后,再執行刪除服務。發現服務管理器中的服務未被刪除,且變為禁用狀態

服務管理器打開狀態下,刪除服務時,會出現這個情況。重開服務管理器后就好了。

redis.windows.conf、redis.windows-service.conf該用哪個?

命令行啟動時,用redis.windows.conf。
注冊服務時,用redis.windows-service.conf。我看好多文章注冊服務也用redis.windows.conf,那是不合適的。因為redis.windows-service.conf中開啟了日志文件。注冊服務啟動后,沒了控制臺輸出,要開日志文件的。

總結

以上是生活随笔為你收集整理的windows下redis安装,注册成系统服务的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。