1. Introduction to the basic environment:
Operating system: Centos 6.7
Redis version: 3.0.2
2. Start the installation:
1) Basic Installation
Reference Link: http://309173854.blog.51cto.com/7370240/1710655
[[Email protected] ~] #yum-y install tcl [[email protected] ~]# wget http://download.redis.io/releases/redis-3.0.2. tar.gz [[email protected] ~]# tar xzf redis-3.0.2.tar.gz [[email protected] ~]# CD redis-3.0.2 [[Emai] L protected] redis-3.0.2]# make [[email protected] redis-3.0.2] #make test
650) this.width=650; "title=" Redis1.png "src=" http://s4.51cto.com/wyfs02/M01/79/EB/ Wkiom1ad7rwj21ataabl799lzag488.png "alt=" Wkiom1ad7rwj21ataabl799lzag488.png "/>
[[email protected] redis-3.0.2] #mkdir/usr/local/redis [[email protected] redis-3.0.2]# make Prefix=/usr/local/redi s Install
650) this.width=650; "title=" Redis2.png "src=" http://s3.51cto.com/wyfs02/M00/79/EA/ Wkiol1ad7xgdyu0vaaasd4z-hia069.png "alt=" Wkiol1ad7xgdyu0vaaasd4z-hia069.png "/>
[Email protected] redis-3.0.2]# ls/usr/local/redis/bin/
650) this.width=650; "title=" Redis3.png "src=" http://s4.51cto.com/wyfs02/M01/79/EA/ Wkiol1ad7zityw94aaa3ic1lnsc411.png "alt=" Wkiol1ad7zityw94aaa3ic1lnsc411.png "/>
2). Basic Configuration
To create a configuration file directory
[Email protected] redis-3.0.2]# MKDIR/USR/LOCAL/REDIS/ETC [[email protected] redis-3.0.2]# CP Redis.conf/usr/loc al/redis/etc/[[email protected] redis-3.0.2]# ln-s/usr/local/redis/etc/redis.conf/etc/redis.conf
3). Create a log file
[Email protected] redis-3.0.2]# Touch/var/log/redis.log
4). Configure Command invocation
command to join the system startup variable (recommended only under the root user variable)
[Email protected] redis-3.0.2]# echo "Export path=/usr/local/redis/bin:\ $PATH" >>/root/.bash_profile [[Emai L protected] redis-3.0.2]# source. Bash_profile or (Source/root/.bash_profile)
3. Start the server and configure
1). Optimization of Linux parameters
[Email protected] redis-3.0.2]# echo ' vm.overcommit_memory=1 ' >>/etc/sysctl.conf [[email protected] redis-3 .0.2]# sysctl-p [[email protected] redis-3.0.2]# echo never >/sys/kernel/mm/transparent_hugepage/enabled [Email protected] redis-3.0.2]# echo ' echo never >/sys/kernel/mm/transparent_hugepage/enabled; ' >>/ETC/RC.L ocal [[email protected] redis-3.0.2]# echo ' echo 511 >/proc/sys/net/core/somaxconn; ' >>/etc/rc.local
2). Configure the Redis.conf file
[Email protected] redis-3.0.2]# cat/etc/redis.conf |grep-v ' # ' |grep-v ' ^$ '
Daemonize Yes
Pidfile/var/run/redis.pid
Port 6379
Tcp-backlog 511
Bind 127.0.0.1 192.168.4.29
Timeout 0
Tcp-keepalive 0
LogLevel Notice
LogFile "/usr/local/redis/var/redis.log"
Databases 16
Save 900 1
Save 300 10
Save 60 10000
Stop-writes-on-bgsave-error Yes
Rdbcompression Yes
Rdbchecksum Yes
Dbfilename Dump.rdb
Dir./
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 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 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
3). Manual Start Redis-server
[Email protected] redis-3.0.2]# redis-server/etc/redis.conf
4). Verify Server Startup status
[[email protected] ~]#/etc/init.d/redis status [[email protected] ~]# Ps-ef |grep Redis
650) this.width=650; "title=" Redis5.png "src=" http://s5.51cto.com/wyfs02/M01/79/EB/ Wkiom1ad79iq739waaa0egfllz0236.png "alt=" Wkiom1ad79iq739waaa0egfllz0236.png "/>
To configure the self-boot file:
See attachment Redis Configuration Self-boot file
4.redis off
[Email protected] ~]# REDIS-CLI
127.0.0.1:6379> Shutdown Save
127.0.0.1:6379>quit
To this redis3.0.2 compile and install the end, if have questions and questions, welcome everyone to communicate ~ ~ ~
This article is from the "Little Mo Growth Road" blog, please be sure to keep this source http://309173854.blog.51cto.com/7370240/1736571
redis3.0.2 Compile and install (Start service mode start)