memcached cluster master-slave
来源:互联网 发布:js获取app版本号 name 编辑:程序博客网 时间:2024/06/05 20:34
When I was looking for ways to replicate the contents of memcached for high-availability performance, I found thismemcached-repcached application. that has the ability to replicate the contents of one memcached to another.
Repcached key features
- Multi master replication.
- Asynchronous data repliacation.
- Support all memcached command (set, add, delete, incr/decr, flush_all, cas)
People probably already know about memcached . It’s a robust, high performance key-value based memory object cache interface. but unfortunately, lack the ability to create redundancy and replication in memcached server clusters. although replication could be done at the application level. However, it all depends on each individual’s taste.
This is a quick and dirty experiment I have tried using memcached-repcached application on 2 servers.
Download memcached-repcached from repcached.lab.klab.org
Or you can download source rpm version from here
memcached-1.2.8-repcached-2.2-1.src.rpm (104)
On the first server and second server extract memcached-1.2.8-repcached-2.2.tar.gz, compile with–enable-replication option when configure.
$
tar
xvzf memcached-1.2.8-repcached-2.2.
tar
.gz
$
cd
memcached-1.2.8-repcached-2.2
$ .
/configure
--
enable
-replication
$
make
On the first server, while still being in the directory when doing the compilation, run this command
[first server]$ .
/memcached
-u nobody -l 192.168.1.1 -p 22122 -m 64 -x 192.168.1.2 -
v
replication: connect (peer=192.168.1.2:11212)
replication: marugoto copying
replication: close
replication: listen
On the second server, also run this command
[second server]$ .
/memcached
-u nobody -l 192.168.1.2 -p 22122 -m 64 -x 192.168.1.1 -
v
replication: connect (peer=192.168.1.1:11212)
replication: marugoto copying
replication: start
Now, let’s try to simulate the process of replication on both memcached server.
[third server]$ telnet 192.168.1.1 22122
Trying 192.168.1.1...
Connected to 192.168.1.1.
Escape character is
'^]'
.
set
hey 0 0 4
dude
STORED
get hey
VALUE hey 0 4
dude
END
quit
Connection closed by foreign host.
We stored a value “dude” with the key “hey” and verified with “get hey” command.
Now connecting to the second memcached server.
[third server]$ telnet 192.168.1.2 22122
Trying 192.168.1.2...
Connected to 192.168.1.2.
Escape character is
'^]'
.
get hello
VALUE hello 0 5
world
END
quit
Connection closed by foreign host.
We got the same result on a second memcached server. recent memcached-repcached only capable for 2 node replication setup only. but it was pretty good.
- memcached cluster master-slave
- activemq--MASTER SLAVE+BROKER CLUSTER 实践(一)
- activemq--MASTER SLAVE+BROKER CLUSTER 实践(二)
- Apache ActiveMQ Cluster Master and Slave with JDBC
- Redis重要概念Master-Slave、Sentinel、Partition、Cluster
- master-slave
- Master-Master Master-slave 区别
- 使用3组Master-Slave群集模拟一个Cluster模式的群集
- redis cluster slave msg
- 应用memcached构建支持Master/Slave读写分离的数据库操作类
- Keepalived+Master-Master-Slave组合
- MySQL Master-Slave Replication
- master-slave自动切换
- MYSQL-master-slave实践
- ActiveMq master/slave
- Jenkins Master/Slave架构
- mysql模式:master/slave
- mysql master slave 配置
- 继承和类类型转化
- ashx 中文乱码 需要加入以下配置
- Myeclipse中,打开Tomcat解决Unauthorized
- fullcalendar-1.5.1 日程管理应用
- 环路测试法诊断ISDN故障
- memcached cluster master-slave
- 使用URL和URLConnection
- 第四章 类和函数:设计与声明(Effective C++ Second Edition 读书笔记)
- 中国式危机公关9加1策略(第十四章 国外危机应对案例参考)
- jQuery动态改变图片显示大小(修改版)
- 多样化实现Windows Phone 7本地数据库访问<上>
- APP热潮来临 图解九种商业模式
- 第2题 求子数组最大和
- CentOS5.7 yum软件源的问题