Installation Redis
- Download the installation package Redis
wget http://download.redis.io/releases/redis-5.0.4.tar.gz
- Extracting archive
tar -zxvf redis-5.0.4.tar.gz
- Installation of GCC relies
yum install gcc
- Switch to extract from the directory
cd redis-5.0.4
- Compile and install
make MALLOC=libc
- Move Folder
mv redis-5.0.4/ /usr/local/
Select Folder execution
cd src && make install
The installation is complete!
Redis is set to start
After the background process started redis
- Modify redis.conf
cd /usr/local/redis-5.0.4
vi redis.conf
#在vi命令模式 可按/键向下查找字符串 ?是向上
把
daemonize no
改为
daemonize yes
- Specify the file to start redis.conf
./redis-server /usr/local/redis-5.0.4/redis.conf
Set redis boot from the start
1, redis new directory in the / etc directory
mkdir redis
2, a document to be copied redis.conf under / etc / redis directory, and named 6379.conf
cp /usr/local/redis-5.0.4/redis.conf /etc/redis/6379.conf
3, a copy of redis startup script into /etc/init.d directory
cp /usr/local/redis-5.0.4/utils/redis_init_script /etc/init.d/redisd
4, provided redis boot from the start
to switch to directory /etc/init.d
cd /etc/init.d
Then execute the command from the start
chkconfig redisd on
Now you can directly startup and shutdown services redis in the form of
start up:
service redisd start
shut down:
service redisd stop