反馈已提交

网络繁忙

You are viewing 5.1 help doc. More details are displayed in the latest help doc.

Linux System Installation and Configuration of Standalone Redis

  • Recent Updates: November 01, 2022
  • 1. Overview

    Redis is used as a stateful server in Web clusters, mainly for storing cached logins, template locks, SessionIDs, WebSockets, etc. It plays and authenticates all accesses and operations.

    2. Operation steps

    2.1 Installing the gcc compiler

    This step relies on the gcc compiler. If you do not have a gcc environment, you will need to install the package yourself.  

    yum install gcc gcc-c++ ,As shown below.

    gcc -v ##Check for gcc compiler

    2.2 Download Redis

    There are two ways to download Redis-5.0.4, either from the official website or by downloading the recommended version.

    1)Official Website Download:http://download.redis.io/releases/

    2)Redis-5.0.4:redis-5.0.4.tar.gz

    2.3 Installing Redis

    mkdir /usr/redis  # Creating a Redis Directory
    cd /usr/redis  # Go to catalog
    # Transfer the Redis installation package to this directory#
    tar -zxvf redis-5.0.4.tar.gz  # Unzip the installation package
    cd /usr/redis/redis-5.0.4  # Go to the decompression directory
    make 
    make test
    make install  # installation command
    redis-server -v  # Check the installation results

    2.4 Modify configuration

    Go to the edit file, as follows.

    vi /usr/redis/redis-5.0.4/redis.conf # Edit the redis.conf configuration file

    Modify the following.

    bind 127.0.0.1 ---> # bind 127.0.0.1
    protected-mode yes ---> protected-mode no
    daemonize no ---> daemonize yes # Runs as a background program by default, no need
    to add & force the background to run
    port 6379 ---> port 7379  # Change the port number to 7379
    pidfile /var/run/redis_6379.pid ---> pidfile /var/run/redis_7379.pid  #  Change the
    port number to 7379
    # requirepass foobared ---> requirepass 123456  # 123456 is the password can be
    replaced at will
    maxmemory 4294967296  # Configure memory to 4G unit is byte,
    can also be configured to other sizes, the recommended size is 4G (need to add content)
    maxmemory-policy allkeys-lru # Expiration policy,
    LRU Least Recent Use algorithm (content to be added)

    2.5 Starting Redis

    cd /usr/redis/redis-5.0.4/src #Go to the src directory
    ./redis-server /usr/redis/redis-5.0.4/redis.conf #Specify the configuration
    file when starting Redis
    redis-cli -p port -a password #Local start Redis client,
    you can view key values, delete key values, check redis status and other operations

    3. Operations and maintenance knowledge

    cd /usr/redis/redis-5.0.4/src #Go to the src directory
    . /redis-server /usr/redis/redis-5.0.4/redis.conf #Specify the configuration file
    when starting Redis
    redis-cli -p port -a password #Local start Redis client, you can view key values,
    delete key values, check redis status, etc.
    redis-cli -p port -a password shutdown #Stop redis
    redis-cli -h ip -p port -a password #Remotely connect to the Redis service,
    ip and port are the Redis service to connect to

    For more information on operations and maintenance, see: Redis Operations and Maintenance Manual for Linux


    Attachment List


    Theme: Deployment Integration
    Already the First
    Already the Last
    • Helpful
    • Not helpful
    • Only read

    售前咨询电话

    400-811-8890转1

    在线技术支持

    在线QQ:800049425

    热线电话:400-811-8890转2

    总裁办24H投诉

    热线电话:173-1278-1526

    文 档反 馈

    鼠标选中内容,快速反馈问题

    鼠标选中存在疑惑的内容,即可快速反馈问题,我们将会跟进处理。

    不再提示

    10s后关闭