四台服务器 server1.example.com //realserver 本次实验作为httpd服务器 server2.example.com //realserver? 本次实验作为httpd服务器 server3.example.com //安装haproxy 和 keepalived server4.example.com /...
分类:
其他好文 时间:
2015-07-18 18:45:49
阅读次数:
172
本文介绍在应用层如何设置TCP keepalive中的一些自定义参数。
分类:
其他好文 时间:
2015-07-17 20:53:48
阅读次数:
165
比如客户访问http://www.abc.comip对应10.10.10.1.需要跳转到另外一个网址http://www.125.com.我是在haproxy上实现的。frontendrewritetotripbind192.168.1.250:80modehttpoptionhttplogmaxconn2000aclclubhdr_reg(host)-iwww.abc.comredirectprefixhttp://trip.125.comifclub..
分类:
其他好文 时间:
2015-07-17 14:13:43
阅读次数:
150
1)修改haproxy配置文件,添加如下参数:optionhttpclose
optionforwardfor2)修改nginx配置文件,添加如下参数注意:需要编译模块--with-http_realip_module#haproxy服务器IP
set_real_ip_from192.168.64.128;
real_ip_headerX-Forwarded-For;
real_ip_recursiveon;3)分别重启hap..
分类:
其他好文 时间:
2015-07-16 14:15:55
阅读次数:
478
直接记录配置如下
userwww;
worker_processes1;
events{
worker_connections1024;
}
http{
includemime.types;
default_typeapplication/octet-stream;
keepalive_timeout300;
sendfileon;
server{
listen80;
server_namelocalhost;
root/var/www/web;
indexindex.phpindex.htm..
分类:
Web程序 时间:
2015-07-10 16:56:52
阅读次数:
139
1.maste主机:192.168.20.112slaver备机:192.168.20.137VIP(虚拟IP,用于外网访问):192.168.20.1002.安装nginx3.安装keepalivetar-zxvfkeepalived-1.2.15.tar.gzcdkeepalived-1.2.15./configuremakemakeinstall4.软连接ln-s/usr/local/etc/keepalived//etc/ln-s/usr/local/sbin/..
分类:
其他好文 时间:
2015-07-10 16:51:52
阅读次数:
242
Nginx/LVS/HAProxy是目前使用最广泛的三种负载均衡软件,本人都在多个项目中实施过,参考了一些资料,结合自己的一些使用经验,总结一下。一般对负载均衡的使用是随着网站规模的提升根据不同的阶段来使用不同的技术。具体的应用需求还得具体分析,如果是中小型的Web应用,比如日PV小于1000万,用...
分类:
其他好文 时间:
2015-07-10 15:10:06
阅读次数:
94
####################全局配置信息###############################参数是进程级的,通常和操作系统(OS)相关#########globalmaxconn 20480 #默认最大连接数log 127.0.0.1 local3 #[err warning ...
分类:
其他好文 时间:
2015-07-10 14:53:02
阅读次数:
116
【apache配置参数备注】1、KeepAlive On/Off KeepAlive指的是保持连接活跃,类似于Mysql的永久连接。换一句话说,如果将KeepAlive设置为On,那么来自同一客户端的请求就不需要再一次连接,避免每次请求都要新建一个连接而加重服务器的负担。一般情况下,图片较多的网站....
分类:
Web程序 时间:
2015-07-10 09:21:07
阅读次数:
158