Master-slave Redis configuration in Linux

Source: Internet
Author: User
Tags download redis redis cluster install redis

Master-slave Redis configuration in Linux

1. Download redis-2.8.24.tar.gz at http://redis.io/download.

2.decompress redis-2.8.24.tar.gz and install

Tar xvf redis-2.8.24.tar.gz
Mv redis-2.8.24/usr/local/cd/usr/local/redis-2.8.24make
Make install # copies redis commands to the/usr/local/bin directory.

3. Create a redis user and data storage directory

useradd -s /sbin/nologin -d /var/lib/redis redismkdir /data0/redischown redis.root /data0/redis

4. Copy the redis. conf file to the/etc directory and modify the file.

Modify the configuration file redis. conf on the master server

Daemonize yes # Start in the background
Port 6379 # port
Bind 127.0.0.1 # bind an IP address
Loglevel notice # The Log Level
Logfile/data0/redis. log # log File
Dir/data0/redis # data storage directory
Requirepass 123456 # Set the password

Modify the configuration file redis. conf from the server

Daemonize yesport 6380 slaveof 172.16.59.180 6379 bind 127.0.0.1
Loglevel notice
Logfile/data0/redis. log
Dir/data0/redis
Requrequirepass 123456
Masterauth 123456 # master server configuration Password

5. Start the redis service on the Master/Slave Server

redis-server /etc/redis.conf

You may also like the following articles about Redis. For details, refer:

Install and test Redis in Ubuntu 14.04

Basic configuration of Redis master-slave Replication

Redis cluster details

Install Redis in Ubuntu 12.10 (graphic explanation) + Jedis to connect to Redis

Redis series-installation, deployment, and maintenance

Install Redis in CentOS 6.3

Learning notes on Redis installation and deployment

Redis. conf

Redis details: click here
Redis: click here

This article permanently updates the link address:

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.