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

Detailed explanation of Redis installation tutorial under Linux

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

I. installation environment

Redis is an open source high performance key-value pair (key-value) database developed in C language. It provides a variety of key data types to meet the storage needs of different scenarios. It is recommended to run on Linux. This tutorial uses Centos6.5 as the installation environment, using version 3.2.10 of redis. Official website of Redis

To install Redis, you need to compile the downloaded source code, which depends on gc++,. If you do not have a gc++ environment and need to install gcc, execute the command: yum install gcc-c++

II. Installation

Extract the source code, extract the redis installation package, and execute the command: tar-zxvf redis-3.2.10.tar.gz

* Note: I personally like to install the software in the / usr/local directory and execute the command: tar-zxvf redis-3.2.10.tar.gz-C / usr/local/redis

Go to the extracted directory to compile, and execute the command: make

Install to the specified directory, execute the command: make PREFIX=/usr/local/redis/redis-3.2.10 install, and you can see that there is an extra bin directory under this path

Copy the configuration file to the installation directory (for later startup), enter the extracted redis directory, where there is a configuration file reids.conf, and copy it to the installation directory bin directory

Execute the command:

Cp / usr/local/redis/redis-3.2.10/redis.conf / usr/local/redis/bin/redis-3.2.10

III. Redis start

Method 1: front-end startup mode, the disadvantage of front-end mode startup is that when the ssh command window closes, the redis-server program ends, and the current command window is in a blocking state, so you need to reopen a new command window if you want to execute other commands.

Execute the command: cd / usr/local/redis/redis-3.2.10/bin

Then execute the command:. / redis-server

Method 2: start in the backend mode and modify the redis.conf configuration file in the installation directory (that is, the bin directory). If the configuration file is not available, change daemonize no to daemonize yes according to step 4 of the installation step, as shown in the following figure:

And load the configuration file when the redis service starts:

Execute the command: cd / usr/local/redis/redis-3.2.10/bin

Then execute the command:. / redis-server redis.conf

After starting successfully, it is shown in the following figure:

4. Close Redis

First go to the redis installation directory (that is, the bin directory) and execute the command: cd / usr/local/redis/bin

Turn off redis:

Method 1: execute the command:. / redis-cli shutdown

You can also shut down based on the port number of the redis service

Method 2: execute the command:. / redis-cli-p 6379 shutdown

The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.

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

Database

Wechat

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

12
Report