1, check the installation of dependent programs
Yum install gcc-c++
yum install-y tcl Yum install
2. Get installation files
wget http://download.redis.io/releases/redis-2.8.13.tar.gz
3, Extract files
TAR-XZVF redis-2.8.19.tar.gz
MV Redis-2.8.19/usr/local/redis
4, enter the catalogue
5. Compile and install
6, set the configuration file path
Mkdir-p/etc/redis
CP Redis.conf/etc/redis
7, modify the configuration file
Modify only:
8, start
/usr/local/bin/redis-server/etc/redis/redis.conf
9. View Startup
10, using the client
REDIS-CLI
>set name David
OK
>get name
"David"
11. Close the Client
12, Boot Configuration
echo "/usr/local/bin/redis-server/etc/redis/redis.conf &" >>/etc/rc.local
PS: Let Redis run in service mode
The following is an action step to configure Redis as a service, first copying the Utils/redis_init_script file to the/ETC/INIT.D
Cp/usr/local/redis-2.8.19/utils/redis_init_script/etc/rc.d/init.d/redis
Copy Redis_init_script to/etc/rc.d/init.d/and easily named Redis
And then
In the second line of the document, add
Then notice
Exec=/usr/local/redis/bin/redis-server
CLIEXEC=/USR/LOCAL/REDIS/BIN/REDIS-CLI
Since our installation directory is/usr/local/redis-2.8.19, the above two lines are changed to
Exec=/usr/local/redis-2.8.19/src/redis-server
CLIEXEC=/USR/LOCAL/REDIS-2.8.9/SRC/REDIS-CLI
Also pay attention to the Redis file's
Increase & in the back of Conf
"&", that is, to move the service to the back of the meaning, otherwise start the service, the Redis service will occupy the front, occupy the main user interface, resulting in other commands do not execute.
You can see this line in the/etc/init.d/redis file:
conf= "/etc/redis/${redisport}.conf"
The Redis configuration file is then copied to the/etc/redis/
Mkdir/etc/redis
cp/usr/local/redis-2.8.19/redis.conf/etc/redis/6379.conf
Once you have completed the above, you can register the service:
and start the Redis service.
Redis can be run by service mode.