Linux installation Redis

Source: Internet
Author: User

1. Download:

# wget http://download.redis.io/releases/redis-4.0.10.tar.gz

2. Unzip:

# tar ZXVF redis-4.0.10.tar.gz

3. Installation:

# CD redis-4.0.10/

# make

Error 1:

      

Reason:

Redis installation relies on the GCC service

Solve:

# yum Install gcc

      

    Error 2:

      

Reason:

# VI Readme.md

      

Use Jemallo Allocator by default

Solve:

Specify the make parameter to use the LIBC allocator:

# Make MALLOC=LIBC

      

4. Start: 4.1 Start:

#./src/redis-server

    

Open a new server connection:

    

4.2 Connections:

# cd/usr/local/src/redis-4.0.10/src/

#./redis-cli

    

4.3 Close:

#./REDIS-CLI shutdown

     

5. Configuration: 5.1 By default, Redis is not running in the background and we need to put Redis in the background:

# VI Redis.conf

Change the value of daemonize to Yes

Start the specified configuration file:

#./redis-server. /redis.conf

    

5.2 Enable Redis to start:

    

# vi/etc/rc.local

File Trailer added:

/usr/local/src/redis-4.0.10/src/redis-server/usr/local/src/redis-4.0.10/redis.conf

      

To restart the server test:

    

5.3 Add authentication, set Password:

# VI.. /redis.conf

    

Change # Requirepass foobared to:

Requirepass nriet123

    

5.4 Specifies the IP to which Redis can be accessed (default bind 127.0.0.1, only native access):

# VI.. /redis.conf

    

Comment out bind 127.0.0.1 (Unrestricted IP access)

      

6. Rdb and aof Persistence:

Redis default RDB persisted data

RDB persisted data trigger condition

Save 900 1 15 minutes at least one key has been changed

Save 300 10 5 minutes with at least 10 keys changed

Save 60 10000 1 minutes with at least 10,000 keys changed

dir/usr/clz/redis-4.0.9/databak/: Specifying a persisted file path

Dbfilename Dump.rdb: Specify RDB Persistence mode file

Appendfilename "appendonly.aof": Specifies the AOF persistence mode file

AppendOnly Yes: Open aof persistence mode (default AppendOnly No)

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.