Redis compilation process under Linux

background

Today I got Redis compilation and sorted out the compilation process. In theory, it is also possible to directly upload the compiled bin directory, but it may be related to the operating system version, so it is safer to compile it on the target machine on the spot. The version 3.2.8 of two years ago is still used here, but the latest version has reached 6.6, the iteration speed is too fast!

Compile

Insert picture description here
There are two errors:
error one, file permissions under the src directory, solutions:

cd /src
chmod 770 *

The second error is to set the memory fragment library. The jemalloc memory allocator is not installed on the target machine, you can use libc instead:

make MALLOC=libc

Re-execute the command: the
Insert picture description here
compilation is successful.

test

Insert picture description here
Lack of tcl8.5 dependency package, continue to install dependencies and re-execute:
Insert picture description here

installation

Execute the installation command and pass the target directory

make install PREFIX=/usr/local/redis3.2.8 

/usr/local/redis3.2.8 is the target installation directory. After the execution is complete, the bin directory is generated, indicating success.
Insert picture description here

Copy configuration file to start

After compilation, there is only one bin directory and no configuration file. You need to copy the redis.conf of the source directory and use it as the startup file after modification. There are three main modifications:

  1. IP: local port or 0.0.0.0
  2. Authentication password: requirepass
  3. Background process start: daemonize yes

Execute redis-server ./redis.conf in the bin directory.

Guess you like

Origin blog.csdn.net/wojiushiwo945you/article/details/109443179