Home  >  Article  >  Database  >  How to install redis in Linux centos7

How to install redis in Linux centos7

王林
王林forward
2023-05-26 18:28:061031browse

1. Because redis is developed in C language and is based on C language, we must first check whether we have installed the gcc environment. If not, install it online.

Check whether gcc is installed.

gcc -v

If installed gcc will display the version

Linux centos7中怎么安装redis

If not installed, install it online

yum –y install gcc-c++

2. Unzip the redis compressed package and compile

Unzip

[root@localhost soft]# tar -zxvf redis-3.0.0

After decompression, you can see our redis folder

Linux centos7中怎么安装redis

Enter our redis directory to compile make

cd redis-3.0.0

make

3. Create a folder for installation

Create a folder

mkdir /usr/local/redis

Specify the directory for installation

make install PREFIX=/usr/local/redis

4. The front-end startup method of redis

Enter the bin folder in our installation directory to start

cd /usr/local/redis/bin

./redis-server

Successful startup effect

Linux centos7中怎么安装redis

5. Redis backend startup method

Copy the redis.conf configuration file in the redis source package to /usr/local/ Under redis/bin/

First jump to the redis-3.0.0 we decompressed and then copy the configuration file redis.conf

cd soft redis-3.0.0.0

cp redis.conf /usr/local/redis/bin

Modify redis in our bin directory .conf file changes daemonize from no to yes

Jump to our /usr/local/redis/bin first and then modify it

cd /usr/local/redis/bin

vi redis.conf

Linux centos7中怎么安装redis

Start

./redis-server redis.conf

./redis-cli

The above is the detailed content of How to install redis in Linux centos7. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete