CentOS 7 install redis 5.X

  1. Download redis

    wget  http://download.redis.io/releases/redis-5.0.5.tar.gz 
  2. Create a folder redis

    cd /usr/local   
    mkdir redis
  3. Decompression

    cd ~
    tar -xzvf redis-5.0.5.tar.gz  -C /usr/local/redis
  4. Compile it into the directory, compiled with the order to make

    cd /usr/local/redis
    make
  5. At this point error

    compilation terminated.
    make[1]: *** [adlist.o] Error 1
    make[1]: Leaving directory `/usr/local/redis-5.0-rc3/src'
    make: *** [all] Error 2
  6. Installation Development Tools

    yum groupinstall 'Development Tools'
  7. Wrong or reported above, the solution is as follows

    cd /usr/local/redis/redis-5.0.5/deps 
    make Fredis lua jemalloc linenoise
  8. And then go make the implementation of the compiler, the following appears content that is success

    Hint: It's a good idea to run 'make test' ;)

    make[1]: Leaving directory `/usr/local/redis/redis-5.0.5/src'
  9. The next /redis-5.0.5/src directory

    make install
  10. Modify the configuration file redis.conf

    vim /usr/local/redis/redis-5.0.5/redis.conf

    Only a few can be adjusted as follows

    protected-mode no # close protection mode, in order to avoid redis be accessed in the public need to open protected mode, if you learn to turn off 
    daemonize yes # daemon mode is turned on, can run in the background after starting
    commented bind 127.0.0.1 # this configuration By default only the native access, comment out the need to access other machines
  11. Start redis

    /usr/local/redis/redis-5.0.5/src/redis-server /usr/local/redis/redis-5.0.5/redis.conf
  12. In fact, under the command will copy a few to the next src / usr / local / bin in the implementation of make install, you can also use the following command to start redis

    /usr/local/bin/redis-server /usr/local/redis/redis-5.0.5/redis.conf
  13. Check to see if the port started successfully

    netstat -ltnp | grep 6379
  14. Try to connect, execute the following command in any directory

    redis-cli

    Why you can execute in any directory it? Because redis-cli command in / usr / local / bin directory, and the directory and configured in the PATH, so you could execute like ls, mkdir command, etc. to perform redis-cli or redis-server commands.

Guess you like

Origin www.cnblogs.com/wen-xin/p/11823709.html
Recommended