Redis-cluster
#关闭RDB防止fork进程的内存溢出问题
Save ""
Appendonly=yes
#防止某个节点挂掉, the whole cluster hangs off the question
Cluster-require-full-coverage No
#设置最大内存
MaxMemory
11453246122
11453246122
28991029248
27*1024*1024*1024
#日志
LogFile "./redis.log"
Bind 0.0.0.0
#防止因为磁盘同步, the situation of the card-falling process appears
No-appendfsync-on-rewrite Yes
Kernel modification, if not open firewall can not set this
Net.nf_conntrack_max = 1648576
This is used to prevent memory applications from being stuck.
Vm.overcommit_memory=1
echo Never >/sys/kernel/mm/transparent_hugepage/enabled
Write rc.local at the same time
There are three ways to modify kernel parameters, but to have root privileges:
(1) Edit/etc/sysctl.conf, change Vm.overcommit_memory=1, and sysctl-p make the configuration file effective
(2) Sysctl Vm.overcommit_memory=1
(3) echo 1 >/proc/sys/vm/overcommit_memory
The maximum number of connections to change
net.core.somaxconn= 1024
#设置内存超出策略
Not set by default
The
#BGREWRITEAOF this command to rewrite AOF because the AOF has been incrementally updated for a long time, but the memory may not be so large, so you can override it with this command