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

Centos7.0 installation Redis instance analysis

WBOY
Release: 2023-05-28 22:04:11
forward
1372 people have browsed it

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,操作更方便哦
Copy after login

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
Copy after login

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
Copy after login

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
Copy after login

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
Copy after login

Centos7.0 installation Redis instance analysis

8. Enter the bin directory to start the redis service

 ./redis-server
Copy after login

Centos7.0 installation Redis instance analysis

9. Enter the bin directory to perform client connection operations

 ./redis-cli –p 6379
Copy after login

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
    Copy after login
  4. Windows client test connection without entering password


    Centos7.0 installation Redis instance analysis

  5. 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!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template