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
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
compilation is successful.
test
Lack of tcl8.5 dependency package, continue to install dependencies and re-execute:
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.
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:
- IP: local port or 0.0.0.0
- Authentication password: requirepass
- Background process start: daemonize yes
Execute redis-server ./redis.conf in the bin directory.