Weblogic集群部署手册
本文是讲述了Weblogic集群的安装和节点管理器的配置
操作系统:Red Hat Enterprise Linux Server release 6.3 (Santiago) 64-Bit
WLS介质:wls1035_generic.jar、p16088411_1035_Generic.zip
JDK版本:Java HotSpot(TM) 1.6.0_45 64-Bit
服务器列表如下:
服务器名称
| IP地址
| 端口
| 集群
| 计算机
|
AdminServer
| 150.18.23.201
| 7001
| --
| --
|
appSvr01
| 150.18.23.201
| 8001
| Cluster1
| Weblogic201
|
appSvr02
| 150.18.23.201
| 8002
| Cluster1
| Weblogic201
|
appSvr03
| 150.18.23.202
| 8001
| Cluster1
| Weblogic202
|
appSvr04
| 150.18.23.202
| 8002
| Cluster1
| Weblogic202
|
注意,这两台服务器的防火墙都已关闭,以免因防火墙导致的集群失败(例如节点管理器的通信失败);关于防火墙的安全策略的设置不在本文范围内。
1.JDK的环境变量配置
安装前新建weblogic用户:
#useradd -d /home/weblogic -s /bin/bash weblogic
并指定该用户单独的JDK环境,选用1.6.0_45(64bit)这个版本,配置如下如:
查看JDK版本命令:
java –version
javac –version
which java
如图说明JDK环境变量已经正确配置。(注意PATH的配置,不要把系统的PATH覆盖掉)
2.WLS的安装
由于本文所用的操作系统没有安装图形界面,这里选用文本模式安装Weblogic
安装命令:
java -jar -D64 wls1035_generic.jar -mode=console
按Enter(回车)进入下一步;
这里是设置Middleware Home,如果需要修改则输入具体路径,如果不需要修改,按Enter键进入下一步;
这里是设置安全更新,不在本文范围,输入3后按Enter键;
接着,输入NO来禁用安全更新;
这里会接着询问,输入Yes后则成功关闭安全更新;
按Enter进入下一步;
1是默认方式安装,2是自定义安装,这里选择默认安装,按Enter进入下一步;
选择JDK,2是上一步骤配置的JDK,[x]表示选择的JDK,敲Enter键进入下一步;
安装产品的目录确认,敲Enter键进入下一步;
安装组件的概览,敲Enter键进入下一步;
最下一行显示安装的进度条,等待安装的完成;
至此,WLS安装完成。
3.域的创建
在/home/weblogic/Oracle/Middleware/wlserver_10.3/common/bin目录下,config.sh用于创建域。
./config.sh
1是新建域,2是导入一个现成的域模版。默认是1,按Enter键进入下一步;
按Enter键进入下一步;
按Enter键进入下一步;
这里这是domain的名字,默认是base_domain,如果修改则输入新的名字后按Enter键进入下一步;
按Enter键进入下一步;
这里设置域的安装路径,取默认设置,按Enter键进入下一步;
按照提示设置主控的管理密码;
输入密码;
再次输入密码进行确认;
按Enter键进入下一步;
这里设置WLS的模式,1是默认的开发模式,2是生产模式,按需求选择;这里选开发模式,按Enter键进入下一步;
JDK的确认,按Enter键进入下一步;
(Managed Servers, Clusters and Machines将在控制台进行设置)
输入1,按Enter键进入下一步;
默认,按Enter键进入下一步;
4.添加受管Server、集群、配置节点管理器
启动主控
$cd /home/weblogic/Oracle/Middleware/user_projects/domains/myDomain/
$ nohup ./startWebLogic.sh &
启动日志如下:
[weblogic@Weblogic201 myDomain]$ cat nohup.out
.
.
JAVA Memory arguments: -Xms256m -Xmx512m -XX:CompileThreshold=8000 -XX:PermSize=128m -XX:MaxPermSize=256m
.
WLS Start Mode=Development
.
CLASSPATH=/home/weblogic/Oracle/Middleware/patch_wls1035/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/home/weblogic/Oracle/Middleware/patch_ocp360/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/home/weblogic/jdk1.6.0_45/lib/tools.jar:/home/weblogic/Oracle/Middleware/wlserver_10.3/server/lib/weblogic_sp.jar:/home/weblogic/Oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar:/home/weblogic/Oracle/Middleware/modules/features/weblogic.server.modules_10.3.5.0.jar:/home/weblogic/Oracle/Middleware/wlserver_10.3/server/lib/webservices.jar:/home/weblogic/Oracle/Middleware/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/home/weblogic/Oracle/Middleware/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar:/home/weblogic/Oracle/Middleware/wlserver_10.3/common/derby/lib/derbyclient.jar:/home/weblogic/Oracle/Middleware/wlserver_10.3/server/lib/xqrl.jar:.:/home/weblogic/jdk1.6.0_45$/lib:/home/weblogic/jdk1.6.0_45$/lib/tools.jar
.
PATH=/home/weblogic/Oracle/Middleware/wlserver_10.3/server/bin:/home/weblogic/Oracle/Middleware/modules/org.apache.ant_1.7.1/bin:/home/weblogic/jdk1.6.0_45/jre/bin:/home/weblogic/jdk1.6.0_45/bin:/home/weblogic/jdk1.6.0_45/bin:/home/weblogic/jdk1.6.0_45/jre/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/weblogic/bin
.
***************************************************
* To start WebLogic Server, use a username and *
* password assigned to an admin-level user. For *
* server administration, use the WebLogic Server *
* console at http://hostname:port/console *
***************************************************
starting weblogic with Java version:
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
Starting WLS with line:
/home/weblogic/jdk1.6.0_45/bin/java -client -Xms256m -Xmx512m -XX:CompileThreshold=8000 -XX:PermSize=128m -XX:MaxPermSize=256m -Dweblogic.Name=AdminServer -Djava.security.policy=/home/weblogic/Oracle/Middleware/wlserver_10.3/server/lib/weblogic.policy -Xverify:none -da -Dplatform.home=/home/weblogic/Oracle/Middleware/wlserver_10.3 -Dwls.home=/home/weblogic/Oracle/Middleware/wlserver_10.3/server -Dweblogic.home=/home/weblogic/Oracle/Middleware/wlserver_10.3/server -Dweblogic.management.discover=true -Dwlw.iterativeDev= -Dwlw.testConsole= -Dwlw.logErrorsToConsole= -Dweblogic.ext.dirs=/home/weblogic/Oracle/Middleware/patch_wls1035/profiles/default/sysext_manifest_classpath:/home/weblogic/Oracle/Middleware/patch_ocp360/profiles/default/sysext_manifest_classpath weblogic.Server
<Jun 25, 2015 9:32:48 PM HKT> <Info> <Security> <BEA-090905> <Disabling CryptoJ JCE Provider self-integrity check for better startup performance. To enable this check, specify -Dweblogic.security.allowCryptoJDefaultJCEVerification=true>
<Jun 25, 2015 9:32:49 PM HKT> <Info> <Security> <BEA-090906> <Changing the default Random Number Generator in RSA CryptoJ from ECDRBG to FIPS186PRNG. To disable this change, specify -Dweblogic.security.allowCryptoJDefaultPRNG=true>
<Jun 25, 2015 9:32:49 PM HKT> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) 64-Bit Server VM Version 20.45-b01 from Sun Microsystems Inc.>
<Jun 25, 2015 9:32:50 PM HKT> <Info> <Management> <BEA-141107> <Version: WebLogic Server 10.3.5.0 Fri Apr 1 20:20:06 PDT 2011 1398638 >
<Jun 25, 2015 9:32:51 PM HKT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING>
<Jun 25, 2015 9:32:51 PM HKT> <Info> <WorkManager> <BEA-002900> <Initializing self-tuning thread pool>
<Jun 25, 2015 9:32:51 PM HKT> <Notice> <LoggingService> <BEA-320400> <The log file /home/weblogic/Oracle/Middleware/user_projects/domains/myDomain/servers/AdminServer/logs/AdminServer.log will be rotated. Reopen the log file if tailing has stopped. This can happen on some platforms like Windows.>
<Jun 25, 2015 9:32:51 PM HKT> <Notice> <LoggingService> <BEA-320401> <The log file has been rotated to /home/weblogic/Oracle/Middleware/user_projects/domains/myDomain/servers/AdminServer/logs/AdminServer.log00001. Log messages will continue to be logged in /home/weblogic/Oracle/Middleware/user_projects/domains/myDomain/servers/AdminServer/logs/AdminServer.log.>
<Jun 25, 2015 9:32:51 PM HKT> <Notice> <Log Management> <BEA-170019> <The server log file /home/weblogic/Oracle/Middleware/user_projects/domains/myDomain/servers/AdminServer/logs/AdminServer.log is opened. All server side log events will be written to this file.>
<Jun 25, 2015 9:32:54 PM HKT> <Notice> <Security> <BEA-090082> <Security initializing using security realm myrealm.>
<Jun 25, 2015 9:32:54 PM HKT> <Notice> <LoggingService> <BEA-320400> <The log file /home/weblogic/Oracle/Middleware/user_projects/domains/myDomain/servers/AdminServer/logs/access.log will be rotated. Reopen the log file if tailing has stopped. This can happen on some platforms like Windows.>
<Jun 25, 2015 9:32:54 PM HKT> <Notice> <LoggingService> <BEA-320401> <The log file has been rotated to /home/weblogic/Oracle/Middleware/user_projects/domains/myDomain/servers/AdminServer/logs/access.log00001. Log messages will continue to be logged in /home/weblogic/Oracle/Middleware/user_projects/domains/myDomain/servers/AdminServer/logs/access.log.>
<Jun 25, 2015 9:32:56 PM HKT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STANDBY>
<Jun 25, 2015 9:32:56 PM HKT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING>
<Jun 25, 2015 9:32:57 PM HKT> <Notice> <LoggingService> <BEA-320400> <The log file /home/weblogic/Oracle/Middleware/user_projects/domains/myDomain/servers/AdminServer/logs/myDomain.log will be rotated. Reopen the log file if tailing has stopped. This can happen on some platforms like Windows.>
<Jun 25, 2015 9:32:57 PM HKT> <Notice> <LoggingService> <BEA-320401> <The log file has been rotated to /home/weblogic/Oracle/Middleware/user_projects/domains/myDomain/servers/AdminServer/logs/myDomain.log00001. Log messages will continue to be logged in /home/weblogic/Oracle/Middleware/user_projects/domains/myDomain/servers/AdminServer/logs/myDomain.log.>
<Jun 25, 2015 9:32:57 PM HKT> <Notice> <Log Management> <BEA-170027> <The Server has established connection with the Domain level Diagnostic Service successfully.>
<Jun 25, 2015 9:32:57 PM HKT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to ADMIN>
<Jun 25, 2015 9:32:57 PM HKT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RESUMING>
<Jun 25, 2015 9:32:57 PM HKT> <Warning> <Server> <BEA-002611> <Hostname "localhost", maps to multiple IP addresses: 127.0.0.1, 0:0:0:0:0:0:0:1>
<Jun 25, 2015 9:32:57 PM HKT> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on 150.18.23.201:7001 for protocols iiop, t3, ldap, snmp, http.>
<Jun 25, 2015 9:32:57 PM HKT> <Notice> <Server> <BEA-002613> <Channel "Default[3]" is now listening on 0:0:0:0:0:0:0:1:7001 for protocols iiop, t3, ldap, snmp, http.>
<Jun 25, 2015 9:32:57 PM HKT> <Notice> <Server> <BEA-002613> <Channel "Default[1]" is now listening on fe80:0:0:0:20c:29ff:fe94:8d0c:7001 for protocols iiop, t3, ldap, snmp, http.>
<Jun 25, 2015 9:32:57 PM HKT> <Notice> <Server> <BEA-002613> <Channel "Default[2]" is now listening on 127.0.0.1:7001 for protocols iiop, t3, ldap, snmp, http.>
<Jun 25, 2015 9:32:57 PM HKT> <Notice> <WebLogicServer> <BEA-000331> <Started WebLogic Admin Server "AdminServer" for domain "myDomain" running in Development Mode>
<Jun 25, 2015 9:32:57 PM HKT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING>
<Jun 25, 2015 9:32:57 PM HKT> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode>
浏览器访问http://150.18.23.201:7001/console
4.1.新建受管服务器
服务器—新建
设置服务器信息,比如appSrv01
点击“完成”,如下图
同理,新建appSvr02
至此,新建受管服务器的操作已完成。
4.2.新建集群并添加成员
集群—新建
设置集群名称、消息传送模式选择“单点传送”,然后点确定
点击集群名称,查看集群的配置信息
集群地址按需求设置,这里不设置;
集群—配置—服务器—添加
将之前新建的appSvr01,appSvr02添加到集群成员中
同理,将appSrv02按照相同的方法加入集群
至此,新建集群并添加成员的操作已完成。
4.3.配置节点管理器
查看服务器的主机名
[weblogic@Weblogic201 myDomain]$ hostname
Weblogic201
新建计算机
计算机的名称为服务器的主机名,计算机操作系统,这里选“其他”,然后“下一步”
节点管理的属性,通信类型这里选“普通”,监听地址为节点管理器所在的服务器IP地址;完成。
将受管server与节点管理器关联
计算机—配置—服务器—添加
将appSvr01、appSvr02关联到该节点管理器中
至此,节点管理器的配置已完成。
4.4.启动节点管理器的进程,在控制台管理受管服务器的生命周期
修改节点管理器的nodemanager.properties文件配置
将SecureListener=true改为SecureListener=false
节点管理的启动脚本路径以及启动命令
$ cd /home/weblogic/Oracle/Middleware/wlserver_10.3/server/bin
$ nohup ./startNodeManager.sh &
jps
启动日志如下:
[weblogic@Weblogic201 bin]$ cat nohup.out
+ CLASSPATH='/home/weblogic/Oracle/Middleware/patch_wls1035/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/home/weblogic/Oracle/Middleware/patch_ocp360/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/home/weblogic/jdk1.6.0_45/lib/tools.jar:/home/weblogic/Oracle/Middleware/wlserver_10.3/server/lib/weblogic_sp.jar:/home/weblogic/Oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar:/home/weblogic/Oracle/Middleware/modules/features/weblogic.server.modules_10.3.5.0.jar:/home/weblogic/Oracle/Middleware/wlserver_10.3/server/lib/webservices.jar:/home/weblogic/Oracle/Middleware/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/home/weblogic/Oracle/Middleware/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar:.:/home/weblogic/jdk1.6.0_45$/lib:/home/weblogic/jdk1.6.0_45$/lib/tools.jar:/home/weblogic/Oracle/Middleware'
+ export CLASSPATH
+ export PATH
+ cd /home/weblogic/Oracle/Middleware/wlserver_10.3/common/nodemanager
+ set -x
+ '[' '' '!=' '' ']'
+ '[' '' '!=' '' ']'
+ /home/weblogic/jdk1.6.0_45/bin/java -client -Xms32m -Xmx200m -XX:MaxPermSize=128m -Dcoherence.home=/home/weblogic/Oracle/Middleware/coherence_3.6 -Dbea.home=/home/weblogic/Oracle/Middleware -Xverify:none -Djava.security.policy=/home/weblogic/Oracle/Middleware/wlserver_10.3/server/lib/weblogic.policy -Dweblogic.nodemanager.javaHome=/home/weblogic/jdk1.6.0_45 weblogic.NodeManager -v
<Jun 25, 2015 10:28:29 PM> <INFO> <Loading domains file: /home/weblogic/Oracle/Middleware/wlserver_10.3/common/nodemanager/nodemanager.domains>
Jun 25, 2015 10:28:29 PM weblogic.nodemanager.server.NMServerConfig initDomainsMap
INFO: Loading domains file: /home/weblogic/Oracle/Middleware/wlserver_10.3/common/nodemanager/nodemanager.domains
<Jun 25, 2015 10:28:29 PM> <INFO> <Loaded node manager configuration properties from '/home/weblogic/Oracle/Middleware/wlserver_10.3/common/nodemanager/nodemanager.properties'>
Jun 25, 2015 10:28:29 PM weblogic.nodemanager.server.NMServer <init>
INFO: Loaded node manager configuration properties from '/home/weblogic/Oracle/Middleware/wlserver_10.3/common/nodemanager/nodemanager.properties'
Node manager v10.3
Configuration settings:
NodeManagerHome=/home/weblogic/Oracle/Middleware/wlserver_10.3/common/nodemanager
ListenAddress=
ListenPort=5556
ListenBacklog=50
SecureListener=false
AuthenticationEnabled=true
NativeVersionEnabled=true
CrashRecoveryEnabled=false
JavaHome=/home/weblogic/jdk1.6.0_45/jre
StartScriptEnabled=false
StopScriptEnabled=false
StartScriptName=startWebLogic.sh
StopScriptName=
LogFile=/home/weblogic/Oracle/Middleware/wlserver_10.3/common/nodemanager/nodemanager.log
LogLevel=INFO
LogLimit=0
LogCount=1
LogAppend=true
LogToStderr=true
LogFormatter=weblogic.nodemanager.server.LogFormatter
DomainsFile=/home/weblogic/Oracle/Middleware/wlserver_10.3/common/nodemanager/nodemanager.domains
DomainsFileEnabled=true
StateCheckInterval=500
UseMACBroadcast=false
DomainRegistrationEnabled=false
DomainsDirRemoteSharingEnabled=false
Domain name mappings:
myDomain -> /home/weblogic/Oracle/Middleware/user_projects/domains/myDomain
<Jun 25, 2015 10:28:31 PM> <INFO> <Plain socket listener started on port 5556>
Jun 25, 2015 10:28:31 PM weblogic.nodemanager.server.Listener run
INFO: Plain socket listener started on port 5556
[weblogic@Weblogic201 bin]$
给server添加启动参数,“服务器—server—配置—服务器启动”,例如
-client -Xms256m -Xmx512m -XX:PermSize=64m -XX:MaxPermSize=256m -XX:CompileThreshold=8000
添加受管服务器的启动参数,appSvr02同理操作
在控制台上,勾选受管服务器并启动
由于是开发模式,所以点击“启动”并没有提示,直接变成STARTING状态
最后,受管服务器启动成功后,状态为RUNNING;
在控制的选项中,启动和关闭是相对的,挂起和恢复是相对的。
5.添加另一台服务器,并新建受管服务加入集群
由于另一台服务的操作系统、weblogic用户完全一样,这里采用拷贝的方式进行集群的扩展。
cd
scp -rq .bash_profile weblogic@150.18.23.202:/home/weblogic/
scp -rq ./Oracle weblogic@150.18.23.202:/home/weblogic/
scp -r ./jdk1.6.0_45 weblogic@150.18.23.202:/home/weblogic/
删除servers下的受管服务器的配置,批量替换与主机名和IP地址相关的配置:
cd /home/weblogic/Oracle/Middleware/user_projects/domains/myDomain/servers
rm -rf appSvr01
rm –rf appSvr02
cd /home/weblogic/Oracle
grep -r 'Weblogic201' ./ awk -F: '{print $1}' xargs sed s#''Weblogic201' #''Weblogic202' #g -i
grep -r '150.18.23.201' ./ awk -F: '{print $1}' xargs sed s#'150.18.23.201#'150.18.23.202#g –i
按照上一节4的方式,配置Weblogic202的受管服务器、添加成员、配置节点管理器、最后在控制台控制受管服务的生命周期。
新建计算机
新建受管服务
新建的受管服务加入集群,并且关联到计算机Weblogic202,分别给appSvr03、appSvr04增加启动参数(服务器—server—配置—服务器启动):
-client -Xms256m -Xmx512m -XX:PermSize=64m -XX:MaxPermSize=256m -XX:CompileThreshold=8000
如下图,完成集群的配置
启动Weblogic202的节点管理器
在“控制”点击按钮管理受管服务的生命周期