Virtual machine linux installation redis implementation process analysis

  • 2020-10-23 20:20:55
  • OfStack

redis website


Installation steps

1. Download redis from the weget command at the bottom of the official website

Then, if you guessed right, you would make an error on the make command

Since redis is written by C, you need to install c's runtime environment

yum install gcc-c++

And then you might get an error

redis compilation appears zmalloc.h :50:31: fatal error: jemalloc/ jemalloc.h: Does not have that file or directory

All you need to do is compile the make MALLOC=libc command

Then if the make command is ok, follow the prompt to execute 1 make test - this will detect if you have a problem with the current installation

Then you might make the following mistake


hadoop@stormspark:~/workspace/redis2.6.13/src$ make test
You need tcl 8.5 or newer in order to run the Redis test
make: *** [test] Error 1


Note that the make test command takes a while to execute

2. After the completion of make, the compiled redis service program redis-ES74en and the test client program ES75en-ES76en will appear under the version number of redis-directory. The two programs are located in the installation directory src:

Now start the redis service.

 $ cd src
 $ ./redis-server
  Notice how it starts redis  The default configuration is used. You can also tell by startup parameters redis Start using the specified configuration file using the following command. 

 $ cd src
 $ ./redis-server ../redis.conf
 redis.conf  is 1 A default configuration file. We can use our own configuration files as needed. 

  Start the redis After serving the process, you can use the test client program redis-cli and redis The service is interacting ( You need to turn it on again 1 A terminal ) .   Such as: 

 $ cd src  (cd to redis Under the installation directory )
 $ ./redis-cli
 redis> set foo bar
 redis> get foo ( That's when it comes up redis running ip address )

Install the specified directory


redis specifies the directory installation
make PREFIX=/usr/local/redis install # installs in the specified directory


Note that in the last line above, we specify the installation directory through PREFIX, and we can copy the original unzipped ES100en-ES101en folder into the installation directory

Start and close commands


Launch: ES108en-ES109en /opt/ ES111en-ES112en/ES113en.ES114en

Close: ES117en-ES118en shutdown or kill pid for kill redis process


Related articles: