Linux installation Redis

Source: Internet
Author: User
Tags redis server

First, installation

1. Adding a compilation installation Environment GCC:yum install gcc-c++

2, Upload Redis (redis-3.2.9.tar.gz) to any directory, my side upload to the/root directory

3, decompression Redis (after decompression in the current directory more than one redis-3.2.9 directory): TAR-ZXVF redis-3.2.9.tar.gz

4. Compile Redis (compile. C to. O)

    • CD redis-3.2.9
    • Execution: make

5. Installation: Make Prefix=/usr/local/redis install

If the installation directory does not exist, it is automatically created

6. Copy the configuration file to the installation directory CP redis.conf/usr/local/redis/(this step if omitted, but Redis will go through the default configuration)

Second, the front-end start

1. Enter the installation directory:cd/usr/local/redis/bin/

2. Open Redis Server:./redis-server

3. Open a Linux window and open the client (./redis-cli-h 127.0.0.1-p 6379)

./REDIS-CLI (default connection local 6379 interface)

Third, back-end start

1, modify the configuration file VI redis.conf

Change Daemon daemonize No to daemonize Yes

2, open the service./bin/redis-server./redis.conf

View process Ps-ef at this time | Grep-i Redis, you can see

Note: Here we will find that when we open the server or client, we need to specify the Redis specific directory, in fact, we can configure Redis as an environment variable, you can open the Redis anywhere

1. Modify the configuration environment variable vim ~/.bash_profile

Export Redis_home=/usr/local/redis

Export path= $PATH: $REDIS _home/bin

2. Reload the configuration file:source ~/.bash_profile

Linux installation Redis

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.