First, install the required package gcc
yum install gcc
Second, download redis, and unzip
wget http://download.redis.io/releases/redis-5.0.5.tar.gz tar zxvf redis-5.0.5.tar.gz
Third, access to redis extract directory, compile and install
redis- CD 5.0 . . 5 # If no parameter, linux will be given under the make MALLOC = the libc
Fourth, the files in the /usr/local/redis-5.0.5/src directory to / usr / local / bin directory
Executed under the extracted directory: cd src && make install
Fifth, start redis:
- Direct start-up mode, extract the directory in redis src folder under execution:
./redis-server
As Figure: redis started successfully, but this way need to have to start to open the window, you can not perform other operations, too convenient.
Press ctrl + c can close the window
- After the background process started redis
Redis.conf modify the file, unzip the file directory in redis
redis.conf vi
# The daemonize no change daemonize yes
Specify the file to start redis.conf
./redis-server /usr/local/redis-5.0.5/redis.conf
- Close redis process
# View the current process redis PS -aux | grep redis # kill command to kill the process kill - 9 pid
- Set boot
New redis directory in the / etc directory: mkdir redis
Copy /usr/local/redis-5.0.5/redis.conf paper to the next / etc / redis directory, and named 6379.conf
cp /usr/local/redis-5.0.5/redis.conf /etc/redis/6379.conf
Redis startup script will copy into the directory /etc/init.d
cp /usr/local/redis-5.0.5/utils/redis_init_script /etc/init.d/redisd
To switch to the /etc/init.d directory and execute the command from the start
cd /etc/init.d
chkconfig redisd on
Now in the form of direct services have been started and shut down the redis
start up:
service redisd start
Close:
Service redisd STOP