Redis – Chapter 3 – installation and configuration

Time:2021-4-14
Official website address
    https://redis.io/
download
    wget https://download.redis.io/releases/redis-6.0.10.tar.gz          
install
    cd redis-6.0.10
    make      
    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
    join
    /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 127.0.0.1, comment # bind 127.0.0.1 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 127.0.0.1 -p 6379 -a 123456
            -H is the host IP address
            -P is the port number
            -A is the password