Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Detailed explanation of memcache Master-Slave Architecture

2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Repcached is a Japanese development to achieve memcached replication function, it is a single master single slave scheme, but its master/slave is read and write, and can be synchronized with each other, if the master is broken, slave detects that the connection is broken, it will automatically listen and become master;; if the slave is broken, master will also detect the connection break, it will re-listen and wait for the new slave to join

First of all, you need to do this on a machine that already has memcache. If you don't have memcache installed, please see the previous documentation; the following software needs to be installed on both master and slave.

Download the corresponding repcached version

Wget http://downloads.sourceforge.net/repcached/memcached-1.2.8-repcached-2.2.tar.gz

Tar zxf memcached-1.2.8-repcached-2.2.tar.gz

Cd memcached-1.2.8-repcached-2.2

Download the corresponding patch version

Wget http://downloads.sourceforge.net/repcached/repcached-2.2-1.2.8.patch.gz

Gzip repcached-2.2-1.2.8.patch.gz

. / configure-enable-replication

Make

Make install

# Note that the unzipped files of repcached-2.2-1.2.8.patch.gz should be placed in the memcached-1.2.8-repcached-2.2 folder.

Start master

/ usr/local/bin/memcached-v-l 192.168.1.200-p11211-uroot

Start salve

/ usr/local/bin/memcached-v-l 192.168.0.163-p11213-uroot-x 192.168.0.160-X 11212

The ip address of the #-x master side.-X specifies the port they use to copy.

Test to see if it is normal:

Connect to the master end of memcached in telnet

Enter set key1 0 0 3

one hundred and eleven

Telnet connects to Slave:

Enter whether the get key1 will appear the value just set on the master side

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report