memcached 集群
master 192.168.162.128
yum -y install libevent-devel
wget
tar zxf memcached-1.2.8-repcached-2.2.tar.gz
cd memcached-1.2.8-repcached-2.2
wget
gzip -d repcached-2.2-1.2.8.patch.gz
patch -p1 < repcached-2.2-1.2.8.patch
./configure --prefix=/usr/local/memcached --enable-replication
make
make install
/usr/local/memcached/bin/memcached -p 11211 -l 192.168.162.128 -u root -d -v -m 2048 -P /var/run/memcached.pid
slave 192.168.162.129
yum -y install libevent-devel
wget
tar zxf memcached-1.2.8-repcached-2.2.tar.gz
cd memcached-1.2.8-repcached-2.2
wget
gzip -d repcached-2.2-1.2.8.patch.gz
patch -p1 < repcached-2.2-1.2.8.patch
./configure --prefix=/usr/local/memcached --enable-replication
make
make install
/usr/local/memcached/bin/memcached -p 11211 -l 192.168.162.129 -u root -d -v -m 2048 -P /var/run/memcached.pid -x 192.168.162.128 -X 11212
###memcached-repcached确实可以相互复制,而且在局域网中复制的速度几乎是实时的,相互之间通过11212 的端口(可改变)进行监听并复制。
##但是建立主从复制之前必须保证网络通畅,如果出现连接不了,不能完成相互复制。
##另外,当master失败后,slave将自动上升为master,单原先的master重新加入网络后,只能加-X 参数来监听原先slave。
阅读(500) | 评论(0) | 转发(0) |