Redis – Chapter 3 – installation and configuration

Official website address
    cd redis-6.0.10
    cd src
    make install PREFIX=/usr/local/redis

Note: make compilation failed, probably because there is no GCC service

Check whether GCC is installed
    rep -qa|grep gcc          
Install GCC
    yum -y install gcc  
    yum -y install gcc-c++  
Move the configuration file to the installation directory
    mv redis.conf /usr/local/redis/etc    
Start the service
    /usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf
By default, redis is not started in the background, but is set to start in the background
vim redis.conf
    Change the value of daemonize to yes
Redis starts automatically
vim /etc/rc.local
    /usr/local/redis/bin/redis-server /usr/local/redis/etc/redis-conf
Set permissions to log in
1. Comment out the redis.conf The following data in the file: bind, comment # bind or modify bind 0.0.0.
    2. Modify the protection mode to non: the default is protected mode yes, and the modified one is protected mode No.
    3. Set the redis connection password: find requirepass foobared and add requirepass 123456 below.
Command line login with password
Start mode with password
        ./redis-cli -h -p 6379 -a 123456
            -H is the host IP address
            -P is the port number
            -A is the password