Home  >  Article  >  Database  >  Centos7.0 installation Redis instance analysis

Centos7.0 installation Redis instance analysis

WBOY
WBOYforward
2023-05-28 22:04:111329browse

1. Prepare the environment

  • VM virtual machine/Buy a server

  • Centos7.x

2. Download the redis source code package

Redis official website address

I put here my installed version redis-4.0.10.tar.gz

链接:https://pan.baidu.com/s/12qNGdoEFaZ0o-TOHB7KniA 
提取码:w80y 
复制这段内容后打开百度网盘手机App,操作更方便哦

3. Upload the downloaded redis data package to Linux

I used Xftp to upload
Centos7.0 installation Redis instance analysis

4. Unzip the file

[root@Redis1~]# tar -zxvf redis-4.0.10.tar.gz

Centos7.0 installation Redis instance analysis

5. Install gcc

The decompressed redis is the source code package, Redis is written in C,The C environment must be installed

	yum install -y gcc

Centos7.0 installation Redis instance analysis

6. Enter the decompressed directory and execute the following command

Be sure to enter the decompressed redis directory to execute the command

	make MALLOC=libc

Centos7.0 installation Redis instance analysis

7. After the compilation is completed Execute the following command

Or execute the command in the redis directory where redis is decompressed

	make install PREFIX=/usr/redis

Centos7.0 installation Redis instance analysis

8. Enter the bin directory to start the redis service

 ./redis-server

Centos7.0 installation Redis instance analysis

9. Enter the bin directory to perform client connection operations

 ./redis-cli –p 6379

Centos7.0 installation Redis instance analysis

##10. External connection to access Redis operations

  1. Use the cp command to copy redis.conf under redis to the /usr/redis/ directory

    cp /root/redis/redis.conf /usr/redis/

    Centos7.0 installation Redis instance analysis

    Centos7.0 installation Redis instance analysis

  2. Modify the redis.conf file


    Centos7.0 installation Redis instance analysis

  3. Close the firewall

    //查看当前防火墙状态。 systemctl status firewalld//关闭当前防火墙。 systemctl stop firewalld//开机防火墙不启动。永久关闭systemctl disable firewalld

  4. Windows client test connection without entering password


    Centos7.0 installation Redis instance analysis

The above is the detailed content of Centos7.0 installation Redis instance analysis. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete