Home > Database > Redis > body text

How to install redis in Linux centos7

王林
Release: 2023-05-26 18:28:06
forward
1026 people have browsed it

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
Copy after login

If installed gcc will display the version

Linux centos7中怎么安装redis

If not installed, install it online

yum –y install gcc-c++
Copy after login

2. Unzip the redis compressed package and compile

Unzip

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

After decompression, you can see our redis folder

Linux centos7中怎么安装redis

Enter our redis directory to compile make

cd redis-3.0.0

make
Copy after login

3. Create a folder for installation

Create a folder

mkdir /usr/local/redis
Copy after login

Specify the directory for installation

make install PREFIX=/usr/local/redis
Copy after login

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
Copy after login

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
Copy after login

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
Copy after login

Linux centos7中怎么安装redis

Start

./redis-server redis.conf

./redis-cli
Copy after login

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!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!