当前位置:网站首页>Redis installation and common problem solving based on centeros7 (explanation with pictures)

Redis installation and common problem solving based on centeros7 (explanation with pictures)

2022-06-10 23:48:00 Xiao Zhong wants to learn!!!

be based on CenterOS7 install Redis Common problems and Solutions

The two installation problems created are shown below

1、 Download the installation package and install

Official download address :https://redis.io/download/

  • Directly in win Download the extracted package from the platform, upload it to the virtual machine, and then install it

    Directly click the version to download the compressed file

  • Perform remote download and installation through commands on the virtual machine redis Installation package

    1. Remote installation address ( Choose your own version )

      wget http://download.redis.io/releases/redis-?.?.?.tar.gz
      

      If you are prompted wget If the command is not found, execute the following code to install the plug-in , When the installation is completed, you will be prompted , Allow the above download address again

      yum -y install wget
      
    2. After downloading, you can use ll Command to check whether the files in the current directory exist , Here is win Download the uploaded , Then extract the file

      Navigate to the uploaded folder , Then decompress redis Compressed package

      tar –xvf  file name .tar.gz
      

      After extracting the file , Again cd Go to the extracted file to view the file directory , Use ll Catalog

      [ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-6G0zeAE0-1654870578779)(images/image-20220610211618336.png)]

      cat Makefile
      //  You can view the installation location as follows 
      
      # Top level makefile, the real shit is at src/Makefile
      
      default: all
      
      .DEFAULT:
              cd src && $(MAKE) [email protected]
      
      install:
              cd src && $(MAKE) [email protected]
      
      .PHONY: install
      
      
    3. Compile and install through the following statement ( Compilation takes time and patience , If an installation error occurs, follow the steps below )

      make install
      

      If you succeed , Use cd Command to enter the installation directory src in , And then through ll Command to see if the installation is successful , The appearance of the following represents success

      [ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-c2LLk89B-1654870578780)(images/image-20220610212021820.png)]

    4. Please look down at the installation error

      1. The first mistake is the one mentioned above -bash: wget: Command not found , have already been solved

      2. The second compilation error gcc: Command not found , Execute the following statement to solve the problem

        yum -y install gcc automake autoconf libtool make
        

        [ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-WlxMmi2W-1654870578780)(images/image-20220610212509954.png)]

      3. The third compilation error zmalloc.h:50:31: Fatal error :jemalloc/jemalloc.h: There is no file or directory , Execute the following statement to solve the problem

        [ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-EeOIoN7r-1654870578781)(images/image-20220610212727871.png)]

        Be careful : The following statements need to be executed under the unzipped package file ( Equal to compile , It's going to take some time )

        make MALLOC=libc
        

        [ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-9LoxjKH2-1654870578782)(images/image-20220610213013211.png)]

    5. start-up src The directory redis-server service

      [ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-dKyicw2t-1654870578782)(images/image-20220610213130018.png)]

      Because the current page is used to start redis The server , So I can't execute the command , Need to copy a label

    6. Enter the installation directory , Then start redis-cli, You can do it

      [ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-xpJeiv7o-1654870578783)(images/image-20220610213309106.png)]

2、 modify Redis port

Use the following command to modify the port to start multiple redis service

redis-server --port 6380

You also need to specify the port when starting the client

redis-cli -p 6380
原网站

版权声明
本文为[Xiao Zhong wants to learn!!!]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/161/202206102229225286.html