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这两个变量为临时环境变量:
若需要修改停止脚本为强制停止模式,则需修改stopWebLogic.sh脚本:
cp stopWebLogic.sh stopWebLogic.sh.bak
修改内容
echo "shutdown('${SERVER_NAME}','Server')" >>"shutdown.py"
为
echo "shutdown('${SERVER_NAME}','Server',force='true')" >>"shutdown.py"
例如:当前目录为/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 来完成的。