Redis6 最新版下载:Download 6.2.6 (redis.io)
系统版本:CentOS Linux release 8.5.2111
# tar -xzf redis-6.2.6.tar.gz
# rm -f redis-6.2.6.tar.gz
# mv redis-6.2.6 redis
# cd redis
# make // redis6 需要GCC高版本支持,建议在CentOS8系统上安装运行
# make test
# make install // 默认安装到/usr/local/bin目录下
redis.conf
bind 192.168.223.85 -::1protected-mode no
port 16379
tcp-backlog 511
timeout 0
tcp-keepalive 300
daemonize yes
pidfile /var/run/redis_16379.pid
loglevel notice
logfile /var/log/redis_16379.log
databases 16
always-show-logo no
set-proc-title yes
proc-title-template "{title} {listen-addr} {server-mode}"
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename redis_16379.rdb
rdb-del-sync-files no
dir /data/redis
replica-serve-stale-data yes
replica-read-only yes
repl-diskless-sync no
repl-diskless-sync-delay 5
repl-diskless-load disabled
repl-disable-tcp-nodelay no
replica-priority 100
acllog-max-len 128
requirepass YOURPASSWORD
maxclients 10000
maxmemory-policy volatile-lru
lazyfree-lazy-eviction no
lazyfree-lazy-expire no
lazyfree-lazy-server-del no
replica-lazy-flush no
lazyfree-lazy-user-del no
lazyfree-lazy-user-flush noio-threads 3
oom-score-adj no
oom-score-adj-values 0 200 800disable-thp yes
appendonly no
appendfilename "appendonly.aof"
appendfsync everysec
no-appendfsync-on-rewrite no
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mbaof-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 64list-max-ziplist-size -2
list-compress-depth 0
set-max-intset-entries 512
zset-max-ziplist-entries 128
zset-max-ziplist-value 64hll-sparse-max-bytes 3000
stream-node-max-bytes 4096
stream-node-max-entries 100activerehashing yes
client-output-buffer-limit normal 0 0 0
client-output-buffer-limit replica 256mb 64mb 60
client-output-buffer-limit pubsub 32mb 8mb 60hz 10
dynamic-hz yes
aof-rewrite-incremental-fsync yes
rdb-save-incremental-fsync yes
jemalloc-bg-thread yes
启动redis
# redis-server /data/redis/redis.conf
# ps -ef| grep redis| grep -v grep
root 16397 1 0 19:51 ? 00:00:00 redis-server 192.168.223.85:16379
redis-cli 连接测试
# redis-cli -h 192.168.223.85 -p 16379
192.168.223.85:16379> auth YOURPASSWORD
OK
192.168.223.85:16379> set name cnskylee
OK
192.168.223.85:16379> get name
"cnskylee"
192.168.223.85:16379>
redis-cli停redis
# redis-cli -h 192.168.223.85 -p 16379
192.168.223.85:16379> auth YOURPASSWORD
OK
192.168.223.85:16379> shutdown
not connected> exit