Http://download.redis.io/releases/redis-3.2.0.tar.gz
Official website Http://redis.io/download
1. Download the installation package
Cd/tmp
wget http://download.redis.io/releases/redis-3.2.0.tar.gz
2. Extract
TAR-ZXVF redis-3.2.0.tar.gz
3. Installation
Mkdir/usr/local/redis
CD redis-3.2.0
Make Prefix=/usr/local/redis Install//I have Redis installed under/usr/local/redis
4. Modifying a configuration file
Cd/usr/local/redis
mkdir conf
Cp/tmp/redis-3.2.0/redis.conf/usr/local/redis/conf/6379.conf
Modify Daemonize No in the 6379.conf file to daemonize Yes to enable Redis to start in the background
5. Start Redis
/usr/local/redis/bin/redis-server/usr/local/redis/conf/6379.conf
6. Ps-ef|grep Redis to see if it starts
--------------------------------------------------------------------------------------------------------------- ---------------------------------------
Expand
If you want to join Redis in a service
1. New Redis startup script
Vim/etc/ini.d/redis
Add the following code
1 #!/bin/sh2 #chkconfig: 3453 #description: Startup and Shutdown script for Redis4 5progdir=/usr/Local/redis/bin#Installation Path6progname=redis-Server7daemon=$PROGDIR/$PROGNAME8config=/usr/Local/redis/conf/6379.conf9pidfile=/var/run/redis-6379.PIDTenDesc="Redis Daemon" Onescriptname=/etc/init.d/Redis A - Start () - { the ifTest- x $DAEMON - Then -Echo-e"starting $DESC: $PROGNAME" - if $DAEMON $CONFIG + Then -Echo-e"OK" + Else AEcho-e"failed" at fi - Else -Echo-e"couldn ' t find Redis Server ($DAEMON)" - fi - } - in Stop () - { to ifTest-e$PIDFILE + Then -Echo-e"stopping $DESC: $PROGNAME" the if Kill' Cat$PIDFILE` * Then $Echo-e"OK"Panax Notoginseng Else -Echo-e"failed" the fi + Else AEcho-e"No Redis Server ($DAEMON) running" the fi + } - $ Restart () $ { -Echo-e"restarting $DESC: $PROGNAME" - Stop the Start - }Wuyi the list () - { WuPS aux |grep $PROGNAME - } About $Case $1inch - start) - Start - ;; A stop) + Stop the ;; - restart) $ Restart the ;; the list) the List the ;; - in*) theEcho"Usage: $SCRIPTNAME {start|stop|restart|list}">&2 the Exit 1 About ;; the Esac the Exit 0
View Code
2. Other operations
cd/etc/ini.d/
chmod +x Redis
Chkconfig--add Redis
Chkconfig--level 345 Redis on
Chkconfig--list Redis
Service Redis Start
Linux Installation Redis Service