Software load balance .
Nginx(http://nginx.org)

1.Install nginx
download source code from http://nginx.org/en/download.html

./auto/configure
make & make install

2.Install tcp module patch
developed by Yao Weibin http://yaoweibin.github.io/nginx_tcp_proxy_module/
download from GitHub http://github.com/yaoweibin/nginx_tcp_proxy_module/zipball/master

$ patch -p1 < /path/nginx_tcp_proxy_module/tcp.patch
$ ./configure --add-module=/path/nginx_tcp_proxy_module/tcp.patch
$ make & make install

3. config load balance

#check status at http://localhost:8080/status
http {
server{
listen 8080;
location /status {
tcp_check_status;
}
}
}
#load balance to other server
tcp {
upstream cluster {
# simple round-robin
server 192.168.0.111:11213;
server 192.168.0.110:11213; check interval=3000 rise=2 fall=5 timeout=1000; #check interval=3000 rise=2 fall=5 timeout=1000 type=ssl_hello; #check interval=3000 rise=2 fall=5 timeout=1000 type=http;
#check_http_send "GET / HTTP/1.0\r\n\r\n";
#check_http_expect_alive http_2xx http_3xx;
} server {
listen 11113; proxy_pass cluster;
}
}

4. Start Nginx
#start

$sudo /usr/local/nginx/sbin/nginx

#reopen

$sudo /usr/local/nginx/sbin/nginx -s reopen

#quit

$sudo /usr/local/nginx/sbin/nginx -s quit

5. note

1. each connection can be relocated to different servers with round-robin or weight.
2. one connection will not be relocated unless released.
3. other options for the optimize of nginx see the website. This is the basic usage only.

Using load balance for thrift servers的更多相关文章

  1. Neutron: Load Balance as a Service(LBaaS)负载均衡

    load balancer 负责监听外部的连接,并将连接分发到 pool member.    LBaaS 有三个主要的概念: Pool Member,Pool 和 Virtual IP Pool M ...

  2. hue的load balance

    参考: hue的load balance官网: https://www.cloudera.com/documentation/enterprise/6/6.2/topics/hue_use_add_l ...

  3. 【mq】从零开始实现 mq-07-负载均衡 load balance

    前景回顾 [mq]从零开始实现 mq-01-生产者.消费者启动 [mq]从零开始实现 mq-02-如何实现生产者调用消费者? [mq]从零开始实现 mq-03-引入 broker 中间人 [mq]从零 ...

  4. LB(Load balance)负载均衡集群--{LVS-[NAT+DR]单实例实验+LVS+keeplived实验} 菜鸟入门级

    LB(Load balance)负载均衡集群 LVS-[NAT+DR]单实例实验 LVS+keeplived实验 LVS是Linux Virtual Server的简写,意即Linux虚拟服务器,是一 ...

  5. Server Data Synchronization Via Linux rsync、rsync+inotify Between Load Balance Server

    目录 . 远程文件同步的应用场景 . rsync+crontab . rsync+inotify 1. 远程文件同步的应用场景 在负载均衡集群的应用场景中,往往在多台web server的前端有一个提 ...

  6. Oracle RAC 服务器端连接负载均衡(Load Balance)

    Oracle RAC服务器端的负载均衡是根据RAC中各节点的连接负荷数情况,将新的连接请求分配到负荷最小的节点上去.当数据库处于运行时,RAC中各节点的PMON进程每3秒会将各自节点的连接负荷数更新到 ...

  7. Oracle RAC 客户端连接负载均衡(Load Balance)

    实现负载均衡(Load Balance)是Oracle RAC最重要的特性之一,主要是把负载平均分配到集群中的各个节点,以提高系统的整体吞吐能力.通常情况下有两种方式来实现负载均衡,一个是基于客户端连 ...

  8. 亲密接触Redis-第三天(Redis的Load Balance)

    前言 上两天讲述了Redis的基本搭建和基于HA的集群布署方式以及相关的策略和注意点.今天开始讲述Redis的Cluster功能,而这块目前来说网上资料不是太全,就算有1,2篇也只是单讲服务端的搭建也 ...

  9. NGINX Docs | Load Balancing Apache Tomcat Servers with NGINX Open Source and NGINX Plus

    NGINX Docs | Load Balancing Apache Tomcat Servers with NGINX Open Source and NGINX Plushttps://docs. ...

随机推荐

  1. AC-BM算法原理与代码实现(模式匹配)

    AC-BM算法原理与代码实现(模式匹配) AC-BM算法将待匹配的字符串集合转换为一个类似于Aho-Corasick算法的树状有限状态自动机,但构建时不是基于字符串的后缀而是前缀.匹配 时,采取自后向 ...

  2. C#程序部署到Android

    C#是一种优秀的编程语言,语法之优雅,代码之简洁使得众多软粉多年来对她不离不弃. 但是如何将C#程序部署到Linux, Android等平台,这当然是得依靠众所周知的Mono. 本文Demo程序比较简 ...

  3. AIX项目总结_oracle_sqlloader_01

    近来一直在忙AIX的移行项目,但也因自己小小偷懒,所以到现在才开始记录.接下来,言归正传. 这个项目中,学习中了shell相关知识,从基本的语法命令(定义变量.特殊变量使用.循环控制.方法调用等)到l ...

  4. 【好文转载c++】 sizeof 使用的经典总结

    为了在人面前畅快的吹牛逼,你必须学会背后努力  -----张小二. 写在转载之前: sizeof到底是多少?本来我没有关注,只是有次室友问了我几个sizeof的问题,我被问住了,他当时问我了sizeo ...

  5. HTML5与CSS3权威指南.pdf6

    第11章 获取地理位置信息 HTML5为window.navigator对象新增了一个geolocation属性 取得当前地理位置 void getCurrentPosition(onSuccess, ...

  6. Apache 虚拟主机 VirtualHost 配置

    虚拟主机 (Virtual Host) 是在同一台机器搭建属于不同域名或者基于不同 IP 的多个网站服务的技术. 可以为运行在同一物理机器上的各个网站指配不同的 IP 和端口, 也可让多个网站拥有不同 ...

  7. Hyperic Agent 安装配置报 - No token file found, waiting for Agent to initialize

    本人经过跟VMWare 支持的多方努力,问题终于得到解决,方案如下: * Stop the agent Windows service. * Make sure all the agent proce ...

  8. oracle启动

  9. js 设置cookie

    function GetCookieVal(offset) // 获得Cookie解码后的值 { var endstr = document.cookie.indexOf(";", ...

  10. struts2标签 遍历map集合

    首先我们来构造几个map集合.    假设如下代码 都是在ssh配置环境下搭建好,(至少struts2开发环境搭建好) (1).java 代码          下面的student对象包含的字段为 ...