目的
搭建 redis server
提供 falcon-alarm 使用
软件安装
yum install -y epel-release
yum install -y redis
mkdir /apps/dat/redis_data
配置
/etc/redis.conf
daemonize yes
pidfile "/var/run/redis/redis.pid"
port 6379
tcp-backlog 511
timeout 0
tcp-keepalive 60
loglevel notice
logfile "/var/log/redis/redis.log"
databases 16
unixsocket /var/run/redis/redis.sock
unixsocketperm 766
stop-writes-on-bgsave-error no
rdbcompression yes
rdbchecksum no
dbfilename "dump.rdb"
dir "/apps/dat/redis_data"
slave-serve-stale-data yes
slave-read-only yes
repl-diskless-sync no
repl-diskless-sync-delay 5
repl-disable-tcp-nodelay no
slave-priority 100
maxmemory 2gb
appendonly no
appendfilename "appendonly.aof"
appendfsync everysec
no-appendfsync-on-rewrite no
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb
aof-load-truncated 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-entries 512
list-max-ziplist-value 64
set-max-intset-entries 512
zset-max-ziplist-entries 128
zset-max-ziplist-value 64
hll-sparse-max-bytes 3000
activerehashing yes
client-output-buffer-limit normal 512mb 512mb 60
client-output-buffer-limit slave 512mb 256mb 120
client-output-buffer-limit pubsub 32mb 8mb 60
repl-backlog-size 64mb
hz 10
aof-rewrite-incremental-fsync yes
启动
[root@ns-yun-020021 falcon-plus]# systemctl start redis
[root@ns-yun-020021 falcon-plus]# systemctl status redis -l
● redis.service - Redis persistent key-value database
Loaded: loaded (/usr/lib/systemd/system/redis.service; disabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/redis.service.d
└─limit.conf
Active: active (running) since Tue 2020-08-18 17:56:33 CST; 1s ago
Process: 3437 ExecStop=/usr/bin/redis-shutdown (code=exited, status=0/SUCCESS)
Main PID: 3445 (redis-server)
Memory: 4.3M
CGroup: /system.slice/redis.service
└─3445 /usr/bin/redis-server *:6379
Aug 18 17:56:33 ns-yun-020021.vclound.com systemd[1]: Started Redis persistent key-value database.
Aug 18 17:56:33 ns-yun-020021.vclound.com systemd[1]: Starting Redis persistent key-value database...