Simple is Best

Thursday, April 21, 2005

 

oracle & sqlserver

some application now using sqlserver, after the install and learning,sql server is easy using under windows,but the performance and stability less than oracle
sql serve2k with sp3a, easy with using and performance tunning
oracle 9.2.0.6, difficult with using and tunning,but stability is more much better than sqlserver.
as database cluster,Oracle is much more better than sqlserver with RAC.

maybe my opinion is not equity,as oracle dba 4 years,and sqlserver dba not more than 1 months.
 

rebuild MS AD& Exchange

domain controler with MS ad crashed last week becaure virus,but backup server is alive,after the GlobalCatalog server down,then the exchange can't startup, though the backup server is GC too,after two days work on recovering exchange server, nothing can do more even with ms support. shit MS.
Total AD was rebuided because many error in the old Ad, win2k3 and exchange2k3 sp1,but the internet mail can't be sended,only stay in the smtp query.maybe be the bug under next url
http://forums.msexchange.org/ultimatebb.cgi?ubb=get_topic;f=18;t=000384
after set the internet outgo mail relay to a linux postfix server,the problem was solved,nothing can said to MS.
 

All sytem performance tunning finished

after the tunning on Oracle9.2.0.6 under Rhel3 u4, the all system performance tunning was finished last week.
total architecture includes cache,web,application,database, tunning on all the part began at july last year, finished at april this year.
now the system can have about 10k-20k concurrent online user with the same hardware, the on bottle is database, though now we have oracle,mysql and sql server,maybe postgresql later, but none db is clustered.the expensive oracle rac-.
performance now become about 5-20 times than last year.
next step is the dirtributed architecture.maybe MQ,JMS & EJB.
 

Linux下负载均衡器LVS简单设置

简单术语:
Director:前端负载均衡器,运行lvs,目前只能为Linux,针对FreeBSD刚刚出来,性能不知道如何。可以针对web、ftp、cache、mms甚至mysql等服务做loadbalance。
RealServer:后段需要负载均衡的服务器,可以为各类系统,Linux、Solaris、Aix、BSD、Windows都可,甚至Director本身也可以作为RealServer使用

过完春节一直忙的稀里糊涂,脑袋一直转的太快,下午暂时有点空闲,正好最近N多朋友要做web 方式下的负载均衡,简单描述一下lvs的设置(不涉及HA、Mult-homing),当做大脑休息好了:p

lvs Linux Virtual Server,Linux下的负载均衡器,不多作介绍了,跟DNS轮询以及一些商业产品的比较等不做论述,具体看看LVS网站,支持LVS-NAT、LVS-DR、LVS-TUNL三种不同的方式,nat用的不是很多,这里简单介绍一下DR、TUNL方式。
DR方式适合所有的RealServer同一网段下,即接在同一个交换机上
TUNL方式就RealServer可以任意了,完全可以跨地域、空间,只要系统支持Tunnel就成(Win2k3好像已经不支持了……)
方便以后扩充的话直接Tunl方式即可

Director系统为RHEL3+ClusterSuite(偶是懒人,懒得打kernel patch了:p)
RealServer系统为Rhel3+noarp补丁

Director设置:
需要在Director设置的就是/etc/sysconfig/ha/lvs.cf,以及安装ClusterSuite后启动pulse服务(Redhat的lvs服务,当然也可以手动),下面是一个简单的lvs设置(没有设置director HA),man lvs.cf看看详细设置,RHEL3里已经有了详细的手册
203.x.x.a为Director公网ip地址
203.x.x.b为需要Loadbance的域名的Ip地址
203.x.x.c 为第一个RealServer
203.x.x.d为第二个RealServer

#cat /etc/sysconfig/ha/lvs.cf
serial_no = 45
primary = 203.x.x.a
service = lvs
rsh_command = ssh
backup_active = 0
backup = 0.0.0.0
heartbeat = 1
heartbeat_port = 539
keepalive = 10
deadtime = 20
network = direct(Tunl方式改为tunnel)
nat_nmask = 255.255.255.255
reservation_conflict_action = preempt
debug_level = NONE
virtual www.test.com {
active = 1
address = 203.x.x.b eth0:0
vip_nmask = 255.255.255.255
port = 80
send = "GET / HTTP/1.0\r\n\r\n"
expect = "HTTP"
load_monitor = uptime
scheduler = wlc
protocol = tcp
timeout = 10
reentry = 15
quiesce_server = 0
server r1 {
address = 203.x.x.c
active = 1
weight = 1
}
server r2 {
address = 203.x.x.d
active = 1
weight = 1
}
}


上面的设置是对某个域名的web访问进行负载均衡,Director使用ssh定时收集RealServer上的负载,然后决定Loadbalance的分配,分配方式为WLC方式,然后启动pulse服务,看看/var/log/message里有没有什么配置错误,RHEL3里设置已经非常方便、简单


RealServer配置:
RS系统为Rhel3,针对DR、Tunl需要不同的设置,但关键的是arp问题,这里使用的noarp module,当然Rhel3里也提供了arptables来配合lvs(效果可能不是很好),这里介绍一下noarp
noarp编译不做介绍了,configure install后,insmod noarp把noarp加入内核,然后需要执行
noarpctl add 203.x.x.b 203.x.x.a
这是把所有对203.x.x.b的arp请求转向203.x.x.a(Director),然后建立虚拟ip以完成路由
DR的话需要建立网卡,放在eth0或者lo都行
ifconfig eth0:1 203.x.x.b netmask 255.255.255.255 up
Tunl方式的话需要启动tunl虚拟网卡
ifconfig tunl0 203.x.x.b netmask 255.255.255.255 up
同样在RealServer2上同样的设置
在两个RealServer上启动apache

Director上检测一下连接
ipvsadm -Ln
看看当前的负载分配

lvs的稳定性不用置疑,Rhas2.1、Rhel3里的LVS在偶这个懒人的4年使用里极其稳定,访问量从当时的几百人在线到现在的接近10K,只需要根据负载增加后段的RealServer即可,但Rhas2.1的LVS对Tunl支持的不好,建议使用Rhel3进行tunl方式的Loadbalance

几句题外话:
lvs这两年里已经很稳定了,应用也已经很多了,maillist已经很活跃了,一些问题完全可以在maillist里找到答案,不用象偶当时完全是瞎子摸象:p。
上面只是lvs一个简单的应用,其它的复杂应用完全可以到lvs主页、maillist等查找。

可以任意转载,转载请注明出处http://devil4heaven.blogspot.com/

Archives

May 2004   November 2004   April 2005   January 2006   June 2006   March 2008   April 2008  

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]