Redis5 version under CentOS7 (1) stand-alone installation and configuration

System version: centOS7

Redis installation version: Redis- 5.0.5

1. Redis download

* Official website address: http://redis.io/

* Chinese official website address: http://www.redis.cn/

* Download link: http://download.redis.io/releases/

2.Redis installation

  • Step 1: Install the GCC environment required by the C language
yum install gcc-c++
  • Step 2: Create the app directory in the usr/local directory and upload the Redis compressed package to this directory
  • Step 3: Unzip the Redis source code compression package
tar -zxf redis-5.0.5.tar.gz
  • Step 4: Compile the Redis source code, enter the redis-5.0.5 directory, and execute the compile command
make
  • Step 5: To install Redis, you need to specify the installation path through PREFIX
make install PREFIX=/usr/local/redis

3. Redis start

Frontend start

  • Start command: redis-server , directly run bin/redis-server will start in front-end mode.
./redis-server
  • Close command: ctrl+c

Disadvantages of startup: the redis-server program ends when the client window is closed. This method is not recommended

Start the legend:

Backend start

  • Step 1: Copy the redis-5.0.5/redis.conf configuration file to the bin directory of the Redis installation directory
cp redis.conf /usr/local/redis/bin/
  • Step 2: Modify redis.conf, change daemonize from no to yes
vim redis.conf

Will bind 127.0.0.1 commented

protected-mode yes Whether to open the protection mode, from yes to no

  • Step 3: Start Redis to execute commands
./redis-server redis.conf
  • Step 4: Visit Redis
./redis-cli

 

Guess you like

Origin blog.csdn.net/java_cxrs/article/details/97616193