Clustering and Load alancing J2EE Application集群與負(fù)載均衡的J2EE應(yīng)用_第1頁
Clustering and Load alancing J2EE Application集群與負(fù)載均衡的J2EE應(yīng)用_第2頁
Clustering and Load alancing J2EE Application集群與負(fù)載均衡的J2EE應(yīng)用_第3頁
Clustering and Load alancing J2EE Application集群與負(fù)載均衡的J2EE應(yīng)用_第4頁
Clustering and Load alancing J2EE Application集群與負(fù)載均衡的J2EE應(yīng)用_第5頁
已閱讀5頁,還剩15頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)

文檔簡介

1、 by : rudi har (rudi.h) (http:/ this material is slide version of enterprise talk i : enterprise the beginning and enterprise talk ii : clustering and load balancing j2ee application on web layerwhat is enterprise?a. the buzzword lthere is a need for distributed transaction ?lmore then 30 or 40 or 5

2、0 people to develop in minimal 1 year ?lneed interfacing with legacy application, eis and such things?lusing those expensive giant mainframes?b. without the buzzword la people who want to give you a lot money (too much money) to get things done. (which will be considered as a buzzword by other peopl

3、e )lmay just means to make something as good as other existing “enterprise”.lso complicated that if you explain to other people they can never get the point lok, what ever it is, when we talk about enterprise we talk about critical and complicated application.lwhat is enterprise and what is not is r

4、elative. the definition will always change because the meaning of “enterprise” word is so abstract!why web application?a. without the buzzword: far better performance for wan environment. even if there is firewall/network security policy setting between interconnected lan. eg: some branches/offices

5、are connected to 1 data center on separated geographic location: banking, financial company, typical of multinational company. web application is far more suitable for this kind of setup.b. the buzzword that youve heard (theyre true sometimes): only http is permitted to pass public network. (good co

6、mpany doesnt use public network anyway) flexible installation (i wont mind to install my software on 50 or so workstations, when it only happens once every year) internet enabled. (well, many internal business application actually doesnt need it this is the top 3 reason of why a web based enterprise

7、 application could be considered as a buzzword. something you use even if you dont need it all the time how much is the demand for application with high availability?a. the buzzword: some service oriented company like telecom and banking always try to improve their services. in terms of application

8、it means they want 24x7 availability. this kinds of business always want to increase availability from 95% to 98% to 99% to 99,9% to 99,99% to 99,999% and so on. the cost to increase availability from 99,99 % to 99,999 % is much higher than from 95% to 98%.b. without the buzzword: the company will w

9、ant that at least service will be available on working hours. nowadays more and more company doing business mostly using computer. interruption of service will stop the business and cost money! ive seen this kind of company, especially in country like singapore where the only things that they have i

10、n office is computer and software. for this kinds of company they need at least fail over enable application. with no spof (single point of failures) and no data loss when failing over. its rarely exist such a robust application that it will never fail. thus application failover mechanism is despera

11、tely wanted!what is clustering?= many computers collaborating to do certain task and look transparently as one system from consumer/ client view.the goal: no single spof (single point of failure) either on database layer, application layer, not even network layer (example: using multiple data center

12、 on separate geographic location) system failure doesnt make the services totally malfunction (there is failover mechanism) when failover happen there is no data loss (replication) to balance the load between many computer to achieve best performance. ability to increase application throughput by ad

13、ding hardware or else. this will lead to: high availability, reliability, scalability (all the buzzword things weve heard)j2ee clustering?a. clustering on web layer (sufficient for most application)b. clustering on business component layer (ejb or other technology)c. clustering on resources (jndi, c

14、onnection pool, etc)d. clustering on messaging.e. clustering and caching on database. caching is capitalized because normally you will think of it as just a buzzword :-)this time we will only explore clustering on web layer (its sufficient for most applications)how it works?a. ip multicast b. object

15、 serialization.c. some odd primitive ways: persisting state in shared file or database. (note: there is this thing what so called as peer to peer clustering which is the latest technology just invented)environment setup examples?a. 2 request dispatcher (only 1 run at the same time, 1 backup which wi

16、ll taking over when main dispatcher is down)b. 2 or more load balancer- hardware load balancer- software load balancerc. 2 or more application server.d. 2 or more database server.note: this magic 2 number in every layer is minimal to avoid spof (single point of failure).what are the things to concer

17、n on web clustering strategy?clustering strategy: application without session. state saved in client cookies. - dont need replication, failover scenario available.- impossible nowadays for security reason (eg: the unpleasant original developer can easily break it on production environment) and for p

18、erformance reason (example: storing and reading state from database are expensive tasks) sticky load balancing (load balancer sticks particular client to be served by only 1 server). - normally load balancer add a cookie to the incoming request or rewrite the url- dont need replication, but dont hav

19、e failover scenario. non sticky load balancing- need replication, failover is available.- session replication needed for failover.- session replication needed for load balancing.- load balancing for replication :-) this one is interesting, ill show you.- both load balancing and session replication m

20、ust be use at the same time.web load balancing algorithm random round robin weight based content based routing advanced algorithmprogramming and design guidelines make sure your session object is serializable (implements serializable) dont be tempted to keep application state (not session state) in

21、singleton. use cluster wide jndi instead. (but dont used application object, its not clustered) dont let multi frames page accessing (write-read or write-write) same session object if you are developing for a non sticky clustering system. consider acceptable trade off between better load balancing a

22、lgorithm and performance when choosing sticky or non sticky consider also the trade off between when using synchronous or asynchronous replication. its good on multi frames write-write: multiple modification on session object only replicated once. what kind of application is yours? sticky load balan

23、cing using server affinity wont work in ssl communication. and by the way almost all good application are using ssl nowadays :-d use web server proxy with ssl accelerator to keep track the affinity.trouble shooting - got problem on failing over session?- browser only send back cookie (http header se

24、ssion id) to the same domain :-)- that is the place where the load balancer will solve. from the client view there is only 1 server/domain which is the load balancer. the cluster members stand behind the load balancer.clustering with tomcat 5.0here are some steps to configure tomcat clustering:1. en

25、able tomcat clustering service. by default tomcat clustering service is off. edit the server.xml file to enable it. add some line under the entry as shown below:this is undocumented anywhere in apache website or else but luckily you can see some remarks in the server.xml file itself clustering with

26、tomcat 5.0 (continue)2. enable clustering in your application this is quiet straight forward. to enable your application for clustering add entry into your web.xml file.clustering with tomcat 5.0 (continue)3. setting up load balancer using apache 2.x web serverwithout load balancer you dont have acc

27、ess into your own session this is due to the nature of all browser who will only send back the cookie into the domain who owns it.luckily we dont have to buy expensive load balancer hardware. apache2 with mod_jk modules can be used as software load balancer !add mod_jk into your apache installation.

28、edit httpd.confclustering with tomcat 5.0 (continue) create perties file under apache conf/ folder this file contains the load balancing setting and policies that will be used by apache+modjk this one is well documented on apache website under mod_jk user references guide demo horizontal s

29、calingscenario:- no load balancer needed, just redirect url.- use session replication. vertical scalingscenario:- without load balancing- with load balancing, sticky, no replication (no failover available)- with load balancing, non sticky, no replication (application malfunction)- with load balancin

30、g, sticky, with replication (weak load balancing, failover available)- with load balancing, non sticky, with replication (good load balancing, failover available, with trade off)new problem performance drop when the system grow with many servers. overhead of transferring session data to all machines. many machines means many users, thus many replications. now all machines have to keep redundant session info from many users from many machines!solution?- introduce sub cluster- known as domain in weblogic and partition in

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論