Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install redis on a linux server

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report