標籤:comm compress stdout slave div lis nts min 下載
首先我們下載軟體包到指定的目錄下
tar -zxvf redis-2.8.19.tar.gz cd redis-2.8.19 makemake PREFIX=/usr/local/redis install
mkdir /usr/local/redis/etc/cp redis.conf /usr/local/redis/etc/ cd /usr/local/redis/bin/cp redis-benchmark redis-cli redis-server /usr/bin/
vim /usr/local/redis/etc/redis.conf# 修改一下配置# redis以守護進程的方式運行# no表示不以守護進程的方式運行(會佔用一個終端) daemonize yes# 用戶端閑置多長時間後中斷連線,預設為0關閉此功能 timeout 300# 設定redis記錄層級,預設層級:notice loglevel verbose# 設定記錄檔的輸出方式,如果以守護進程的方式運行redis 預設:"" # 並且日誌輸出設定為stdout,那麼日誌資訊就輸出到/dev/null裡面去了 logfile stdout
我們現在來看一下設定檔
6379.conf
daemonize yespidfile /var/run/redis_6379.pidport 6379tcp-backlog 511timeout 0tcp-keepalive 0loglevel noticelogfile /usr/local/redis/logs/redis_6379.logdatabases 16save 900 1save 300 10save 60 10000stop-writes-on-bgsave-error yesrdbcompression yesrdbchecksum yesdbfilename dump.rdbdir /usr/local/redis/6379slave-serve-stale-data yesslave-read-only yesrepl-diskless-sync norepl-diskless-sync-delay 5repl-disable-tcp-nodelay noslave-priority 100appendonly noappendfilename "appendonly.aof"appendfsync everysecno-appendfsync-on-rewrite noauto-aof-rewrite-percentage 100auto-aof-rewrite-min-size 64mbaof-load-truncated yeslua-time-limit 5000slowlog-log-slower-than 10000slowlog-max-len 128latency-monitor-threshold 0notify-keyspace-events ""hash-max-ziplist-entries 512hash-max-ziplist-value 64list-max-ziplist-entries 512list-max-ziplist-value 64set-max-intset-entries 512zset-max-ziplist-entries 128zset-max-ziplist-value 64hll-sparse-max-bytes 3000activerehashing yesclient-output-buffer-limit normal 0 0 0client-output-buffer-limit slave 256mb 64mb 60client-output-buffer-limit pubsub 32mb 8mb 60hz 10aof-rewrite-incremental-fsync yes
6380.conf
daemonize yespidfile /var/run/redis_6380.pidport 6380tcp-backlog 511timeout 0tcp-keepalive 0loglevel noticelogfile /usr/local/redis/logs/redis_6380.logdatabases 16save 900 1save 300 10save 60 10000stop-writes-on-bgsave-error yesrdbcompression yesrdbchecksum yesdbfilename dump.rdbdir /usr/local/redis/6380slave-serve-stale-data yesslave-read-only yesrepl-diskless-sync norepl-diskless-sync-delay 5repl-disable-tcp-nodelay noslave-priority 100appendonly noappendfilename "appendonly.aof"appendfsync everysecno-appendfsync-on-rewrite noauto-aof-rewrite-percentage 100auto-aof-rewrite-min-size 64mbaof-load-truncated yeslua-time-limit 5000slowlog-log-slower-than 10000slowlog-max-len 128latency-monitor-threshold 0notify-keyspace-events ""hash-max-ziplist-entries 512hash-max-ziplist-value 64list-max-ziplist-entries 512list-max-ziplist-value 64set-max-intset-entries 512zset-max-ziplist-entries 128zset-max-ziplist-value 64hll-sparse-max-bytes 3000activerehashing yesclient-output-buffer-limit normal 0 0 0client-output-buffer-limit slave 256mb 64mb 60client-output-buffer-limit pubsub 32mb 8mb 60hz 10aof-rewrite-incremental-fsync yes
參考文章:1190000003084917
redis 的源碼編譯安裝