Steps to install redis 3.2.5 under centos 6.7
- 2020-06-07 05:54:59
- OfStack
Preliminary preparation:
1. The operating system needs to install gcc package and TCL library. By configuring local yum source, yum-ES9en gcc and ES11en-ES12en install tcl are installed
2. Download the redis installation package and upload it to linux. Address: http: / / download. redis. io/releases /
[root@mysql ~]# ll redis-3.2.5.tar.gz
-rw-r--r--. 1 root root 1544040 Jun 1 22:57 redis-3.2.5.tar.gz
Note: centos7 configuration, the source of local yum, please reference https: / / www ofstack. com article / 108594. htm
The formal installation
3. Unzip
[root@mysql ~]# tar -xzvf redis-3.2.5.tar.gz
4. Compile and install
[root@mysql ~]# cd redis-3.2.5
[root@mysql redis-3.2.5]# make && make install
Note: execute the above commands one by one so that Redis is installed under the /usr/local/bin/ path.
5. Modify the configuration file
There is a file redis.conf in the path of redis-3.2.5. It needs to be copied and created to the /etc path. The command is as follows
Shown below:
[root@mysql redis-3.2.5]# mkdir -p /etc/redis
[root@mysql redis-3.2.5]# mv redis.conf /etc/redis/
6. Modify the configuration file
[root@mysql redis-3.2.5]#vim /etc/redis/redis.conf
[root@mysql redis-3.2.5]# cat /etc/redis/redis.conf
daemonize yes
pidfile /var/run/redis_6379.pid
port 6379
7. Run/stop Redis
- start
[root@mysql redis-3.2.5]# redis-server /etc/redis/redis.conf
[root@mysql redis-3.2.5]# ps -ef|grep redis
root 5845 1 0 23:29 ? 00:00:00 redis-server *:6379
root 5854 2553 0 23:30 pts/1 00:00:00 grep redis
Note: Command 1 means to start redisserver and command 2 means to check to see if the redis service starts properly.
Closed -
[root@mysql redis-3.2.5]# redis-cli shutdown
[root@mysql redis-3.2.5]# ps -ef|grep redis
root 5861 2553 0 23:31 pts/1 00:00:00 grep redis