redis版本:4.0.6
1.安装
[root@pxc01 soft]#tar –zxvf redis-4.0.6.tar.gz
[root@pxc01 soft]# cp -R ./redis-4.0.6 /opt/
[root@pxc01 opt]# cd redis-4.0.6
[root@pxc01 redis-4.0.6]# make
[root@pxc01 redis-4.0.6]# make test
没有问题会提示如下输出:
\o/ All tests passed without errors!
Cleanup: may take some time... OK
make[1]: Leaving directory `/opt/redis-4.0.6/src'
安装到指定的目录,默认是安装在/usr/bin目录
[root@pxc01 redis-4.0.6]# cd src
[root@pxc01 src]# make PREFIX=/home/hxl/redis install
2.创建相应目录
[root@pxc01 opt]# cd redis-4.0.6/
[root@pxc01 redis-4.0.6]# mkdir conf ##配置文件目录
[root@pxc01 redis-4.0.6]# mkdir log ##日志文件目录
[root@pxc01 redis-4.0.6]# mkdir run ##运行的pid文件目录
[root@pxc01 redis-4.0.6]# mkdir data ##快照和AOF文件目录
3.启动redis
/home/hxl/redis/bin/redis-server
/home/hxl/redis/conf/8379.conf
配置参数例子:
-
daemonize yes
-
pidfile /home/hxl/redis/run/redis-8379.pid
-
port 8379
-
tcp-backlog 511
-
timeout 0
-
tcp-keepalive 0
-
loglevel notice
-
logfile "/home/hxl/redis/log/redis-8379.log"
-
databases 16
-
save 900 1
-
save 300 10
-
save 60 10000
-
stop-writes-on-bgsave-error yes
-
rdbcompression yes
-
rdbchecksum yes
-
dbfilename dump-8379.rdb
-
dir /opt/single_redis-4.0.6/rdb
-
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
-
appendonly yes
-
appendfilename "redis-8379.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 0 0 0
-
client-output-buffer-limit slave 256mb 64mb 60
-
client-output-buffer-limit pubsub 32mb 8mb 60
-
hz 10
-
aof-rewrite-incremental-fsync yes
-
# Generated by CONFIG REWRITE
-
#masterauth "richinfo123"
-
#requirepass "richinfo123"
-
protected-mode no
-- The End --
阅读(5489) | 评论(0) | 转发(0) |