Skip to content

Commit 14de191

Browse files
authored
Update Redis-Install-And-Settings.md
1 parent 180b200 commit 14de191

File tree

1 file changed

+64
-2
lines changed

1 file changed

+64
-2
lines changed

Redis-Install-And-Settings.md

Lines changed: 64 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
- 重启 iptables:`service iptables restart`
3737

3838

39-
## Redis 配置
39+
## Redis-3.0.7 配置
4040

4141
- 编辑配置文件:`vim /etc/redis.conf`
4242
- Redis 默认的配置文件内容:
@@ -95,6 +95,68 @@ hz 10
9595
aof-rewrite-incremental-fsync yes
9696
```
9797

98+
99+
## Redis-3.2.8 配置
100+
101+
- 编辑配置文件:`vim /etc/redis.conf`
102+
- Redis 默认的配置文件内容:
103+
104+
``` ini
105+
# 默认绑定是:127.0.0.1,这样就只能本机才能连上,为了让所有机子连上,这里需要改为:0.0.0.0
106+
bind 0.0.0.0
107+
protected-mode yes
108+
port 6379
109+
tcp-backlog 511
110+
timeout 0
111+
tcp-keepalive 300
112+
daemonize yes
113+
supervised no
114+
pidfile /var/run/redis_6379.pid
115+
loglevel notice
116+
logfile ""
117+
databases 16
118+
save 900 1
119+
save 300 10
120+
save 60 10000
121+
stop-writes-on-bgsave-error yes
122+
rdbcompression yes
123+
rdbchecksum yes
124+
dbfilename dump.rdb
125+
dir ./
126+
slave-serve-stale-data yes
127+
slave-read-only yes
128+
repl-diskless-sync no
129+
repl-diskless-sync-delay 5
130+
repl-disable-tcp-nodelay no
131+
slave-priority 100
132+
appendonly no
133+
appendfilename "appendonly.aof"
134+
appendfsync everysec
135+
no-appendfsync-on-rewrite no
136+
auto-aof-rewrite-percentage 100
137+
auto-aof-rewrite-min-size 64mb
138+
aof-load-truncated yes
139+
lua-time-limit 5000
140+
slowlog-log-slower-than 10000
141+
slowlog-max-len 128
142+
latency-monitor-threshold 0
143+
notify-keyspace-events ""
144+
hash-max-ziplist-entries 512
145+
hash-max-ziplist-value 64
146+
list-max-ziplist-size -2
147+
list-compress-depth 0
148+
set-max-intset-entries 512
149+
zset-max-ziplist-entries 128
150+
zset-max-ziplist-value 64
151+
hll-sparse-max-bytes 3000
152+
activerehashing yes
153+
client-output-buffer-limit normal 0 0 0
154+
client-output-buffer-limit slave 256mb 64mb 60
155+
client-output-buffer-limit pubsub 32mb 8mb 60
156+
hz 10
157+
aof-rewrite-incremental-fsync yes
158+
```
159+
98160
## 设置 Redis 请求密码
99161

100162
- 打开 `vim /etc/redis.conf` 配置文件,找到默认是被注释的这一行:`# requirepass foobared`
@@ -291,4 +353,4 @@ esac
291353
- <http://yanshisan.blog.51cto.com/7879234/1377992>
292354
- <https://segmentfault.com/a/1190000002685224>
293355
- <http://itbilu.com/linux/management/4kB2ninp.html>
294-
- <http://keenwon.com/1335.html>
356+
- <http://keenwon.com/1335.html>

0 commit comments

Comments
 (0)