Configure master-slave replication for redis, and configure master-slave for redis

Source: Internet
Author: User

Configure master-slave replication for redis, and configure master-slave for redis
Configure master-slave replication for redis master-slave Replication

./Redis-server command. If no parameter is appended, it starts the redis service according to the default configuration. In fact, it can also be appended with a configuration file path parameter. There is a redis. conf file under the redis root directory, which can be used directly to configure the startup server

./redis-server ./redis.conf

Windows corresponds

    redis-server.exe redis.windows.conf

Start the server

Master

Slave-1

Slave-2

Start the client

Configure the master-slave relationship

The master Address is 127.0.0.1, and the port number is 6379.
Run the following command under two slave clients:

     SLAVEOF 127.0.0.1 6379

Some log information that can be viewed
Master

Slave-01

Slave-02

Test

Set some test values on the master node.

    set weixuan hello    set testkey testvalue

Test on slave to see if data can be obtained

Slave-01 logs

Slave-02 logs

Principle Error

An error occurred while obtaining data from slave due to insufficient disk space, but no reason was found and no other error message was reported.

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

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.