iT邦幫忙

2021 iThome 鐵人賽

DAY 5
0
Software Development

Redis還在學系列 第 5

Day5 Redis組態檔設定-GENERAL 2

Redis.config

GENERAL

  • daemonize

是否要用daemon方式啟動Redis Server.

https://ithelp.ithome.com.tw/upload/images/20210920/2011165886WzHBc4ES.png

# 預設
daemonize no

# yes 需要搭配pidfile將process寫入並在背景方式啟動Redis Server
# no 在前景終端機模式下啟動Redis Server,當終端機結束時會一併關閉Redis Server
daemonize yes
  • pidfile

搭配上面daemon啟動方式使用,會在啟動時寫入指定路徑檔案,關閉服務時則刪除.

https://ithelp.ithome.com.tw/upload/images/20210920/20111658dDZB3Yaa9D.png

# 預設
pidfile /var/run/redis_6379.pid
  • supervised

啟動Redis Server 可以透過upstart or systmed方式進行管理,需要特別注意此方式只會提供Process is Ready的訊號,不包含Ping.

https://ithelp.ithome.com.tw/upload/images/20210920/20111658MMLTNMJeni.png

# 預設
supervised no
  • loglevel

Redis Server記錄日誌資訊的等級.

https://ithelp.ithome.com.tw/upload/images/20210920/20111658DjcLNjKYFw.png

# 預設
loglevel notice

# debug (越詳細)
# verbose
# notice
# warning (只記錄錯誤或警告)
loglevel debug
  • logfile

當設定用daemon模式啟動時,則需要提供路徑存放日誌,反之則會輸出在啟動的終端機上.

https://ithelp.ithome.com.tw/upload/images/20210920/20111658MR4XFZtA9S.png

# 預設
logfile ""

# 指定路徑
logfile /home/redis/redis.log
  • syslog-ebabled no

是否需要把Redis Server日誌寫入到OS系統日誌中.

https://ithelp.ithome.com.tw/upload/images/20210920/20111658CQPWEaMJxz.png

# 預設
syslog-enabled no
  • syslog-ident

寫入Redis Server日誌到OS系統日誌的標記.

https://ithelp.ithome.com.tw/upload/images/20210920/20111658ATCza7DWMh.png

# 預設
syslog-ident redis
  • syslog-facility

寫入Redis Server日誌到OS系統日誌的裝置或使用者.

https://ithelp.ithome.com.tw/upload/images/20210920/20111658HJtxNU6xnE.png

# 
syslog-facility local0
  • crash-log-enabled

Redis Server崩潰日誌,如果需要查詢問題則需要額外開啟.

https://ithelp.ithome.com.tw/upload/images/20210920/20111658wWHQKtsd6V.png

# 預設
crash-log-enabled no
  • crash-memcheck-enabled

當Redis Server崩潰時,快速檢查memory,需要額外花費時間.

https://ithelp.ithome.com.tw/upload/images/20210920/20111658c3SBLMMSak.png

# 預設
crash-memcheck-enabled no
  • databases

設定資料庫總數,實際使用上可以透過select來選取欲操作的資料庫.

https://ithelp.ithome.com.tw/upload/images/20210920/20111658oJwPuorZGK.png

# 預設
databases 16

# 設定為1
databases 1
  • always-show-logo

是否都要顯示Redis logo.

https://ithelp.ithome.com.tw/upload/images/20210920/20111658U64OoUs77S.png

# 預設
always-show-logo no

  • set-proc-title

預設在Process管理中可以看到相關Redis Server Process資訊.

https://ithelp.ithome.com.tw/upload/images/20210920/20111658KHVJERGOpY.png

# 預設
set-proc-title yes
  • proc-title-template

Redis Server process所顯示的內容格式.

https://ithelp.ithome.com.tw/upload/images/20210920/20111658hvcC0E6XUn.png

# 預設
proc-title-template "{title} {listen-addr} {server-mode}"

上一篇
Day4 Redis組態檔設定-GENERAL
下一篇
Day6 Redis組態檔設定-SNAPSHOT
系列文
Redis還在學30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言