首页 > 代码库 > weblogic新增域并进行Jconsole监听

weblogic新增域并进行Jconsole监听

一、创建域:

第一步,打开域配置界面:

[bofm@UAT02-BIZ-ZJCG-AP-002 bin]$ cd /home/software/weblogic/Oracle/Middleware/wlserver_10.3/common/bin
[bofm@UAT02-BIZ-ZJCG-AP-002 bin]$ sh config.sh

技术分享

第二步,域信息配置:

技术分享

指定域节点名称及域存放路径

技术分享

输入控制台用户名和密码:

技术分享

选择域启动模式:开发模式或生产模式

技术分享

选择需要配置的参数信息

技术分享

配置域服务信息

技术分享

完成创建

技术分享

完成域建设

技术分享

第三步,测试域是否可正常启动:

先通过sh方式启动域,测试是否存在异常情况:

[bofm@UAT02-BIZ-ZJCG-AP-008 fmump_domain]$ cd /app/bofm/cgdomains/fmump_domain
[bofm@UAT02-BIZ-ZJCG-AP-008 fmump_domain]$ sh startWebLogic.sh 
.
.
JAVA Memory arguments: -Xms256m -Xmx512m -XX:CompileThreshold=8000 -XX:PermSize=128m  -XX:MaxPermSize=256m
.
WLS Start Mode=Development
.
CLASSPATH=/home/software/weblogic/Oracle/Middleware/patch_wls1036/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/home/software/weblogic/Oracle/Middleware/patch_ocp371/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/home/software/weblogic/jdk1.6.0_45/lib/tools.jar:/home/software/weblogic/Oracle/Middleware/wlserver_10.3/server/lib/weblogic_sp.jar:/home/software/weblogic/Oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar:/home/software/weblogic/Oracle/Middleware/modules/features/weblogic.server.modules_10.3.6.0.jar:/home/software/weblogic/Oracle/Middleware/wlserver_10.3/server/lib/webservices.jar:/home/software/weblogic/Oracle/Middleware/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/home/software/weblogic/Oracle/Middleware/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar:/home/software/weblogic/Oracle/Middleware/wlserver_10.3/common/derby/lib/derbyclient.jar:/home/software/weblogic/Oracle/Middleware/wlserver_10.3/server/lib/xqrl.jar
.
PATH=/home/software/weblogic/Oracle/Middleware/wlserver_10.3/server/bin:/home/software/weblogic/Oracle/Middleware/modules/org.apache.ant_1.7.1/bin:/home/software/weblogic/jdk1.6.0_45/jre/bin:/home/software/weblogic/jdk1.6.0_45/bin:/home/software/jdk1.6.0_45/bin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/root/bin:/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/software/weblogic/jdk1.6.0_45/bin/java -client   -Xms256m -Xmx512m -XX:CompileThreshold=8000 -XX:PermSize=128m  -XX:MaxPermSize=256m -Dweblogic.Name=fmumpSrv -Djava.security.policy=/home/software/weblogic/Oracle/Middleware/wlserver_10.3/server/lib/weblogic.policy  -Xverify:none  -da -Dplatform.home=/home/software/weblogic/Oracle/Middleware/wlserver_10.3 -Dwls.home=/home/software/weblogic/Oracle/Middleware/wlserver_10.3/server -Dweblogic.home=/home/software/weblogic/Oracle/Middleware/wlserver_10.3/server   -Dweblogic.management.discover=true  -Dwlw.iterativeDev= -Dwlw.testConsole= -Dwlw.logErrorsToConsole= -Dweblogic.ext.dirs=/home/software/weblogic/Oracle/Middleware/patch_wls1036/profiles/default/sysext_manifest_classpath:/home/software/weblogic/Oracle/Middleware/patch_ocp371/profiles/default/sysext_manifest_classpath  weblogic.Server
<2017-4-12 下午02时19分32秒 CST> <Info> <Security> <BEA-090905> <Disabling CryptoJ JCE Provider self-integrity check for better startup performance. To enable this check, specify -Dweblogic.security.allowCryptoJDefaultJCEVerification=true> 
<2017-4-12 下午02时19分32秒 CST> <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> 
<2017-4-12 下午02时19分32秒 CST> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) 64-Bit Server VM Version 20.45-b01 from Sun Microsystems Inc.> 
<2017-4-12 下午02时19分32秒 CST> <Info> <Management> <BEA-141107> <Version: WebLogic Server 10.3.6.0  Tue Nov 15 08:52:36 PST 2011 1441050 > 
<2017-4-12 下午02时19分33秒 CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING> 
<2017-4-12 下午02时19分33秒 CST> <Info> <WorkManager> <BEA-002900> <Initializing self-tuning thread pool> 
<2017-4-12 下午02时19分33秒 CST> <Notice> <Log Management> <BEA-170019> <The server log file /app/bofm/cgdomains/fmump_domain/servers/fmumpSrv/logs/fmumpSrv.log is opened. All server side log events will be written to this file.> 
<2017-4-12 下午02时19分34秒 CST> <Notice> <Security> <BEA-090082> <Security initializing using security realm myrealm.> 
<2017-4-12 下午02时19分36秒 CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STANDBY> 
<2017-4-12 下午02时19分36秒 CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING> 
<2017-4-12 下午02时19分36秒 CST> <Notice> <Log Management> <BEA-170027> <The Server has established connection with the Domain level Diagnostic Service successfully.> 
<2017-4-12 下午02时19分36秒 CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to ADMIN> 
<2017-4-12 下午02时19分36秒 CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RESUMING> 
<2017-4-12 下午02时19分36秒 CST> <Notice> <Server> <BEA-002613> <Channel "Default[1]" is now listening on fe80:0:0:0:250:56ff:fe9a:804f:7002 for protocols iiop, t3, ldap, snmp, http.> 
<2017-4-12 下午02时19分36秒 CST> <Warning> <Server> <BEA-002611> <Hostname "localhost", maps to multiple IP addresses: 127.0.0.1, 0:0:0:0:0:0:0:1> 
<2017-4-12 下午02时19分36秒 CST> <Notice> <Server> <BEA-002613> <Channel "Default[2]" is now listening on 127.0.0.1:7002 for protocols iiop, t3, ldap, snmp, http.> 
<2017-4-12 下午02时19分36秒 CST> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on 192.168.8.69:7002 for protocols iiop, t3, ldap, snmp, http.> 
<2017-4-12 下午02时19分36秒 CST> <Notice> <Server> <BEA-002613> <Channel "Default[3]" is now listening on 0:0:0:0:0:0:0:1:7002 for protocols iiop, t3, ldap, snmp, http.> 
<2017-4-12 下午02时19分36秒 CST> <Notice> <WebLogicServer> <BEA-000331> <Started WebLogic Admin Server "fmumpSrv" for domain "fmump_domain" running in Development Mode> 
<2017-4-12 下午02时19分36秒 CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING> 
<2017-4-12 下午02时19分36秒 CST> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode>

访问控制台:

技术分享

技术分享

检测完成后,结束域运行,然后参考第四步启动域

第四步,启动域:

[bofm@UAT02-BIZ-ZJCG-AP-008 fmump_domain]$ nohup ./startWebLogic.sh &
[1] 9309
[bofm@UAT02-BIZ-ZJCG-AP-008 fmump_domain]$ nohup: 忽略输入并把输出追加到"nohup.out"

[bofm@UAT02-BIZ-ZJCG-AP-008 fmump_domain]$ netstat -anp|grep 7002   #检查端口信息
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 ::1:7002                    :::*                        LISTEN      9359/java           
tcp        0      0 fe80::250:56ff:fe9a:80:7002 :::*                        LISTEN      9359/java           
tcp        0      0 ::ffff:127.0.0.1:7002       :::*                        LISTEN      9359/java           
tcp        0      0 ::ffff:192.168.8.69:7002    :::*                        LISTEN      9359/java           
[bofm@UAT02-BIZ-ZJCG-AP-008 fmump_domain]$ ps -ef|grep java|grep umpSrv #检查进程信息
bofm      9359  9310 14 14:25 pts/1    00:00:09 /home/software/weblogic/jdk1.6.0_45/bin/java -client -Xms256m -Xmx512m -XX:CompileThreshold=8000 -XX:PermSize=128m -XX:MaxPermSize=256m -Dweblogic.Name=fmumpSrv -Djava.security.policy=/home/software/weblogic/Oracle/Middleware/wlserver_10.3/server/lib/weblogic.policy -Xverify:none -da -Dplatform.home=/home/software/weblogic/Oracle/Middleware/wlserver_10.3 -Dwls.home=/home/software/weblogic/Oracle/Middleware/wlserver_10.3/server -Dweblogic.home=/home/software/weblogic/Oracle/Middleware/wlserver_10.3/server -Dweblogic.management.discover=true -Dwlw.iterativeDev= -Dwlw.testConsole= -Dwlw.logErrorsToConsole= -Dweblogic.ext.dirs=/home/software/weblogic/Oracle/Middleware/patch_wls1036/profiles/default/sysext_manifest_classpath:/home/software/weblogic/Oracle/Middleware/patch_ocp371/profiles/default/sysext_manifest_classpath weblogic.Server
[bofm@UAT02-BIZ-ZJCG-AP-008 fmump_domain]$

如需停止域,则执行:

[bofm@UAT02-BIZ-ZJCG-AP-008 bin]$ sh stopWebLogic.sh 
Stopping Weblogic Server...

Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

Connecting to t3://UAT02-BIZ-ZJCG-AP-008:7002 with userid weblogic ...
Successfully connected to Admin Server ‘fmumpSrv‘ that belongs to domain ‘fmump_domain‘.

Warning: An insecure protocol was used to connect to the 
server. To ensure on-the-wire security, the SSL port or 
Admin port should be used instead.

Shutting down the server fmumpSrv with force=false while connected to fmumpSrv ...
WLST lost connection to the WebLogic Server that you were 
connected to, this may happen if the server was shutdown or 
partitioned. You will have to re-connect to the server once the 
server is available.
Disconnected from weblogic server: fmumpSrv
Disconnected from weblogic server: 


Exiting WebLogic Scripting Tool.

Done
Stopping Derby Server...
[1]+  Done                    nohup ./startWebLogic.sh  (wd: ~/cgdomains/fmump_domain)
(wd now: ~/cgdomains/fmump_domain/bin)
[bofm@UAT02-BIZ-ZJCG-AP-008 bin]$

二、配置Jsonsole监听

[bofm@UAT02-BIZ-ZJCG-AP-008 bin]$ pwd
/app/bofm/cgdomains/fmump_domain/bin
[bofm@UAT02-BIZ-ZJCG-AP-008 bin]$ vi startWebLogic.sh

添加一下内容:

JAVA_OPTIONS="${JAVA_OPTIONS}  -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=17002 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"

如图:

技术分享

启动域:

[bofm@UAT02-BIZ-ZJCG-AP-008 fmump_domain]$ nohup ./startWebLogic.sh &
[1] 9496
[bofm@UAT02-BIZ-ZJCG-AP-008 fmump_domain]$ nohup: 忽略输入并把输出追加到"nohup.out"

[bofm@UAT02-BIZ-ZJCG-AP-008 fmump_domain]$ netstat -anp|grep 7002 #检查开启的端口,7002是控制台端口,17002是jconsole监听端口
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 ::ffff:192.168.8.69:7002    :::*                        LISTEN      9546/java           
tcp        0      0 ::1:7002                    :::*                        LISTEN      9546/java           
tcp        0      0 fe80::250:56ff:fe9a:80:7002 :::*                        LISTEN      9546/java           
tcp        0      0 ::ffff:127.0.0.1:7002       :::*                        LISTEN      9546/java           
tcp        0      0 :::17002                    :::*                        LISTEN      9546/java           
[bofm@UAT02-BIZ-ZJCG-AP-008 fmump_domain]$

启动jconsole进行监控:

jconsole位于:$JAVA_HOME/bin目录下

技术分享

可以进行JVM信息监控:

技术分享

weblogic新增域并进行Jconsole监听