You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1.7 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

安装Redis

cd /usr/local
rz -be 
选择redis-5.0.14.tar.gz

tar -zxvf redis-5.0.14.tar.gz

rm -rf redis-5.0.14.tar.gz

cd /usr/local/redis-5.0.14
yum install make gcc -y
make MALLOC=libc
make PREFIX=/usr/local/redis install 
cp /usr/local/redis-5.0.14/redis.conf  /usr/local/redis/bin
rm -rf /usr/local/redis-5.0.14/

修改配置文件:

redis.conf

bind 0.0.0.0
port 6379
tcp-backlog 511
timeout 0
tcp-keepalive 300
daemonize yes
supervised no
pidfile /var/run/redis_6379.pid
loglevel notice
logfile ""
databases 16
always-show-logo yes
save 900 1
save 300 10
save 60 10000
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename dump.rdb
dir ./

replica-serve-stale-data yes
replica-read-only yes
repl-diskless-sync no
repl-diskless-sync-delay 5
repl-disable-tcp-nodelay no
replica-priority 100


requirepass ylt#redis


lazyfree-lazy-eviction no
lazyfree-lazy-expire no
lazyfree-lazy-server-del no
replica-lazy-flush no


appendonly no
appendfsync everysec
aof-load-truncated yes
aof-use-rdb-preamble yes
lua-time-limit 5000

slowlog-log-slower-than 10000
slowlog-max-len 128
latency-monitor-threshold 0

notify-keyspace-events ""

hash-max-ziplist-entries 512
hash-max-ziplist-value 64
list-max-ziplist-size -2
list-compress-depth 0
set-max-intset-entries 512
zset-max-ziplist-entries 128
zset-max-ziplist-value 64

hll-sparse-max-bytes 3000

stream-node-max-bytes 4096
stream-node-max-entries 100

activerehashing yes

hz 10
dynamic-hz yes
aof-rewrite-incremental-fsync yes

rdb-save-incremental-fsync yes

启动

cd /usr/local/redis/bin
./redis-server ./redis.conf &