Install redis5.0 in CentOS7

1. Environment Introduction##

2. Download Redis5.0-rc3

wget -O redis-5.0-rc3.tar.gz https://github.com/antirez/redis/archive/5.0-rc3.tar.gz

3. Unzip redis

tar -zxvf redis-5.0-rc3.tar.gz -C /usr/local

4. Compile and install##

cd /usr/local/redis-5.0-rc3
make

There will be an error:

compilation terminated.
make[1]:***[adlist.o] Error 1
make[1]: Leaving directory `/usr/local/redis-5.0-rc3/src'
make:***[all] Error 2

Install Development Tools

yum groupinstall 'Development Tools'

If executed again, an error will be reported

make
cd src && make all
make[1]: Entering directory `/usr/local/redis-5.0-rc3/src'
 CC adlist.o
In file included from adlist.c:34:0:
zmalloc.h:50:31: fatal error: jemalloc/jemalloc.h: No such file or directory
 # include <jemalloc/jemalloc.h>
                               ^
compilation terminated.
make[1]: *** [adlist.o] Error 1
make[1]: Leaving directory `/usr/local/redis-5.0-rc3/src'
make:***[all] Error 2

The final solution is as follows:

cd /usr/local/redis-5.0-rc3/deps; make hiredis lua jemalloc linenoise

After the compilation is complete, execute the make command again in /usr/local/redis-5.0-rc3

cd /usr/local/redis-5.0-rc3
make

The compilation is successful when the following appears

Hint: It's a good idea to run 'make test' ?

make[1]: Leaving directory `/usr/local/redis-5.0-rc3/src'

Then execute the installation command in /usr/local/redis-5.0-rc3/src:

cd /usr/local/redis-5.0-rc3/src
make install

The following log information will appear

Hint: It's a good idea to run 'make test' ?

 INSTALL install
 INSTALL install
 INSTALL install
 INSTALL install
 INSTALL install

5. Modify the redis.conf configuration file##

vim /usr/local/redis-5.0-rc3/redis.conf

Just need to adjust the following

protected-mode no #Turn off protection mode
daemonize yes     #Daemon mode is on

6. Start redis5.0

/usr/local/redis-5.0-rc3/src/redis-server /usr/local/redis-5.0-rc3/redis.conf

In fact, when we execute make install, we will copy several commands under src to /usr/local/bin/, or execute the following command to start redis5.0

/usr/local/bin/redis-server /usr/local/redis-5.0-rc3/redis.conf

Check port

netstat -ltnp |grep 6379

If there is port monitoring, redis has been started successfully.

Try to connect

redis-cli 

127.0.0.1:6379> info
# Server
redis_version:4.9.103
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:207f31cf830c081e
redis_mode:standalone
os:Linux 3.10.0-693.17.1.el7.x86_64 x86_64
arch_bits:64
multiplexing_api:epoll
atomicvar_api:atomic-builtin
gcc_version:4.8.5
process_id:20361
run_id:4835668974ad86f1db9b3c8b98e02be1a87a7b9b
tcp_port:6379
uptime_in_seconds:689
uptime_in_days:0
hz:10
lru_clock:3944003

Why can the redis-cli command be executed in any directory, because the redis-cli command is in the /usr/local/bin directory, and the directory is configured in the PATH, so you can execute ls, mkdir Wait for commands to execute commands such as redis-cli or redis-server.

Generally, we will delete the installation package after installing redis. Then we only need to move the redis.conf configuration file to other directories, such as: /etc/redis/redis.conf, where is the specific location? Just place it according to your own habits or specifications.

Recommended Posts

Install redis5.0 in CentOS7
Install MySQL5.7 in centos7
Install php in centos
CentOS 7 install Redis 5.0.8 original
Linux Centos7 install redis tutorial
1.5 Install Centos7
Install JDK8 in rpm on CentOS7
[Introduction to redis] Install redis under Centos
Minimal install JDK 1.8 tutorial in CentOS 7
Install MySql with Docker in CentOS7
Install Percona Server database (in CentOS 8)
Install java in yum mode in Centos
How to install HDP2.6 in Centos7.2
Install Centos7 operating system in Docker
Install and configure FreeIPA in Centos7
Centos7.3 install nginx
CentOS7.2 install Mysql5.7.13
CentOS install Redmine
CentOS7 install MySQL
Centos7 install protobuf
CentOS 7 install Docker
CentOS7 install GlusterFS
CentOS 7.4 install Zabbix 3.4
CentOS7 install Docker
Centos6.5 install Tomcat
Vmware install CentOS6
CentOS 7 install Hadoop 3.0.0
Centos7 install Python2.7
Centos 7.6 install seleniu
CentOS 7.3 install Zabbix3
Centos7 install LAMP+PHPmyadmin
CentOS install mysql
CentOS install openjdk 1.8
CENTOS6.5 install CDH5.12.1 (1)
CentOS install PHP
CentOS6 install mist.io
Centos7 install Docker
CentOS7 install mysql
centOs install rabbitMQ
CentOS 7 install MySQL 5.6
Centos7 install Nginx
CentOS6.5 install CDH5.13
Centos7 install docker18
Centos install Python3
centos7 install docker
CentOS install jdk
centos7 install nginx-rtmp
CentOS8 install MySQL8.0
Centos6.3 install KVM
CentOS install PostgreSQL 9.1
CentOS7 install mysql8
CentOS 7 install Java 1.8
CentOS8 install fastdfs6.06
CentOS 7 install Gitlab
Centos 7 install PostgreSQL
CentOS7 install MySQL8
CentOS 7 install Java 1.8
CentOS 6 install Docker
centos 6.5 install zabbix 4.4
Centos8 install Docker
CentOS6.8 install python2.7