1.1Official Site
official website : http://redis.io/
Chinese website : http://www.redis.cn/
1.2Download the installation package
: http://download.redis.io/releases/redis-3.0.5.tar.gz
wget http://download.redis.io/releases/redis-3.0.5.tar.gz
1.3Install support Packages
Yum Install gcc Zmalloc jemalloc*
1.4Create a program directory
Data Catalog: Mkdir-p/opt/redis/data Log directory: Mkdir-p/opt/redis/log
1.5Unzip the installation
TAR-ZXVF redis-3.0.5.tar.gzcd redis-3.0.5make Prefix=/opt/redis malloc=libc INSTALLCP./src/redis-trib.rb/opt/redis/ Bin/ln-s/opt/redis/bin/redis-trib.rb/bin/redis-trib.rbln-s/opt/redis/bin/*/bin/
1.6 Configuring Redis
[[email protected] ~]# cat/etc/redis/redis.conf |grep-v "^#" |grep-v "^$" Daemonize Yespidfile/opt/redis/redis.pidport 6 379bind 0.0.0.0timeout 300loglevel noticelogfile/opt/redis/log/redis_01.logdatabases 16save 60 1save 10save 1000 0rdbcompression yesdbfilename dump_01.rdbdir/opt/redis/datamaxclients 1280
1.7Registration Services1.7.1copying scripts from the installation directory
CP./utils/redis_init_script/etc/init.d/redis
1.7.2Modifying Scripts
VI /etc/init.d/redis
#!/bin/sh
# Add the following line
#chkconfig: 2345 80 90
# simple Redis INIT.D script conceived to work on Linux systems
# as it does use of the/proc filesystem.
redisport=6379
#修改以下几行
Exec=/opt/redis/bin/redis-server
Cliexec=/opt/redis/bin/redis-cli
Pidfile=/opt/redis/redis_${redisport}.pid
conf= "/etc/redis/redis.conf"
1.7.3Add Service
Chkconfig--add redischkconfig--list Redis
1.7.4Start the service
Service Redis Start
1.8System Settings1.8.1Turn off selinux
Configure the shutdown vi/etc/selinux/config. selinux=disabled Close now Setenforce 0
1.8.2Firewall Open 6379 Port
Add a policy cat/etc/sysconfig/iptables|grep 6379-a input-m State--state new-m tcp-p TCP--dport 6379-j accept Restart Firewall service iptables restart
This article is from the "Dead Leaf" blog, please make sure to keep this source http://mydbs.blog.51cto.com/513727/1745300
Redis 3.0.5 Installation