一、安装remi-release源
[root@test1 ~]# rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
二、安装redis
[root@test1 ~]# yum --enablerepo=remi install -y redis
[root@test1 ~]# systemctl start redis
[root@test1 ~]# systemctl enable redis
三、redis优化
以下仅供参考
[root@test-db ~]# egrep -v "#|^$" /data/redis/conf/redis-6380.conf
daemonize yes
pidfile "/var/run/redis-6380.pid"
bind 127.0.0.1 192.168.0.146
port 6380
tcp-backlog 511
timeout 300
tcp-keepalive 0
loglevel notice
logfile "/data/redis/log/redis-6380.log"
databases 16
save 900 1
save 300 10
save 60 10000
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename "dump-6380.rdb"
dir "/data/redis/data"
requirepass "123456"
masterauth "123456"
slave-serve-stale-data yes
slave-read-only yes
repl-ping-slave-period 10
repl-timeout 60
repl-disable-tcp-nodelay no
repl-backlog-size 1mb
repl-backlog-ttl 3600
slave-priority 100
maxclients 5000
maxmemory 1953125kb
appendonly yes
appendfilename "appendonly-6380.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 5000
slowlog-max-len 1024
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 0 0 0
client-output-buffer-limit slave 4gb 2gb 1800
client-output-buffer-limit pubsub 32mb 8mb 60
hz 10
aof-rewrite-incremental-fsync yes
留言