Install Redis and related environment configuration under Linux

Preface

Redis is an open source log-type, Key-Value database that is written in ANSI C language, complies with the BSD protocol, supports the network, can be based on memory and can be persisted, and provides APIs in multiple languages.

Official website  https://redis.io/

Redis command reference  http://doc.redisfans.com/

 

installation steps

1. Download the source code

cd /opt
wget http://download.redis.io/releases/redis-4.0.12.tar.gz

 2. Unzip the source code

 tar -zxvf redis-4.0.12.tar.gz 

3. Installation dependent environment

yum install gcc-c++

4. Rename

mv redis-4.0.12 redis

5. Compile

cd /opt/redis
make
make install PREFIX=/opt/redis

6. Modify the configuration file (set background startup, password)

 vi redis.conf 

  In the English input state, press i to enter the insert mode, modify the following configuration, and others remain unchanged. newpass is the current redis password

daemonize yes
requirepass newpass
#bind 127.0.0.1

  Press esc to enter  : wq  save and exit  

7. Copy the configuration file to the bin directory

cp redis.conf  bin/

8. Start

  redis directory /opt/redis

cd bin/
./redis-server redis.conf

9. Process View

 ps -ef|grep redis

kill -9 pid can close the redis process, the current pid is 25796

10. Client Connection

Set up firewall rules

 

 

Guess you like

Origin blog.csdn.net/javanbme/article/details/111591083