中间件之Twemproxy Redis

1.首页

https://github.com/twitter/twemproxy

2.安装

 2.1 autoconf

 2.2 automake

 2.3 libtool

具体的安装步骤在首页写的很清楚

3.测试数据

 配置文件:

alpha:
 listen: 192.168.137.129:22121
 hash: fnv1a_64
 distribution: random
 auto_eject_hosts: true
 redis: true
 server_retry_timeout: 2000
 server_failure_limit: 1
 servers:
  - 127.0.0.1:6378:1 master1
  - 127.0.0.1:6379:1 master2

distribution:

  • ketama
  • modula
  • random

4.控制端监控结果

curl 192.168.137.129:22222
{"service":"nutcracker", "source":"localhost", "version":"0.4.1", "uptime":77, "timestamp":1442203303, "total_connections":53, "curr_connections":3, "alpha": {"client_eof":0, "client_err":0, "client_connections":50, "server_ejects":0, "forward_error":0, "fragments":0, "master1": {"server_eof":0, "server_err":0, "server_timedout":0, "server_connections":1, "server_ejected_at":0, "requests":47332, "request_bytes":2129940, "responses":47332, "response_bytes":236660, "in_queue":0, "in_queue_bytes":0, "out_queue":0, "out_queue_bytes":0},"master2": {"server_eof":0, "server_err":0, "server_timedout":0, "server_connections":1, "server_ejected_at":0, "requests":47796, "request_bytes":2150820, "responses":47796, "response_bytes":238980, "in_queue":0, "in_queue_bytes":0, "out_queue":0, "out_queue_bytes":0}}}

注意:如果在同一台服务器安装多个Twemproxy,需要配置不同的监控端口

5.结论

  5.1 支持大部分的Redis操作

  5.2 程序是用C语言编写,速度那应该不是问题

  5.3 日志感觉不是很明细,更多的是靠网上查询才知道是什么问题

  

其他有待实际测试使用……

相关推荐