Installing redis on alicloud server linux (centos7)

Time:2020-10-25

1、 Using tools: xshell, xftp

2、 Prepare redis Linux installation package and download it from the official website

Download address of official website:http://download.redis.io/rele…

Select here:redis-5.0.7.tar.gz

3、 Use xftp to put the installation package in the / opt directory

Content understanding [expansion and supplement]:

  • /opt: YesUser level program directoryD / software. For programs installed in the / opt directory, all its data, library files, and so on are placed in the same directory. Opt hasOptionalThis can be used to place large third-party software (or games). When you don’t need it, you can directly RM – RF. When the hard disk capacity is not enough, you can also mount / opt to other disks separately for use.
  • /usr: system level directory, which can be understood as C / Windows /.
  • /usr/lib: understood as C / Windows / system32.
  • /usr/local: user level program directory, which can be understood as C / progress files /. The software compiled by the user will be installed in this directory by default.
    It mainly stores the manually installed software, that is, the software that is not installed through “synaptic” or apt get. It has a similar directory structure to the / usr directory. Let the package manager manage the / usr directory, and put the custom scripts under the / usr / local directory.

4、 Decompression:

tar -zxvf redis-5.0.7.tar.gzAfter decompressing, LS checks and finds the redis-5.0.7 folder (blue)

5、 Enter the directory redis-5.0.7 and execute the make command

1. Execute the make command before executing ityum install gcc-c++

2. Version view test:gcc -v

Installing redis on alicloud server linux (centos7)

3. Enter the directory redis-5.0.7:cd redis-5.0.7

4. ImplementationmakeThe first time you execute make, you will download and install a lot of things and wait patiently.

If you execute make error: jemalloc / jemalloc. H: there is no such file or directory

On executionmake distcleanThen make

5. Execute againmakeThe discovery was done quickly

Installing redis on alicloud server linux (centos7)

6. Final executionmake installAfter that, it is found that the installation is OK as shown in the figure below

Installing redis on alicloud server linux (centos7)

6、 Default installation path of redis

Default installation path:/usr/local/bin

Can be directlycd /usr/local/binEnter view

Installing redis on alicloud server linux (centos7)

7、 Copy redis configuration file to / usr / local / bin (ensure security)

1. First create a new folder under / usr / local / bin,mkdir myconfig

2. Copy the configuration file to the new folder,cp /opt/redis-5.0.7/redis.conf myconfig

3. View the copied configuration file, complete

Installing redis on alicloud server linux (centos7)

After that, you will use the redis.conf Start up

8、 Let redis start in the background – modify the configuration file (it is not started in the background by default)

vim redis.confEnter the configuration file to modify
Installing redis on alicloud server linux (centos7)

Change daemonize to yes

ESC exit to return to command mode, press: enter WQ to save exit

9、 Start redis service

1. Start redis under / usr / local / bin through the previously copied configuration file (specified configuration file)

redis-server myconfig/redis.conf

Installing redis on alicloud server linux (centos7)

2. Use redis client to test the connection:

adoptredis-cli -p 6379Connect to the specified port number

Installing redis on alicloud server linux (centos7)

10、 Check whether the redis process is open

ps -ef|grep redis

Installing redis on alicloud server linux (centos7)

11、 Close redis service

shutdown

exit

Installing redis on alicloud server linux (centos7)

Check the redis process again. The redis server and redis cli are no longer available

Installing redis on alicloud server linux (centos7)

reference resources:

1、https://blog.csdn.net/ningwen…What is the difference between / opt directory and / usr / local directory in Linux system

2、https://space.bilibili.com/95…Crazy God talks about Java


Thank you for reading this technical article

If it can help you

That would be a wonderful thing

Lifelong learning to be curious is also great

May the world be simple and colorful

Please indicate the source of reprint

— paper airplane

Recommended Today

Explain module, import and export in JavaScript

Author: Tania rascia Crazy technology house Original text:https://www.taniarascia.com/j… In the era of the Internet, websites are mainly developed with HTML and CSS. If you load JavaScript into a page, it usually provides effects and interactions in the form of small fragments. Generally, all JavaScript code is written in a file and loaded into a filescriptTag. […]