国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

開通VIP
配置WebLogic Server集群
Linux下Weblogic集群配置初步
域,集群,管理服務器和被管服務器之間的關(guān)系
Weblogic域是一個服務器/集群的管理組,用戶可以通過某個中央位置來管理、監(jiān)控整個服務器域,這個中心就是管理服務器,相對的,受控服務器或者叫被管服務器是指域中除了管理服務器以外的所有的服務器。
Weblogic集群是一個weblogic Server組,在一個集群中的服務器可以獲得集群范圍的命名服務、負載平衡以及容錯等功能。
所以,一個weblogic域可以同時管理多個集群以及多個服務器實例。
另外,還有一個節(jié)點管理器的概念,節(jié)點管理器是指在物理的機器上運行的一個守護進程,通過它,管理服務器可以獲得諸如在控制臺中強制重啟遠程機器上的server等功能(沒有節(jié)點管理器的情況下也是可以強制關(guān)閉遠程服務器的,但是不能重啟)。
除此之外,據(jù)說節(jié)點管理器還可以自動檢查自己機器上的server實例(健康檢查),當發(fā)現(xiàn)某個實例出現(xiàn)故障的時候,可以自動進行重啟,這個沒試過。
注意事項
1. 本文的weblogic均配置在linux環(huán)境下
2. 集群中管理服務器和被管服務器之間有用到ip組播UDP,所以這些服務器之間必須是UDP可以到達的。
3. 好像動態(tài)ip的機器不能用于集群當中
4. 最佳實踐說:請不要把管理服務器設(shè)置在集群當中
5. 本文所配置的集群只是實現(xiàn)了web層次上的負載平衡和容錯,也就是servlet和jsp,其他的j2ee組件如ejb,jdbc,jms等都可以集群化。
本例測試域的規(guī)劃
Ip/port server 注釋
10.21.18.40:7001 adminServer 管理服務器
10.21.18.40:7003 mServer1 被管服務器1
10.21.18.41:7001 mServer2 被管服務器2
10.21.18.40:7004 proxyServer 代理服務器

配置過程
建立管理服務器
啟動linux下的配置向?qū)?br>進入bea目錄下的weblogic81/common/bin目錄輸入./config.sh,這里使用的終端登陸,所以沒有圖形環(huán)境,程序會以控制臺模式啟動
第一步:選擇建立新的域:
啟動配置向?qū)Ш螅到y(tǒng)提示如下:
<------- BEA WebLogic Configuration Wizard---------->
Create or Extend a Configuration:
---------------------------------
Choose between creating and extending a configuration. Based on your selection, the Configuration Wizard guides you through
the steps to generate a new or extend an existing configuration.
->1|Create a new WebLogic configuration
| Start here to create a WebLogic configuration in your projects directory.
2|Extend an existing WebLogic configuration
| Start here to extend an existing WebLogic configuration. Use this option to add applications and services,
|including Database access (JDBC) and Messaging (JMS). This option also enables you to extend functionality by enabling
|WebLogic Workshop.
Enter index number to select OR [Exit][Next]> 1
錄入1回車,建立一個新的域。
第二步:選擇模版
系統(tǒng)提示選擇一個建立域的模版,資料上講配置向?qū)У呐渲眠^程可以另存為模版,以便下次配置的時候使用,沒試過下次回去試試。
<-------- BEA WebLogic Configuration Wizard -------->
Select a Domain Template:
-------------------------
Please select a template from the list or select another directory of templates.
* [/usr/local/bea/weblogic81/common/templates/domains]
->1|Basic WebLogic Server Domain 8.1.4.0
| BEA Systems, Inc.
| Create a basic WebLogic Server domain without installing sample applications.
2|WebLogic Server Examples Domain 8.1.4.0
| BEA Systems, Inc.
| Create the WebLogic Server Examples domain in a directory outside of the installed kit. The Examples domain contains |a collection of examples to show best practices for coding individual J2EE APIs.
3|Avitek Medical Records Sample Domain 8.1.4.0
| BEA Systems, Inc.
| Create the Avitek Medical Records domain in a directory outside of the installed kit. The Avitek Medical Records is
|a WebLogic Server sample application suite that concisely demonstrates all aspects of the J2EE platform.
4|Select another directory location
Enter index number to select OR [Exit][Previous][Next]> 1
這里我們選擇1,使用基礎(chǔ)的模版
第三步:是否以快速模式進行
第三步系統(tǒng)提示是否以快速模式進行配置,這里選擇2。
<--------- BEA WebLogic Configuration Wizard ----------->
Choose Configuration Option:
----------------------------
*Do you want to run the wizard in express mode?
->1|Yes
2|No
Enter index number to select OR [Exit][Previous][Next]> 2
第四步:配置管理服務器
現(xiàn)在系統(tǒng)提示我們配置管理服務器,把管理服務器的名字改一下,改成adminServer就可以了。
<------- BEA WebLogic Configuration Wizard -------->
Configure the Administration Server:
------------------------------------
Enter adminstration server configurations. Each WebLogic Server domain must have one Administration Server. The
Administration Server hosts the Administration Console which is used to perform administrative tasks.
| Name | Value |
_|__________________|_____________________|
1| *Name: | myserver |
2| Listen address: | All Local Addresses |
3| Listen port: | 7001 |
4| SSL listen port: | N/A |
5| SSL enabled: | false |
Select Option:
1 - Modify "Name"
2 - Modify "Listen address"
3 - Modify "Listen port"
4 - Modify "SSL enabled"
Enter option number to select OR [Exit][Previous][Next]> 1
輸入1之后,根據(jù)系統(tǒng)提示輸入新的管理服務器的名稱adminServer
第五步:配置被管服務器
根據(jù)下面系統(tǒng)的提示,配置被管服務器
<--------- BEA WebLogic Configuration Wizard ---------->
Configure Managed Servers:
--------------------------
Add or delete configuration information for managed servers. A typical production environment has one or more managed
servers. Each managed server is an instance of WebLogic Server used to host enterprise applications.
| Name* | Listen address | Listen port | SSL listen port | SSL enabled |
_|_______|________________|_____________|_________________|_____________|
Enter name for a new Server OR [Exit][Previous][Next]> mServer1
被管服務器我們設(shè)置兩個:mServer1和mServer2,mServer1和管理服務器在一臺機器上,所以端口設(shè)置為7003避免和管理服務器沖突。
mServer2的監(jiān)聽地址一定要設(shè)置成ip,否則在啟動被管服務器2的時候會得到這樣一個錯誤:using the same address as the admin server(這個錯挺傻的我覺得),如果是實際的集群配置的話,這里建議都寫成ip的形式。
配置完成的畫面如下:
| Name* | Listen address | Listen port | SSL listen port | SSL enabled |
_|_________|___________________|_____________|_________________|_____________|
1| mServer1| 10.21.18.41 | 7003 | N/A | false |
->2|mServer2|10.21.18.41 | 7001 | N/A | false |

第六步:配置集群
<----BEA WebLogic Configuration Wizard ------>
Configure Clusters:
-------------------
A cluster contains multiple WebLogic Server instances (servers) that run simultaneously and work together to provide
increased scalability and reliability. A cluster appears to be a single WebLogic Server instance to clients.
| Name* | Multicast address | Multicast port | Cluster address |
_|_______|___________________|________________|_________________|
Enter name for a new Cluster OR [Exit][Previous][Next]> testCluster
輸入集群的名字testCluster,其他的默認就行了,配置完成后如下:
| Name* | Multicast address | Multicast port | Cluster address |
_|_____________|___________________|________________|_________________|
->1| testCluster | 237.0.0.1 | 7001 | |
第七步:將服務器組織到集群中
根據(jù)系統(tǒng)的提示,將mServer1和mServer2放入集群testCluster中去,配置完成后如下:
Cluster
|_____testCluster [1]
|_____mServer1
|_____mServer2
第八步:配置機器、jdbc、jms、安全等
接下來幾步系統(tǒng)提示配置Machines,jdbc,jms,安全,這里都不用配置,全部回車就行了。
第九步:輸入管理服務器的用戶名和密碼
系統(tǒng)提示如下畫面,可以配置管理服務器的用戶名和密碼:
| Name | Value |
_|_________________________|_________________________________|
1| *User name: | weblogic |
2| *User password: | |
3| *Confirm user password: | |
4| Description: | The default administration user |
第十步:選擇啟動模式,jdk和存放目錄
啟動模式,jdk和域文件存放目錄的設(shè)置比較簡單,根據(jù)大家的愛好設(shè)置就行了。
這里啟動模式選擇生產(chǎn)開發(fā)模式,jdk使用jRockit,存放目錄默認。
十一步:配置域名稱
Edit Domain Information:
------------------------
| Name | Value |
_|________|__________|
1| *Name: | mydomain |
Enter value for "Name" OR [Exit][Previous][Next]> testDomain
設(shè)置域的名稱為testDomain。
十二步:域建立結(jié)束
以上步驟都完成后,系統(tǒng)會自動建立這個域,并會生成一些文件等等,完成的界面如下:
<----- BEA WebLogic Configuration Wizard --------->
Creating Domain...
0% 25% 50% 75% 100%
[------------|------------|------------|------------]
[***************************************************]
**** Domain Created Successfully! ****
啟動管理服務器
進入bea/user_projects/domains/testDomain/目錄
鍵入./startWebLogic.sh
建立被管服務器1
這里的被管服務器1也就是mServer1是和管理服務器在同一臺機器上的,這里我試過了,我們不需要再進行什么配置,只需要啟動它就行了,啟動被管服務器1的命令如下:
進入bea/user_projects/domains/testDomain/目錄
鍵入./startManagedWebLogic.sh mServer1 http://10.21.18.40:7001
這樣的寫法保證了被管服務器在啟動的時候向管理服務器報告,后面的這個地址就是管理服務器的地址了
當然,由于是在同一臺機器上,所以你完全可以這樣寫:./startManagedWebLogic.sh mServer1就可以了。
建立被管服務器2
被管服務器2和管理服務器在不同的機器上,所以你還需要在這臺機器上配置一個域,域的名字要和剛才建立的域名字一致(不一致會怎么樣我也沒試過,誰有時間試一下:>)
建立域的過程前三步和上面講的一樣
第四步,配置管理服務器的時候,請把這個域的管理服務器的名字設(shè)置為mServer2。
這里需要解釋一下,在每臺機器上建立域的時候都需要有一個管理服務器,以確保整個域的管理服務器當?shù)舻臅r候,每臺機器自己都是還可以運行的,這里我們是把mServer2作為了41這臺機器的管理服務器,同時它也是adminServer的被管理服務器。
從第五步開始,都不需要配置,直接回車就可以了。
配置完成后,用下面的命令啟動mServer2:
./startManagedWebLogic.sh mServer2 http://10.21.18.40:7001
小結(jié)
到目前為止,一個包含一個管理服務器和2個被管服務器以及一個cluster的域就配置完成了,你可以簡單試驗一下它提供的功能,打開管理服務器的管理控制臺:
http://10.21.18.40:7001/console
首先,在這個管理控制臺上你可以監(jiān)控和管理mServer1和mServer2,選擇mServer2
進入Monitoring頁面General子頁面,如果顯示如下,就說明配置是正確的了:

進入Monitoring頁面的Performance子頁面,就可以看到mServer2的運行情況了。

將一個web應用上傳上去,將其部署在testCluster這個集群上

部署成功后,分別在mServer1和mServer2上訪問剛才部署的web應用,應該都是可以訪問的。
建立代理服務器
建立了集群以后,集群的負載平衡功能還需要代理(proxy)來實現(xiàn)。目前我所知道的Weblogic支持幾種類型的代理:
 HttpClusterServlet的代理,這個代理是weblogic公司編寫的一個servlet,把它部署在一個weblogic服務實例上,就可以實現(xiàn)負載平衡和容錯了。
 IIS 代理,用IIS作為前段的http的代理,需要往IIS中裝一個插件
 Netscape/iPlanet代理,需要裝插件
 Apache代理,用Apache作為http代理,需要裝插件。推薦使用
當然,實際應用中可能更加復雜,可能會這樣:

使用HttpClusterServlet作為代理
建立代理服務器實例
代理服務器proxyServer實例實際上和mServer1一樣,都是屬于testDomain域的一個被管服務器,回頭看建立管理服務器的第五步,在那個時候配置被管服務器的時候如果也把proxyServer加上的話,現(xiàn)在直接啟動就可以了。
當然也可以在管理服務器的管理控制臺上新建這個server。
在管理服務器的控制臺上,左邊的菜單中Server上單擊左鍵,選擇“新建一個Server”

然后,在出現(xiàn)的頁面中設(shè)置這個server的名字為proxyServer,監(jiān)聽端口為7004,如圖:

點擊應用,這個服務就配置完成了。
配置結(jié)束后,在后臺使用./startManagedWebLogic.sh proxyServer來啟動代理服務器。
部署代理webapp
建立一個標準的web應用,這個應用里面什么也不用有,只需要配置web.xml和weblogic.xml就可以了。web.xml和weblogic.xml代碼如下:
web.xml
<!-- DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.
//DTD Web Application 1.2//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd"
-->
<web-app>
<servlet>
<servlet-name>HttpClusterServlet</servlet-name>
<servlet-class>
weblogic.servlet.internal.HttpClusterServlet
</servlet-class>
<init-param>
<param-name>defaultServers</param-name>
<param-value>
10.21.18.40:7003|10.21.18.41:7001
</param-value>
</init-param>
<init-param>
<param-name>DebugConfigInfo</param-name>
<param-value>ON</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>HttpClusterServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>HttpClusterServlet</servlet-name>
<url-pattern>*.jsp</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>HttpClusterServlet</servlet-name>
<url-pattern>*.htm</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>HttpClusterServlet</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
</web-app>
weblogic.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web Application 6.1//EN" "http://www.bea.com/servers/wls610/dtd/weblogic-web-jar.dtd">
<weblogic-web-app>
<context-root>/</context-root>
</weblogic-web-app>
將這個應用打包成war文件,上傳到管理服務器上,然后部署在proxyServer上面。

部署成功后的頁面:

測試
打開一個瀏覽器,在其中輸入:
http://10.21.18.40:7004/abc.jsp? __WebLogicBridgeConfig
jsp的名字隨便輸入可以了,如果看到如下頁面,就說明配置成功了:




然后再做一個web應用,里面放兩個servlet,jsp啥的,部署在集群上面,比如說部署成功了以后應用叫做testApp,其中有一個頁面叫index.jsp
鍵入如下的地址:
http://10.21.18.41:7001/testApp/index.jsp
http://10.21.18.40:7003/testApp/index.jsp
http://10.21.18.40:7004/testApp/index.jsp
應該都是可以運行的,請注意第一、二個地址是單獨訪問集群中的機器的,而第三個地址是通過了代理的。
你可以做一個這樣的測試,在index.jsp里面寫一句System.out.println(“ok!!!”);
然后再http://10.21.18.40:7004/testApp/index.jsp這個地址上多刷幾次,到mServer1和mServer2的控制臺去看的話應該兩邊都有輸出。
使用apache作為代理
安裝代理插件
在weblogic安裝目錄下面,找到bea/weblogic81/server/bin目錄,下面有兩個文件:
mod_wl_20.so
mod_wl128_20.so
分別是對應不同版本的apache,這里用來測試的是2.0版的apache,所以使用了第一個文件。
安裝過程如下:
 把mod_wl_20.so這個文件copy到apache安裝目錄下的modules目錄中
 在apache的httpd.conf文件中,加入這樣一句:
LoadModule weblogic_module modules/mod_wl_20.so
表示在啟動apache的時候加載weblogic的插件
 在apache的httpd.conf文件中,加入如下代碼:
<IfModule mod_weblogic.c>
WebLogicCluster 61.152.114.141:7003,61.152.114.142:7001
MatchExpression *.jsp
MatchExpression *.do
</IfModule>
第一行表示集群的各個成員地址
下面幾行可以寫出要代理的url后綴。
注:如果weblogic這邊沒有集群,只有一臺機器的話,也是可以配置apache插件的,這樣寫:
<IfModule mod_weblogic.c>
WebLogicHost myweblogic.server.com
WebLogicPort 7001
MatchExpression *.jsp
MatchExpression *.xyz
</IfModule>
測試
啟動apache,訪問http://apachehost:part/testApp/index.jsp應該可以看到正確的響應。其中apachehost和part視apache的配置而定。
使用iis作為代理
安裝插件
IIS的weblogic插件安裝非常的簡單:
 找到bea/weblogic81/server/bin目錄下的iisproxy.dll,拷貝到一個IIS能夠訪問到的目錄,比如WINNT\system32\inetsrv\
 建立兩個文本文件:iisproxy.ini和iisproxy.log
 右鍵單擊某個站點,打開屬性頁面
 點擊下面的配置,界面如下:

 點擊添加,在其中可執(zhí)行文件選擇iisproxy.dll,擴展名錄入*.jsp,如圖:

 配置完畢后啟動iis的這個站點
測試
訪問http://iishost:part/testApp/index.jsp應該可以看到正確的響應。其中iishost和part視IIS的配置而定。
簡單測試
想要進行一些性能方面的測試,可以使用apache帶的apacheBench工具,這個工具在apache安裝目錄下的bin目錄下有(ab.sh),用法如下:ab –c 200 –n 60 url
含義是請求url這個地址200次,60次的并發(fā)。
以下是我做的一些簡單測試的結(jié)果的一部分:
單獨訪問集群中一臺機器的時候:
Percentage of the requests served within a certain time (ms)
50% 13734
66% 17046
75% 33234
80% 34000
90% 34343
95% 34437
98% 34515
99% 34515
100% 34546 (longest request)
使用HttpClusterServlet代理訪問集群的情況:
Percentage of the requests served within a certain time (ms)
50% 18234
66% 19187
75% 19718
80% 19921
90% 21296
95% 22203
98% 22593
99% 22640
100% 22703 (longest request)
使用apache代理訪問集群的情況:
Percentage of the requests served within a certain time (ms)
50% 2000
66% 2578
75% 3421
80% 3421
90% 3625
95% 3640
98% 3640
99% 3640
100% 3656 (longest request)
使用iis代理訪問集群的時候:
出錯,200次請求當中有190次失?。海?br>可能是因為iis在我的機器上的原因
另外,在測試的時候檢測mServer1和mServer2的吞吐量(Throughput),也是在使用apache的時候最高。大家也可以多做一些各個方面的測試,很有意思的。
本站僅提供存儲服務,所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊舉報
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
常用的java應用服務器
JSP漏洞大觀
Tomcat和Weblogic的區(qū)別
Web容器_Web服務器及常見的Web容器有哪些?
理解Oracle WebLogic服務器的關(guān)鍵概念(三)
Tomcat應用部署及詳解
更多類似文章 >>
生活服務
分享 收藏 導長圖 關(guān)注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點擊這里聯(lián)系客服!

聯(lián)系客服