Redis install redis under Linux

1. Download the installation package

  1. Download the package on the redis official website Redis CRUG website
  2. Direct wget package wget in the virtual machine https://github.com/redis/redis/archive/{7.0-rc2.tar.gz }

Tips: You can use the following command to download the latest version.

wget https://download.redis.io/redis-stable.tar.gz

Execute the command and download the file

Download the file and view the result

2. Unzip the installation package to the directory to be installed

tar -zvxf { 7.0-rc2.tar.gz }

unzip files

Successfully decompressed

Move to the directory to be installed 

Tips: You can also directly decompress the command line to the specified directory (tar -zvxf 7.0-rc2.tar.gz -C /usr/local/redis).

3. Compile the file

make

 It takes a while to compile (note that the directory is in the decompressed directory)

 4. Install

make PREFIX={path} install

By specifying the installation path through PREFIX, you can avoid placing the execution file in the /usr/local/bin directory, the library file in the /usr/local/lib directory, the configuration file in the /usr/local/etc directory, and other resources in / usr/local/share directory. After specifying the path, it can be easily uninstalled.

 5. Start redis and test whether it starts successfully

View executable file directory

Start the server through redis-server (specify the redis.config configuration file, you can specify a custom configuration file)

Start the client through redis-cli

Create a new session (set the "whether to keep" attribute in the file)

Determine whether the connection is successful by the result returned by the ping command

Check the process mode, whether there is a redis process

ps -aux | grep redis

Listening port mode, whether there is a configured redis port (the port will be related to the configuration in the configuration file)

6. Create a process

 

Detailed installation information can be viewed on the official website:  Installing Redis | Redis

Guess you like

Origin blog.csdn.net/qq_57226198/article/details/130175381