redis設定檔redis.conf的詳細說明

來源:互聯網
上載者:User
# Redis 設定檔

# 當配置中需要配置記憶體大小時,可以使用 1k, 5GB, 4M 等類似的格式,其轉換方式如下(不區分大小寫)
#
# 1k => 
1000 bytes
# 1kb => 1024 bytes
# 1m => 1000000 bytes
# 1mb => 
1024*1024 bytes
# 1g => 1000000000 bytes
# 1gb => 1024*1024*1024 
bytes
#
# 記憶體配置大小寫是一樣的.比如 1gb 1Gb 1GB 1gB

# daemonize no 預設情況下,redis不是在後台啟動並執行,如果需要在後台運行,把該項的值更改為yes
daemonize 
yes

# 當redis在後台啟動並執行時候,Redis預設會把pid檔案放在/var/run/redis.pid,你可以配置到其他地址。

當運行多個redis服務時,需要指定不同的pid檔案和連接埠
pidfile /var/run/redis.pid

# 指定redis啟動並執行連接埠,預設是6379
port 6379

# 指定redis只接收來自於該IP地址的請求,如果不進行設定,那麼將處理所有請求,
# 在生產環境中最好設定該項
# bind 
127.0.0.1

# Specify the path for the unix socket that will be used to listen for

incoming connections. There is no default, so Redis will not listen
# on a 
unix socket when not specified.
#
# unixsocket /tmp/redis.sock

unixsocketperm 755

# 設定用戶端串連時的逾時時間,單位為秒。當用戶端在這段時間內沒有發出任何指令,那麼關閉該串連
# 0是關閉此設定
timeout 
0

# 指定日誌記錄層級
# Redis總共支援四個層級:debug、verbose、notice、warning,預設為verbose

debug  記錄很多資訊,用於開發與測試
# varbose 有用的資訊,不像debug會記錄那麼多

notice 普通的verbose,常用於生產環境
# warning 只有非常重要或者嚴重的資訊會記錄到日誌
loglevel 
debug

# 配置log檔案地址
# 預設值為stdout,標準輸出,若後台模式會輸出到/dev/null
#logfile 
stdout
logfile /var/log/redis/redis.log

# To enable logging to the system logger, just set 'syslog-enabled' to 
yes,
# and optionally update the other syslog parameters to suit your 
needs.
# syslog-enabled no

# Specify the syslog identity.
# syslog-ident redis

# Specify the syslog facility.  Must be USER or between LOCAL0-LOCAL7.

syslog-facility local0

# 可用資料庫數
# 預設值為16,預設資料庫為0,資料庫範圍在0-(database-1)之間
databases 16

################################ 快照  
#################################
#
# 儲存資料到磁碟,格式如下:
#
#   save 
<seconds> <changes>
#
#   
指出在多長時間內,有多少次更新操作,就將資料同步到資料檔案rdb。
#   相當於條件觸發抓取快照,這個可以多個條件配合
#   
#   
比如預設設定檔中的設定,就設定了三個條件
#
#   save 900 1  900秒內至少有1個key被改變
#   save 300 
10  300秒內至少有300個key被改變
#   save 60 10000  60秒內至少有10000個key被改變
相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.