weblogic_11g集群部署_linux
本文環境
平台:TurboLinux【類RedHat AS 5】, 3G RAM
軟件:WebLogic Server 11gR1
配置集群應用的必要條件
集群中的所有 Server 必須位於同一網段,並且必須是 IP 廣播(UDP)可到達的;
集群中的所有 Server 必須使用相同的版本,包括 Service Pack;
集群中的 Server 必須使用永久的靜態 IP 地址。動態 IP 地址分配不能用於集群環境。如果服務器位於防火牆后面,而客戶機位於防火牆外面,那么服務器必須有公共的靜態 IP 地址,只有這樣,客戶端才能訪問服務器;
要以 CLUSTER 方式運行,必須有包含 CLUSTER 許可的 LICENSE 才行;
集群規划
操作系統 |
網絡配置 |
角色 |
備注 |
TurboLinux |
IP: 172.19.114.201 |
proxy |
apache服務器 |
TurboLinux |
IP: 172.19.114.202 |
proxy |
apache服務器 |
TurboLinux |
IP: 172.19.114.203 PORT:7001 |
Admin Server |
管理服務器 |
TurboLinux |
IP: 172.19.114.203 PORT:7005 |
Managed Server |
受管理服務器1 |
TurboLinux |
IP: 172.19.114.204 PORT:7005 |
Managed Server |
受管理服務器2 |
TurboLinux |
IP: 172.19.114.205 PORT:7005 |
Managed Server |
受管理服務器3 |
安裝Weblogic11gr1
使用 Configuration Wizard 配置域
[wls@node1 bin]$ hostname
node1.wang.com
[wls@node1 bin]$ pwd
/u01/wls/weblogic10/10.3/common/bin
[wls@node1 bin]$ who am i
wls pts/0 2010-07-01 13:06 (192.168.100.7)
[wls@node1 bin]$
[wls@node1 bin]$ ./config.sh
Unable to instantiate GUI, defaulting to console mode.
<--------------------------------------------- Fusion Middleware Configuration Wizard -------------------------------------------->
Welcome:
--------
Choose between creating and extending a domain. Based on your selection, the Configuration Wizard guides you through the steps
to generate a new or extend an existing domain.
->1|Create a new WebLogic domain
| Create a WebLogic domain in your projects directory.
2|Extend an existing WebLogic domain
| Use this option to add new components to an existing domain and modify configuration settings.
Enter index number to select OR [Exit][Next]> 1
<--------------------------------------------- Fusion Middleware Configuration Wizard -------------------------------------------->
Select Domain Source:
---------------------
Select the source from which the domain will be created. You can create the domain by selecting from the required components or
by selecting from a list of existing domain templates.
->1|Choose Weblogic Platform components
| You can choose the Weblogic component(s) that you want supported in your domain.
2|Choose custom template
| Choose this option if you want to use an existing template. This could be a custom created template using the Template
|Builder.
Enter index number to select OR [Exit][Previous][Next]> next
<--------------------------------------------- Fusion Middleware Configuration Wizard -------------------------------------------->
Application Template Selection:
-------------------------------
Available Templates
|_____Basic WebLogic Server Domain - 10.3.2.0 [10.3]x
|_____WebLogic Advanced Web Services Extension - 10.3.2.0 [10.3] [2]
Enter number exactly as it appears in brackets to toggle selection OR [Exit][Previous][Next]> next
<--------------------------------------------- Fusion Middleware Configuration Wizard -------------------------------------------->
Edit Domain Information:
------------------------
| Name | Value |
_|________|_____________|
1| *Name: | base_domain |
Enter value for "Name" OR [Exit][Previous][Next]> wang
<--------------------------------------------- Fusion Middleware Configuration Wizard -------------------------------------------->
Edit Domain Information:
------------------------
| Name | Value |
_|________|_______|
1| *Name: | wang |
Use above value or select another option:
1 - Modify "Name"
2 - Discard Changes
Enter option number to select OR [Exit][Previous][Next]> next
<--------------------------------------------- Fusion Middleware Configuration Wizard -------------------------------------------->
Select the target domain directory for this domain:
---------------------------------------------------
"Target Location" = [Enter new value or use default "/u01/wls/weblogic10/user_projects/domains"]
Enter new Target Location OR [Exit][Previous][Next]> next
<--------------------------------------------- Fusion Middleware Configuration Wizard -------------------------------------------->
Configure Administrator User Name and Password:
-----------------------------------------------
Create a user to be assigned to the Administrator role. This user is the default administrator used to start development mode
servers.
| Name | Value |
_|_________________________|_________________________________________|
1| *User name: | weblogic |
2| *User password: | |
3| *Confirm user password: | |
4| Description: | This user is the default administrator. |
Use above value or select another option:
1 - Modify "User name"
2 - Modify "User password"
3 - Modify "Confirm user password"
4 - Modify "Description"
Enter option number to select OR [Exit][Previous][Next]> 2
<--------------------------------------------- Fusion Middleware Configuration Wizard -------------------------------------------->
Configure Administrator User Name and Password:
-----------------------------------------------
Create a user to be assigned to the Administrator role. This user is the default administrator used to start development mode
servers.
"*User password:" = []
Enter new *User password: OR [Exit][Reset][Accept]>
<--------------------------------------------- Fusion Middleware Configuration Wizard -------------------------------------------->
Configure Administrator User Name and Password:
-----------------------------------------------
Create a user to be assigned to the Administrator role. This user is the default administrator used to start development mode
servers.
| Name | Value |
_|_________________________|_________________________________________|
1| *User name: | weblogic |
2| *User password: | ********* |
3| *Confirm user password: | |
4| Description: | This user is the default administrator. |
Use above value or select another option:
1 - Modify "User name"
2 - Modify "User password"
3 - Modify "Confirm user password"
4 - Modify "Description"
5 - Discard Changes
Enter option number to select OR [Exit][Previous][Next]> 3
<--------------------------------------------- Fusion Middleware Configuration Wizard -------------------------------------------->
Configure Administrator User Name and Password:
-----------------------------------------------
Create a user to be assigned to the Administrator role. This user is the default administrator used to start development mode
servers.
"*Confirm user password:" = []
Enter new *Confirm user password: OR [Exit][Reset][Accept]>
<--------------------------------------------- Fusion Middleware Configuration Wizard -------------------------------------------->
Configure Administrator User Name and Password:
-----------------------------------------------
Create a user to be assigned to the Administrator role. This user is the default administrator used to start development mode
servers.
| Name | Value |
_|_________________________|_________________________________________|
1| *User name: | weblogic |
2| *User password: | ********* |
3| *Confirm user password: | ********* |
4| Description: | This user is the default administrator. |
Use above value or select another option:
1 - Modify "User name"
2 - Modify "User password"
3 - Modify "Confirm user password"
4 - Modify "Description"
5 - Discard Changes
Enter option number to select OR [Exit][Previous][Next]> next
<--------------------------------------------- Fusion Middleware Configuration Wizard -------------------------------------------->
Domain Mode Configuration:
--------------------------
Enable Development or Production Mode for this domain.
->1|Development Mode
2|Production Mode
Enter index number to select OR [Exit][Previous][Next]> 2
<--------------------------------------------- Fusion Middleware Configuration Wizard -------------------------------------------->
Java SDK Selection:
-------------------
1|Sun SDK 1.6.0_14 @ /u01/wls/weblogic10/jdk160_14_R27.6.5-32
->2|JRockit SDK 1.6.0_14 @ /u01/wls/weblogic10/jrockit_160_14_R27.6.5-32
3|Other Java SDK
Enter index number to select OR [Exit][Previous][Next]> 2
<--------------------------------------------- Fusion Middleware Configuration Wizard -------------------------------------------->
Select Optional Configuration:
------------------------------
1|Administration Server [ ]
2|Managed Servers, Clusters and Machines [ ]
3|RDBMS Security Store [ ]
Enter index number to select OR [Exit][Previous][Next]> 1
<--------------------------------------------- Fusion Middleware Configuration Wizard -------------------------------------------->
Select Optional Configuration:
------------------------------
1|Administration Server [x]
2|Managed Servers, Clusters and Machines [ ]
3|RDBMS Security Store [ ]
Enter index number to select OR [Exit][Previous][Next]> 2
<--------------------------------------------- Fusion Middleware Configuration Wizard -------------------------------------------->
Select Optional Configuration:
------------------------------
1|Administration Server [x]
2|Managed Servers, Clusters and Machines [x]
3|RDBMS Security Store [ ]
Enter index number to select OR [Exit][Previous][Next]> next
<--------------------------------------------- Fusion Middleware 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: | AdminServer |
2| *Listen address: | All Local Addresses |
3| Listen port: | 7001 |
4| SSL listen port: | N/A |
5| SSL enabled: | false |
Use above value or select another 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]> 2
<--------------------------------------------- Fusion Middleware 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: | AdminServer |
2| *Listen address: | All Local Addresses |
3| Listen port: | 7001 |
4| SSL listen port: | N/A |
5| SSL enabled: | false |
Enter value for "Listen address" OR [Exit][Previous][Next]> 172.19.114.203
<--------------------------------------------- Fusion Middleware 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: | AdminServer |
2| *Listen address: | 172.19.114.203 |
3| Listen port: | 7001 |
4| SSL listen port: | N/A |
5| SSL enabled: | false |
Use above value or select another option:
1 - Modify "Name"
2 - Modify "Listen address"
3 - Modify "Listen port"
4 - Modify "SSL enabled"
5 - Discard Changes
Enter option number to select OR [Exit][Previous][Next]> next
<--------------------------------------------- Fusion Middleware 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 OR [Exit][Previous][Next]> Server1
<--------------------------------------------- Fusion Middleware 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 |
_|_________|_____________________|_____________|_________________|_____________|
1->| Server1 | All Local Addresses | 7003 | N/A | false |
Use above value or select another option:
1 - Modify "Name"
2 - Modify "Listen address"
3 - Modify "Listen port"
4 - Modify "SSL enabled"
5 - Done
Enter option number to select OR [Exit][Previous][Next]> 2
<--------------------------------------------- Fusion Middleware 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 |
_|_________|_____________________|_____________|_________________|_____________|
1->| Server1 | All Local Addresses | 7003 | N/A | false |
Modify "Listen address" OR [Exit][Previous][Next]> 172.19.114.203
<--------------------------------------------- Fusion Middleware 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 |
_|_________|_________________|_____________|_________________|_____________|
1->| Server1 | 172.19.114.203 | 7003 | N/A | false |
Use above value or select another option:
1 - Modify "Name"
2 - Modify "Listen address"
3 - Modify "Listen port"
4 - Modify "SSL enabled"
5 - Done
Enter option number to select OR [Exit][Previous][Next]> 5
<--------------------------------------------- Fusion Middleware 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 |
_|_________|_________________|_____________|_________________|_____________|
1| Server1 | 172.19.114.203 | 7003 | N/A | false |
Use above value or select another option:
1 - Add
2 - Modify
3 - Delete
Enter option number to select OR [Exit][Previous][Next]> 1
<--------------------------------------------- Fusion Middleware 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 |
_|_________|_________________|_____________|_________________|_____________|
1| Server1 | 172.19.114.203 | 7003 | N/A | false |
Enter name for a new OR [Exit][Previous][Next]> Server2
<--------------------------------------------- Fusion Middleware 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 |
_|_________|_____________________|_____________|_________________|_____________|
1| Server1 | 172.19.114.203 | 7003 | N/A | false |
2->| Server2 | All Local Addresses | 7003 | N/A | false |
Use above value or select another option:
1 - Modify "Name"
2 - Modify "Listen address"
3 - Modify "Listen port"
4 - Modify "SSL enabled"
5 - Done
Enter option number to select OR [Exit][Previous][Next]> 2
<--------------------------------------------- Fusion Middleware 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 |
_|_________|_____________________|_____________|_________________|_____________|
1| Server1 | 172.19.114.203 | 7003 | N/A | false |
2->| Server2 | All Local Addresses | 7003 | N/A | false |
Use above value or select another option:
1 - Modify "Name"
2 - Modify "Listen address"
3 - Modify "Listen port"
4 - Modify "SSL enabled"
5 - Done
Modify "Listen address" OR [Exit][Previous][Next]> 172.19.114.204
<--------------------------------------------- Fusion Middleware 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 |
_|_________|_____________________|_____________|_________________|_____________|
1| Server1 | 172.19.114.203 | 7003 | N/A | false |
2->| Server2 | 172.19.114.204 | 7003 | N/A | false |
Use above value or select another option:
1 - Modify "Name"
2 - Modify "Listen address"
3 - Modify "Listen port"
4 - Modify "SSL enabled"
5 - Done
Enter option number to select OR [Exit][Previous][Next]> 5
<--------------------------------------------- Fusion Middleware 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 |
_|_________|_____________________|_____________|_________________|_____________|
1| Server1 | 172.19.114.203 | 7003 | N/A | false |
2->| Server2 | 172.19.114.204 | 7003 | N/A | false |
Use above value or select another option:
1 - Add
2 - Modify
3 - Delete
4 - Discard Changes
Enter option number to select OR [Exit][Previous][Next]> 1
<--------------------------------------------- Fusion Middleware 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 |
_|_________|_____________________|_____________|_________________|_____________|
1| Server1 | 172.19.114.203 | 7003 | N/A | false |
2->| Server2 | 172.19.114.204 | 7003 | N/A | false |
Enter name for a new OR [Exit][Previous][Next]> Server3
<--------------------------------------------- Fusion Middleware 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 |
_|_________|_____________________|_____________|_________________|_____________|
1| Server1 | 172.19.114.203 | 7003 | N/A | false |
2| Server2 | 172.19.114.204 | 7003 | N/A | false |
3->| Server3 | All Local Addresses | 7003 | N/A | false |
Use above value or select another option:
1 - Modify "Name"
2 - Modify "Listen address"
3 - Modify "Listen port"
4 - Modify "SSL enabled"
5 - Done
Enter option number to select OR [Exit][Previous][Next]> 2
<--------------------------------------------- Fusion Middleware 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 |
_|_________|_____________________|_____________|_________________|_____________|
1| Server1 | 172.19.114.203 | 7003 | N/A | false |
2| Server2 | 172.19.114.204 | 7003 | N/A | false |
3->| Server3 | All Local Addresses | 7003 | N/A | false |
Modify "Listen address" OR [Exit][Previous][Next]> 172.19.114.205
<--------------------------------------------- Fusion Middleware 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 |
_|_________|_____________________|_____________|_________________|_____________|
1| Server1 | 172.19.114.203 | 7003 | N/A | false |
2| Server2 | 172.19.114.204 | 7003 | N/A | false |
3->| Server3 | 172.19.114.205 | 7003 | N/A | false |
Use above value or select another option:
1 - Modify "Name"
2 - Modify "Listen address"
3 - Modify "Listen port"
4 - Modify "SSL enabled"
5 - Done
Enter option number to select OR [Exit][Previous][Next]> 5
<--------------------------------------------- Fusion Middleware 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 |
_|_________|_________________|_____________|_________________|_____________|
1| Server1 | 172.19.114.203 | 7003 | N/A | false |
2| Server2 | 172.19.114.204 | 7003 | N/A | false |
3->| Server3 | 172.19.114.205 | 7003 | N/A | false |
Use above value or select another option:
1 - Add
2 - Modify
3 - Delete
4 - Discard Changes
Enter option number to select OR [Exit][Previous][Next]> next
<--------------------------------------------- Fusion Middleware Configuration Wizard -------------------------------------------->
Configure Clusters:
-------------------
Add or delete configuration information for clusters. A cluster consists of multiple server instances working together to
provide increased scalability and reliability.
| Name* | Cluster messaging mode | Multicast address | Multicast port | Cluster address |
_|_______|________________________|___________________|________________|_________________|
Enter name for a new Cluster OR [Exit][Previous][Next]> cluster1
<--------------------------------------------- Fusion Middleware Configuration Wizard -------------------------------------------->
Configure Clusters:
-------------------
Add or delete configuration information for clusters. A cluster consists of multiple server instances working together to
provide increased scalability and reliability.
| Name* | Cluster messaging mode | Multicast address | Multicast port | Cluster address |
_|__________|________________________|___________________|________________|_________________|
1->| cluster1 | unicast | N/A | N/A | |
Use above value or select another option:
1 - Modify "Name"
2 - Modify "Cluster messaging mode"
3 - Modify "Cluster address"
4 - Done
Enter option number to select OR [Exit][Previous][Next]> 2
<--------------------------------------------- Fusion Middleware Configuration Wizard -------------------------------------------->
Configure Clusters:
-------------------
Add or delete configuration information for clusters. A cluster consists of multiple server instances working together to
provide increased scalability and reliability.
*Enter index number to modify "Cluster messaging mode"
1|multicast
->2|unicast
3|Unspecified
Enter index number to select OR [Exit][Reset][Accept]> 1
<--------------------------------------------- Fusion Middleware Configuration Wizard -------------------------------------------->
Configure Clusters:
-------------------
Add or delete configuration information for clusters. A cluster consists of multiple server instances working together to
provide increased scalability and reliability.
| Name* | Cluster messaging mode | Multicast address | Multicast port | Cluster address |
_|__________|________________________|___________________|________________|_________________|
1->| cluster1 | multicast | 239.192.0.0 | 7001 | |
Use above value or select another option:
1 - Add Cluster
2 - Modify Cluster
3 - Delete Cluster
4 - Discard Changes
Enter option number to select OR [Exit][Previous][Next]> next
<--------------------------------------------- Fusion Middleware Configuration Wizard -------------------------------------------->
Assign Servers to Clusters:
---------------------------
Assign Managed Servers to a cluster in the domain.
Cluster
|_____cluster1 [1]
Enter number exactly as it appears in brackets to toggle selection OR [Exit][Previous][Next]> next
<--------------------------------------------- Fusion Middleware Configuration Wizard -------------------------------------------->
Configure Machines:
-------------------
Add or delete machines. A machine hosts one or more WebLogic Server instances. The Admin Server and Node Manager use this
machine definition to start remote servers.
| Name* | Node manager listen address | Node manager listen port |
_|_______|_____________________________|__________________________|
Enter name for a new Machine OR [Exit][Previous][Next]> next
<--------------------------------------------- Fusion Middleware Configuration Wizard -------------------------------------------->
Creating Domain...
0% 25% 50% 75% 100%
[------------|------------|------------|------------]
[***************************************************]
編輯 WebLogic 口令文件
創建目錄<DOMAIN_NAME>/servers/<Server_name>/security並在該目錄下創建boot.properties 文件,內容為:
username=weblogic
password=weblogic1
將整個 WebLogic拷貝到另外兩個節點
啟動 WebLogic 服務
建議按照順序啟動服務器,只有當管理服務器首先啟動完畢后,受管服務器才能啟動 完成。當所有服務器的控制台上出現 Server started in RUNNING mode 字樣時,整個集群啟 動完畢。
啟動管理控制台
例如:
主管節點AdminServer啟動腳本:
mv web.logweb.`date+%Y%m%d_%H%M%S`.log
nohup sh /home/ap/projectap/app/weblogic/domains/projectdomain/AdminServer/startServer.sh >web.log 2>&1 &
被管節點app21啟動腳本:
mv w21.log w21.`date+%Y%m%d_%H%M%S`.log
nohup sh /home/ap/projectap/app/weblogic/domains/projectdomain/app21/startManagedServer.sh app21 t3://192.168.0.2:7001 >w21.log 2>&1 &
1、以weblogic用戶身份登錄登錄web03;
2、切換到<your_weblogic_base>/domain/<your_domainname>/bin目錄
3、執行nohup ./startWebLogic.sh &
啟動節點3【203】服務
1、以weblogic用戶身份登錄登錄web03;
2、切換到<your_weblogic_base>/domain/<your_domainname>/bin目錄
3、執行nohup ./startManagedWebLogic.sh Server1 http://172.19.114.203:7001 &
啟動節點4【204】服務
1、以weblogic用戶身份登錄登錄web04;
2、切換到<your_weblogic_base>/domain/<your_domainname>/bin目錄
3、執行nohup ./startManagedWebLogic.sh Server2 http://172.19.114.203:7001 &
啟動節點7【205】服務
1、以weblogic用戶身份登錄登錄web05;
2、切換到<your_weblogic_base>/domain/<your_domainname>/bin目錄
3、執行nohup ./startManagedWebLogic.sh Server3 http://172.19.114.203:7001 &
附:
startManagedWebLogic.sh用法:
Usage: ./startManagedWebLogic.sh SERVER_NAME {ADMIN_URL}
for example:
./startManagedWebLogic.sh managedserver1 http://node1.wang.com:7001 weblogicUserName weblogicPasswd
停止 WebLogic 服務
注意:停止腳本中使用到了DOMAIN_HOME和WL_HOME這兩個變量,在停止腳本中需要export這兩個變量為臨時環境變量:
例如:當前目錄為/home/ap/projectap/app/weblogic/domains/projectdomain:下面含有節點AdminServer、app21、app22等;
主管節點AdminServer的停止腳本stopAdmin.sh為:
./AdminServer/stopServer.sh weblogicUserName weblogicPasswd
被管節點app21的停止腳本stop21.sh為:
export DOMAIN_HOME=/home/ap/projectap/app/weblogic/domains/projectdomain/app21/supdomain #集群域目錄
export WL_HOME=/home/weblogichome/weblogic103/bea/wlserver_10.3 #weblogic 的根目錄
./app21/supdomain/bin/stopManagedWeblogic.sh app21 t3://192.168.0.2:7001 weblogicUserName weblogicPasswd
# 命令:./stopManagedWeblogic.sh節點名稱 主管節點URL:主管節點端口 weblogic用戶名 weblogic密碼
停止節點3【203】服務
1、以weblogic用戶身份登錄登錄web03;
2、切換到<your_weblogic_base>/domain/<your_domainname>/bin目錄
3、執行./stopManagedWebLogic.sh Server1 http://172.19.114.203:7001 weblogic weblogic1
停止節點4【204】服務
1、以weblogic用戶身份登錄登錄web04;
2、切換到<your_weblogic_base>/domain/<your_domainname>/bin目錄
3、執行./stopManagedWebLogic.sh Server2 http://172.19.114.203:7001 weblogic weblogic1
停止節點5【205】服務
1、以weblogic用戶身份登錄登錄web05;
2、切換到<your_weblogic_base>/domain/<your_domainname>/bin目錄
3、執行./stopManagedWebLogic.sh Server3 http://172.19.114.203:7001 weblogic weblogic1
stopManagedWebLogic.sh用法:
Usage: ./stopManagedWebLogic.sh {SERVER_NAME} {ADMIN_URL} {USER_NAME} {PASSWORD}
for example:
./stopManagedWebLogic.sh managedserver1 http:://node1.wang.com:7001 weblogic weblogic
配置apache服務器
手工將<weblogic_home>/server/plugin/linux/i686/mod_wl_20.so目錄下面的mod_wl_22.so文件拷貝到/usr/local/apache/modules/目錄下面.
修改/usr/local/apache/conf目錄下面的httpd.conf文件。 添加新的和WebLogic相關的應用模塊,在httpd.conf文件的最后加入如下語句:
# WebLogic Server plug-in
LoadModule weblogic_module modules/mod_wl_22.so
<Location />
SetHandler weblogic-handler
PathTrim /
</Location>
<IfModule mod_weblogic.c>
WebLogicCluster 172.19.114.203:7005, 172.19.114.204:7005, 172.19.114.205:7005
MatchExpression *.*
</IfModule>
編寫測試 WEB 應用並部署
這里我們將通過 Apache 中所帶的 ab 包(只需要單個文件 ab.exe 即可)來進行並發 訪問的模擬測試,使用如下的命令就可以完成壓力測試。
ab.exe -n 100 -c 10 http://172.19.114.203/test
pause
ab 是測試程序的名稱
參數 n 代表請求的總數量 參數 c 代表並發的請求數 url 為要測試壓力的頁面
注:使用這個命令時,一定要在系統路徑中能夠找到該程序,否則不能執行。 壓力測試完成后,我們從 Managed Server 的控制台上可以看到,ManagedServer_1,
ManagedServer_2,ManagedServer_3 都打印出了“OK”字樣,這說明,在並發請求的情況 下,集群能夠將請求進行分發,以達到負載平衡的目的。
注:單獨通過瀏覽器輸入地址 http://172.19.114.201/test然后刷新,您可能發現服 務器一直將請求轉發到單獨的一台受管服務器上,這是因為連接數過少所致,並非服務器集 群配置失敗;您可以停掉這台服務器,可以看到客戶端訪問仍能正常進行,而訪問則轉發到 了另外一台服務器上。
集群配置中要注意的問題
Admin Server 只用於集群的管理,而不能參與集群事務。
Web 應用應該部署到集群上(不能部署到 AdminServer 上),文件的同 步是由 WebLogic 來完成的。