Linux installation configuration detailed steps Redis

In the installation configuration Redis CentOS 8.1

1.Redis install
1.1 Redis Download
Official Download: http: //redis.io/download can download different versions as needed.
1.2 install gcc
Redis is written in C language development, installation Redis need to first download the official source code is compiled, the compiler dependent gcc environment, if there is no gcc environment, you need to install gcc
Here Insert Picture Description
gcc installation is very simple, we must first ensure that the root login, followed by Linux to be able to connect to external networks.
yum -y install gcc automake autoconf libtool make
note: /var/run/yum.pid when you run yum has been locked, PID is another problem xxxx running programs to solve.
-f /var/run/yum.pid RM
1.3 Redis mounted
in Linux Download Redis
http://download.redis.io/releases/redis-4.0.1.tar.gz wget
extract the download file
tar zxvf redis-4.0 .1.tar.gz
enter the download file and its compilation
cd-Redis 4.0.1
the make or make MALLOC = libc
following figure represents the success:
Here Insert Picture Description
the installation files compiled refer to the installation directory:
(Note: PREFIX must be capitalized, and it will redis directory is automatically created for us, and the result of this installation directory)
the make PREFIX = / usr / local / install redis
View
cd / usr / local / redis
View the bin directory, as shown:
Here Insert Picture Description

2 Start Redis
2.1 Redis server starts
entering the corresponding installation directory
/ usr / local / redis
Run
./bin/redis-server
Here Insert Picture Description
2.2 Redis start the client
enters Redis kefuduan (Clone Session clone a window):
enter the corresponding installation directory
cd / usr / local / redis
execute the command:
./bin/redis-cli
Here Insert Picture Description
start the Redis client command :('ll explain later)
Redis-cli -h IP address -p port
exit client command: Ctrl + C

Detecting whether the server start:
Start redis client, open a terminal and enter the command redis-cli, the command will connect local redis service.
Redis-cli $
Redis 127.0.0.1:6379>
Redis 127.0.0.1:6379> PING
PONG

3 Linux configuration Redis
Redis Redis configuration file located in the installation directory, the file name redis.conf
3.1 configuration Redis
Redis port number or start with a default configuration. But in general we will manually configured, back to the root directory to find the unpacked file reids.conf
Here Insert Picture Description
command: cp redis.conf / usr / local / redis copy the configuration file to the directory where the installation files under
Here Insert Picture Description
3.2 custom configuration Redis
3.2. 1 into the corresponding mounting directory / usr / local / redis
modify redis.conf Vim redis.conf profile (look up the corresponding strings into command mode by / content)
3.2.2 the Redis must modify the default configuration:
to daemonize NO Yes modify to daemonize
the bind 127.0.01 commented
requirepass set a password
(single-process multi-threaded mode Redis used when redis.conf daemonize option set to yes, on behalf of open daemon mode. in this mode, redis runs in the background and the process pid number is written to redis.conf options pidfile settings file, then redis will always run, unless manually kill the process. but daemonize option is set to no, the current interface will enter redis command line interface, exit Force quit or close the connection tool (putty, xshell, etc.) will result in redis process to exit. most server applications are developed By running in the background mode)

4 Redis start

4.1 server start
./bin/redis-server ./redis.conf
4.2 client startup
4.2.1 Local client starts
landing redis-cli password (redis-cli -a password)
4.2.2 remote server starts
redis-cli Host port -a -p password -h
(Redis-cli -a -h IP address -p port password)

5 Redis Close

./bin/redis-cli shutdown

Published an original article · won praise 14 · views 120

Guess you like

Origin blog.csdn.net/m0_46525376/article/details/105178924