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. 用异提交时,后台通过校验规则文件,校验不通过时,跳转到INPUT视图时,前台显示错误信息的解决办法

    1.第一种: 最近项目使用了struts2的校验(其实我觉得后台校验,特别是struts的校验,完全可以放在其他地方处理,比如交给js或者业务逻辑),而且系统刚好还使用了extjs,此时问题出现了:假 ...

  2. Linux_service cloudera-scm-server start failed

    see log : /var/log/cloudera-scm-server/cloudera-scm-server.log

  3. codevs 1031 质数环

    题目描述 Description 一个大小为N(N<=17)的质数环是由1到N共N个自然数组成的一个数环,数环上每两个相邻的数字之和为质数.如下图是一个大小为6的质数环.为了方便描述,规定数环上 ...

  4. iOS NSDictionary、NSData、JSON等 数据类型相互转换

    1.NSDictionary类型转换为NSData类型: NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys: @&qu ...

  5. 更改xcode上iphone模拟器颜色的方法--备用

    到模拟器的目录下修改图片即可——在Finder中显示,显示模拟器包内容,修改Contents/Resources/frame.png图片!

  6. ubuntu下wine打开自由们找不到MFC42.DLL重新安装的解决方法

    一直在找ubuntu下的X墙工具,看到大部分的都是ssh和tor的,但是tor下载不到,找了很多方法,没有办法,只能用FG了.但是Fg是运行在windows系统下的程序. 只好再安装一遍wine,用终 ...

  7. js new Date().Format

    /** * * 对Date的扩展,将 Date 转化为指定格式的String * 月(M).日(d).小时(h).分(m).秒(s).季度(q) 可以用 1-2 个占位符 * 年(y)可以用 1-4 ...

  8. ngRoute 路由

    做单页面应用多是通过不同的url来识别出不同的页面展现的. angularjs 为我们提供一个封装好的ngRoute工具 简单介绍用法 : <div ng-view></div> ...

  9. hadoop深入研究:(十八)——Avro schema兼容

    转载请写明来源地址:http://blog.csdn.net/lastsweetop/article/details/9900129 所有源码在github上,https://github.com/l ...

  10. Remove Node in Binary Search Tree 解答

    从BST中移除一个节点是比较复杂的问题,需要分好几种情况讨论. 如这篇文章,就讨论了删除节点 1.有无左右子树 2.只有右子树 3.只有左子树 三种情况. 一种简单些的思维是只考虑删除节点是否有右子树 ...