wget http://download.redis.io/releases/redis-2.8.3.tar.gztar xzf redis-2.8.3.tar.gzCD redis-2.8.3 Make2. After compiling, in the./src directory, there are three executables redis-server, Redis-benchmark, Redis-cli, and./redis.conf and then copied to a directory. Mkdir/usr/redisCP Redis-server/usr/redisCP Redis-benchmark/usr/redisCP Redis-cli/usr/redisCP Redis.conf/usr/redisCd/usr/redis3. Start Redis service. Redis-server redis.conf4, then use the client to test whether to start successfully. redis-cliredis> set foo barOKredis> get foo"Bar" ---------------------------------------------------------------------------------------------------------then make a self-made Redis startup script for easy management1, VIM/ETC/RC.D/INIT.D/REDISD
#!/bin/sh
#chkconfig: 345
#description: Startup and Shutdown script for Redis
Progdir=/usr/redis #安装路径
Progname=redis-server
daemon= $PROGDIR/$PROGNAME
config=/usr/redis.conf
Pidfile=/var/run/redis.pid
desc= "Redis daemon"
SCRIPTNAME=/ETC/RC.D/INIT.D/REDISD
Start ()
{
if Test-x $DAEMON
Then
echo-e "Starting $DESC: $PROGNAME"
if $DAEMON $CONFIG
Then
echo-e "OK"
Else
echo-e "Failed"
fi
Else
echo-e "couldn ' t find Redis Server ($DAEMON)"
fi
}
Stop ()
{
if Test-e $PIDFILE
Then
echo-e "Stopping $DESC: $PROGNAME"
if kill ' cat $PIDFILE '
Then
echo-e "OK"
Else
echo-e "Failed"
fi
Else
echo-e "No Redis Server ($DAEMON) running"
fi
}
Restart ()
{
echo-e "Restarting $DESC: $PROGNAME"
Stop
Start
}
list ()
{
PS aux | grep $PROGNAME
}
Case $ in
start)
Start
;;
stop)
Stop
;;
restart)
Restart
;;
list)
List
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart|list}" >&2
Exit 1
;;
Esac
Exit 0 2. Increase the service and start the bootCP./REDISD/ETC/RC.D/INIT.D/REDISDchmod +X/ETC/RC.D/INIT.D/REDISDchkconfig--add REDISDchkconfig--level 345 REDISD onchkconfig--list REDISDafter executing the script, you can start start|stop|restart|list your service. CP Redis-server/usr/local/redisCP redis-benchmark/usr/local/redisCP redis-cli/usr/local/redisCP redis.conf/usr/local/redis
Redis Installation Guide