Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to install redis on a linux server

Shulou Source: shulou.com Published: 2022-05-31 22:19:38 10月13日 Update

Editor to share with you how to install redis on the linux server. I hope you will get something after reading this article. Let's discuss it together.

Two ways of downloading

1. Download directly to the official website, and then upload the downloaded files to the server through filezilla. This operation can be done by Baidu on its own. There are many tutorials on the use of filezilla on the Internet.

two。 Download through the command

Wget http://download.redis.io/releases/redis-5.0.5.tar.gz

After completing the download steps above, you can see the redis-5.0.5.tar.gz file in the root directory through the ls command.

$ls

Redis-5.0.5.tar.gz

Note: let me explain this first, because I am used to creating a redis file under the / usr/local file, and then putting the redis compilation and configuration files in this folder for easy management.

The operation is as follows

$mkdir / usr/local/redis / / create a redis folder

$cd / usr/local/redis / / enter the redis folder

$mkdir bin / / create the bin folder, and the later compiled files will be put here

$cd / / go back to the root directory

The following begins to extract and compile the redis file

$tar xzf redis-5.0.5.tar.gz / / decompress

$cd redis-5.0.5 / / enter the decompressed redis-5.0.5

$make / / compile file

$make PREFIX=/usr/local/redis/bin install / / install the compiled file into the bin file we created above

$mv redis.conf / usr/local/redis / / move the configuration file to the redis folder

Through the above steps, the installation of redis is complete, and at this time you can go through the

$cd / usr/local/redis

$bin/redis-server redis.conf

You can start the redis service.

Services can be turned off through bin/redis-cli shutdown

Note: make may report an error. Generally speaking, gcc is not installed in the system, so it can be installed through yum.

Yum install gcc

Redis-5.0.5.tar.gz and redis-5.0.5 under the root directory can be deleted.

In addition, through the above service startup method, a window for running the service will pop up. This is not the result we want. We need it to run in the background. It is also simple, just through vim redis.conf, open the redis.conf configuration file, find daemonize no, and change it to daemonize yes.

After reading this article, I believe you have a certain understanding of "how to install redis on the linux server". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!

Tags: Files services folders compilers facets servers root directories configurations commands methods steps articles run this is not just background done tutorials time Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Docker NVidia Redmi Xiaomi