twemproxy

安装

1. 获取安装包

shell> wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz
shell> wget https://codeload.github.com/twitter/twemproxy/zip/master
#twemproxy要求autoconf的版本在2.64以上

2. 编译安装

shell> unzip ./twemproxy-master.zip

shell> tar -zxvf ./autoconf-2.69.tar.gz

shell> cd ./autoconf-2.69

shell> ./configure --prefix=/usr/

shell> make && make install

shell> /usr/bin/autoconf -V
autoconf (GNU Autoconf) 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+/Autoconf: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>, <http://gnu.org/licenses/exceptions.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Written by David J. MacKenzie and Akim Demaille.

shell> cd twemproxy-master shell> autoreconf -fvi

shell> configure.ac:36: error: possibly undefined macro: AC_PROG_LIBTOOL
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation. shell> yum -y install libtool
shell> autoreconf -fvi
shell> ./configure --prefix=/usr/local/twemproxy 

shell> make -j `grep processor /proc/cpuinfo | wc -l` 

shell> make install

3.增加配置文件

shell> cd /usr/local/twemproxy

shell> cat > /usr/local/twemproxy/nutcracker.yml << EOF

memcache:

  listen: 0.0.0.0:

  hash: fnv1a_64

  distribution: ketama

  auto_eject_hosts: true

  redis: false

  timeout: 

  server_retry_timeout: 

  server_failure_limit: 

  servers:

   - 172.18.18.52::

   - 172.18.18.53::

   - 127.18.3.11::

   - 172.18.3.12::

   #- 172.18.3.4::

   #- 172.18.3.7::

EOF

4. 启动服务

shell> vi /etc/sysconfig/iptables

shell> -A INPUT -m state --state NEW -m tcp -p tcp  --dport  -j ACCEPT #开放防火墙端口11210

shell> /etc/init.d/iptables restart

shell> nutcracker -t #测试配置文件

shell> /usr/local/twemproxy/sbin/nutcracker -d -c /usr/local/twemproxy/nutcracker.yml #指定配置文件启动

5.启动命令详解

Usage: nutcracker [-?hVdDt] [-v verbosity level] [-o output file]
[-c conf file] [-s stats port] [-a stats addr]
[-i stats interval] [-p pid file] [-m mbuf size]
参数 释义
-h, –help 查看帮助文档,显示命令选项
-V, –version 查看nutcracker版本
-t, –test-conf 测试配置脚本的正确性
-d, –daemonize 以守护进程运行
-D, –describe-stats 打印状态描述
-v, –verbosity=N 设置日志级别 (default: 5, min: 0, max: 11)
-o, –output=S 设置日志输出路径,默认为标准错误输出 (default: stderr)
-c, –conf-file=S 指定配置文件路径 (default: conf/nutcracker.yml)
-s, –stats-port=N 设置状态监控端口,默认22222 (default: 22222)
-a, –stats-addr=S 设置状态监控IP,默认0.0.0.0 (default: 0.0.0.0)
-i, –stats-interval=N 设置状态聚合间隔 (default: 30000 msec)
-p, –pid-file=S 指定进程pid文件路径,默认关闭 (default: off)
-m, –mbuf-size=N 设置mbuf块大小,以bytes单位 (default: 16384 bytes)

Twemproxy是一种代理分片机制,由Twitter开源。Twemproxy作为代理,可接受来自多个程序的访问,按照路由规则,转发给后台的各个Redis服务器,再原路返回。

twemproxy 安装的更多相关文章

  1. twemproxy 安装与配置

    转自:http://blog.csdn.net/u011183653/article/details/21240749 说到twemproxy就不得不说要一下redis,这是因为twemproxy是为 ...

  2. Twemproxy 缓存代理服务器

    Twemproxy 缓存代理服务器 Twemproxy 概述 Twemproxy(又称为nutcracker)是一个轻量级的Redis和Memcached代理,主要用来减少对后端缓存服务器的连接数.T ...

  3. 基于Twemproxy的Redis集群方案

    概述 由于单台redis服务器的内存管理能力有限,使用过大内存redis服务器的性能急剧下降,且服务器发生故障将直接影响大面积业务.为了获取更好的缓存性能及扩展型,我们将需要搭建redis集群来满足需 ...

  4. Redis/SSDB+Twemproxy的配置与使用(Mac/Linux平台)

    对于redis而已,相信不少的后台开发人员一直都在使用,相比memcache而已,redis不仅可以作为key-value缓存使用,而且提供了丰富的数据结构如set.list.map等,能够实现很多复 ...

  5. 基于 twemproxy 搭建 redis 集群

    概述 由于单台redis服务器的内存管理能力有限,使用过大内存redis服务器的性能急剧下降,且服务器发生故障将直接影响大面积业务.为了获取更好的缓存性能及扩展型,我们将需要搭建redis集群来满足需 ...

  6. Twemproxy分析

    twemproxy(又称为nutcracker)是一个轻量级的Redis和Memcached代理,主要用来减少对后端缓存服务器的连接数. 由Twitter开源出来的缓存服务器集群管理工具,主要用来弥补 ...

  7. TwemProxy Redis架构

    TwemProxy 1.twemproxy是twitter开发的一个redis代理proxy. 通过Twemproxy可以使用多台服务器来水平扩张redis服务,可以有效的避免redis单点故障问题. ...

  8. Redis Twemproxy

    主从复制+哨兵解决了读性能和高可用问题,但没有解决写性能问题. Twemproxy将写请求分配到不同节点处理. Twemproxy是Twitter开源的一个redis和memcache代理服务器. 允 ...

  9. 基于twemproxy的redis集群部署

    一.系统及软件版本 操作系统:CentOS Linux release 7.3.1611 (Core) 内核版本:3.10.0-514.el7.x86_64 redis版本:3.2.8 twempro ...

随机推荐

  1. jdk8永久代从方法区移除的验证

    /*** 测试使用jdk8中是否仍然可以使用永久代* jvm options * -Xms20m -Xmx20m -Xmn10m -XX:PermSize=10m -XX:MaxPermSize=10 ...

  2. 使用dom4j生成xml字符串,以及解析xml字符串

    基于dom4j-1.6.1.jar import java.io.IOException; import java.io.StringWriter; import java.util.ArrayLis ...

  3. CSS浮动属性Float详解

    什么是CSS Float? float 是 css 的定位属性.在传统的印刷布局中,文本可以按照需要围绕图片.一般把这种方式称为“文本环绕”.在网页设计中,应用了CSS的float属性的页面元素就像在 ...

  4. 不建议用wxWidgets,底层有过多的bug

    不建议用wxWidgets, 搞了wxWidgets 3年,不是所说的那么容易跨平台,很多bug,不稳定, 莫名其妙的崩溃找源代码修改编译真是费时费力. 开发速度真没有使用本地sdk开发高, 很难定制 ...

  5. 网络编程中几个地址结构与转换(in_addr,sockaddr,sockaddr_in,pcap_addr)

    man socket可以查看相关信息. socket头文件: #include <sys/types.h> /* See NOTES */ #include <sys/socket. ...

  6. python调用shell, shell 引用python

    python 调用 shell get_line_num="wc -l as_uniq_info | awk '{print $1}'" ###get the lines of & ...

  7. VS2013单元测试

    原文地址:http://www.luacloud.com/2014/vs2013-unit-test-generator.html 下载地址:http://visualstudiogallery.ms ...

  8. java模拟http post

    我们将使用java.net.URLConnection来完成一次post请求,假设要post数据到http://localhost:8080/doSome上: URLConnection urlCon ...

  9. guestmount

    guestmountFor some types of changes, you may find it easier to mount the image's file system directl ...

  10. Apache HttpComponents Client 4.0快速入门/升级-2.POST方法访问网页

    Apache HttpComponents Client 4.0已经发布多时,httpclient项目从commons子项目挪到了HttpComponents子项目下,httpclient3.1和 h ...