本文重點:
- 直接啟動weblogic
- 控制台訪問
- weblogic概念及手工啟動腳本分析
- 啟動weblogic
- 啟動admin Server做了哪些事情
一、直接啟動weblogic
此時weblogic已經運行,默認會監聽在7001端口上。
上述示例是運行在 開發模式下面,如果生產模式需要輸入weblogic帳號密碼才能啟動。
二、控制台訪問
weblogic方式URL有三種:
- http://192.168.188.61:7001/console
- http://adminDNSName:7001/console
- https://192.168.188.61:7002/console # 此方式需要開啟SSL
瀏覽器訪問如下:
登錄頁面如下:
weblogic啟動完成。
三、weblogic概念及手工啟動weblogic
Weblogic server可以運行在大多數的java虛擬機上,比如openjdk,oracle jdk,以及bea公司出的Jrockit JDK
java運行時參數
java options ProgramOptions FullyQualifiedJavaClass
options:選項,例如: -Xms:動態堆的最小大小 -Xmx:動態堆的最大大小 -Dprop=val:程序可訪問的環境變量
|
啟動weblogic需要依賴:
- PATH:環境變量,要包含一系列依賴的可執行文件的路徑。
- CLASSPATH:包含所依賴的包。
配置PATH:
直接PATH=$JAVA_HOME/bin:$PATH
配置CLASSPATH:
- CLASSPATH必須包含的jar包:
${WL_HOME}/server/lib/weblogic.jar |
- CLASSPATH可選的包含的jar包:
${WL_HOME}/common/eval/pointbase/lib/pbclient51.jar ${WL_HOME}/common/eval/pointbase/lib/pbtools51.jar ${WL_HOME}/common/eval/pointbase/lib/pbembedded51.jar JDBC Startup classes, shutdown classes Other common classes |
示例1:不通過腳本,最小化參數啟動weblogic並訪問
[root@wls1 base_domains]# /opt/java/bin/java -classpath /opt/weblogic/wlserver_10.3/server/lib/weblogic.jar weblogic.Server <Jan 17, 2018 9:19:08 PM 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> <Jan 17, 2018 9:19:09 PM 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> <Jan 17, 2018 9:19:10 PM CST> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) 64-Bit Server VM Version 25.144-b01 from Oracle Corporation> <Jan 17, 2018 9:19:10 PM CST> <Info> <Management> <BEA-141107> <Version: WebLogic Server 10.3.6.0 Tue Nov 15 08:52:36 PST 2011 1441050 > <Jan 17, 2018 9:19:11 PM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING> <Jan 17, 2018 9:19:11 PM CST> <Info> <WorkManager> <BEA-002900> <Initializing self-tuning thread pool> <Jan 17, 2018 9:19:11 PM CST> <Notice> <LoggingService> <BEA-320400> <The log file /opt/wldomains/base_domains/servers/AdminServer/logs/AdminServer.log will be rotated. Reopen the log file if tailing has stopped. This can happen on some platforms like Windows.> <Jan 17, 2018 9:19:11 PM CST> <Notice> <LoggingService> <BEA-320401> <The log file has been rotated to /opt/wldomains/base_domains/servers/AdminServer/logs/AdminServer.log00003. Log messages will continue to be logged in /opt/wldomains/base_domains/servers/AdminServer/logs/AdminServer.log.> <Jan 17, 2018 9:19:11 PM CST> <Notice> <Log Management> <BEA-170019> <The server log file /opt/wldomains/base_domains/servers/AdminServer/logs/AdminServer.log is opened. All server side log events will be written to this file.> <Jan 17, 2018 9:19:11 PM CST> <Error> <Socket> <BEA-000438> <Unable to load performance pack. Using Java I/O instead. Please ensure that libmuxer library is in :'/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib' > <Jan 17, 2018 9:19:13 PM CST> <Notice> <Security> <BEA-090082> <Security initializing using security realm myrealm.> <Jan 17, 2018 9:19:13 PM CST> <Warning> <Store> <BEA-280109> <Unable to load the native wlfileio library for the persistent file store "_WLS_AdminServer". The store will use buffered I/O. The store is still operating in a transactionally safe synchronous mode. See store open log messages for the requested and final write policies.> <Jan 17, 2018 9:19:15 PM CST> <Warning> <HTTP> <BEA-101296> <Unable to load the default compiler class "com.sun.tools.javac.Main". Using the default javac compiler to compile JSPs.> <Jan 17, 2018 9:19:15 PM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STANDBY> <Jan 17, 2018 9:19:15 PM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING> <Jan 17, 2018 9:19:16 PM CST> <Notice> <LoggingService> <BEA-320400> <The log file /opt/wldomains/base_domains/servers/AdminServer/logs/base_domains.log will be rotated. Reopen the log file if tailing has stopped. This can happen on some platforms like Windows.> <Jan 17, 2018 9:19:16 PM CST> <Notice> <LoggingService> <BEA-320401> <The log file has been rotated to /opt/wldomains/base_domains/servers/AdminServer/logs/base_domains.log00003. Log messages will continue to be logged in /opt/wldomains/base_domains/servers/AdminServer/logs/base_domains.log.> <Jan 17, 2018 9:19:16 PM CST> <Notice> <Log Management> <BEA-170027> <The Server has established connection with the Domain level Diagnostic Service successfully.> <Jan 17, 2018 9:19:16 PM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to ADMIN> <Jan 17, 2018 9:19:16 PM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RESUMING> <Jan 17, 2018 9:19:16 PM CST> <Warning> <Server> <BEA-002611> <Hostname "localhost", maps to multiple IP addresses: 127.0.0.1, 0:0:0:0:0:0:0:1> <Jan 17, 2018 9:19:16 PM CST> <Notice> <Server> <BEA-002613> <Channel "Default[1]" is now listening on fe80:0:0:0:16a8:b4c:e936:926e:7001 for protocols iiop, t3, ldap, snmp, http.> <Jan 17, 2018 9:19:16 PM CST> <Notice> <Server> <BEA-002613> <Channel "Default[2]" is now listening on 127.0.0.1:7001 for protocols iiop, t3, ldap, snmp, http.> <Jan 17, 2018 9:19:16 PM CST> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on 192.168.188.61:7001 for protocols iiop, t3, ldap, snmp, http.> <Jan 17, 2018 9:19:16 PM CST> <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.> <Jan 17, 2018 9:19:16 PM CST> <Notice> <WebLogicServer> <BEA-000331> <Started WebLogic Admin Server "AdminServer" for domain "base_domains" running in Development Mode> <Jan 17, 2018 9:19:16 PM CST> <Warning> <Server> <BEA-002611> <Hostname "wls1", maps to multiple IP addresses: 192.168.188.61, fe80:0:0:0:16a8:b4c:e936:926e%2> <Jan 17, 2018 9:19:16 PM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING> <Jan 17, 2018 9:19:16 PM CST> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode>
[root@wls1 ~]# ps aux | grep java root 5470 161 9.2 3563872 356064 pts/0 Sl+ 21:46 0:09 /opt/java/bin/java -classpath /opt/weblogic/wlserver_10.3/server/lib/weblogic.jar weblogic.Server root 5497 0.0 0.0 112660 972 pts/2 R+ 21:46 0:00 grep --color=auto java
|
在/opt/wldomains/base_domains啟動,會讀該域下的配置文件配置並啟動。但是啟動的參數非常少,如ps aux | grep java 所示。
正常訪問:
示例2:在一個臨時路徑下直接啟動weblogic server
[root@wls1 temp]# /opt/java/bin/java -classpath /opt/weblogic/wlserver_10.3/server/lib/weblogic.jar weblogic.Server <Jan 17, 2018 9:24:03 PM 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> <Jan 17, 2018 9:24:05 PM 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> <Jan 17, 2018 9:24:06 PM CST> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) 64-Bit Server VM Version 25.144-b01 from Oracle Corporation>
/root/temp/config/config.xml not found
No config.xml was found. Would you like the server to create a default configuration and boot? (y/n): |
我創建一個臨時路徑temp,然后在該路徑下啟動,如上示例,沒多大意義就終止了。
示例3:一個正常的weblogic手工啟動的命令行
[root@wls1 base_domains]# /opt/java/bin/java -server -Xms512m -Xmx1024m -classpath /opt/weblogic/wlserver_10.3/server/lib/weblogic.jar -Dweblogic.Name=AdminServer -Dplatform.home=/opt/weblogic/wlserver_10.3 -Dweblogic.management.username=weblogic -Dweblogic.management.password='!QAZ2wsx' -Djava.security.policy=/opt/weblogic/wlserver_10.3/server/lib/weblogic.policy weblogic.Server <Jan 17, 2018 9:49:59 PM 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> <Jan 17, 2018 9:50:00 PM 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> <Jan 17, 2018 9:50:00 PM CST> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) 64-Bit Server VM Version 25.144-b01 from Oracle Corporation> <Jan 17, 2018 9:50:01 PM CST> <Info> <Management> <BEA-141107> <Version: WebLogic Server 10.3.6.0 Tue Nov 15 08:52:36 PST 2011 1441050 > <Jan 17, 2018 9:50:01 PM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING> <Jan 17, 2018 9:50:01 PM CST> <Info> <WorkManager> <BEA-002900> <Initializing self-tuning thread pool> <Jan 17, 2018 9:50:01 PM CST> <Notice> <LoggingService> <BEA-320400> <The log file /opt/wldomains/base_domains/servers/AdminServer/logs/AdminServer.log will be rotated. Reopen the log file if tailing has stopped. This can happen on some platforms like Windows.> <Jan 17, 2018 9:50:01 PM CST> <Notice> <LoggingService> <BEA-320401> <The log file has been rotated to /opt/wldomains/base_domains/servers/AdminServer/logs/AdminServer.log00006. Log messages will continue to be logged in /opt/wldomains/base_domains/servers/AdminServer/logs/AdminServer.log.> <Jan 17, 2018 9:50:01 PM CST> <Notice> <Log Management> <BEA-170019> <The server log file /opt/wldomains/base_domains/servers/AdminServer/logs/AdminServer.log is opened. All server side log events will be written to this file.> <Jan 17, 2018 9:50:02 PM CST> <Error> <Socket> <BEA-000438> <Unable to load performance pack. Using Java I/O instead. Please ensure that libmuxer library is in :'/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib' > <Jan 17, 2018 9:50:03 PM CST> <Notice> <Security> <BEA-090082> <Security initializing using security realm myrealm.> <Jan 17, 2018 9:50:04 PM CST> <Warning> <Store> <BEA-280109> <Unable to load the native wlfileio library for the persistent file store "_WLS_AdminServer". The store will use buffered I/O. The store is still operating in a transactionally safe synchronous mode. See store open log messages for the requested and final write policies.> <Jan 17, 2018 9:50:05 PM CST> <Warning> <HTTP> <BEA-101296> <Unable to load the default compiler class "com.sun.tools.javac.Main". Using the default javac compiler to compile JSPs.> <Jan 17, 2018 9:50:06 PM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STANDBY> <Jan 17, 2018 9:50:06 PM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING> <Jan 17, 2018 9:50:06 PM CST> <Notice> <LoggingService> <BEA-320400> <The log file /opt/wldomains/base_domains/servers/AdminServer/logs/base_domains.log will be rotated. Reopen the log file if tailing has stopped. This can happen on some platforms like Windows.> <Jan 17, 2018 9:50:06 PM CST> <Notice> <LoggingService> <BEA-320401> <The log file has been rotated to /opt/wldomains/base_domains/servers/AdminServer/logs/base_domains.log00006. Log messages will continue to be logged in /opt/wldomains/base_domains/servers/AdminServer/logs/base_domains.log.> <Jan 17, 2018 9:50:06 PM CST> <Notice> <Log Management> <BEA-170027> <The Server has established connection with the Domain level Diagnostic Service successfully.> <Jan 17, 2018 9:50:07 PM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to ADMIN> <Jan 17, 2018 9:50:07 PM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RESUMING> <Jan 17, 2018 9:50:07 PM CST> <Warning> <Server> <BEA-002611> <Hostname "localhost", maps to multiple IP addresses: 127.0.0.1, 0:0:0:0:0:0:0:1> <Jan 17, 2018 9:50:07 PM CST> <Notice> <Server> <BEA-002613> <Channel "Default[1]" is now listening on fe80:0:0:0:16a8:b4c:e936:926e:7001 for protocols iiop, t3, ldap, snmp, http.> <Jan 17, 2018 9:50:07 PM CST> <Notice> <Server> <BEA-002613> <Channel "Default[2]" is now listening on 127.0.0.1:7001 for protocols iiop, t3, ldap, snmp, http.> <Jan 17, 2018 9:50:07 PM CST> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on 192.168.188.61:7001 for protocols iiop, t3, ldap, snmp, http.> <Jan 17, 2018 9:50:07 PM CST> <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.> <Jan 17, 2018 9:50:07 PM CST> <Notice> <WebLogicServer> <BEA-000331> <Started WebLogic Admin Server "AdminServer" for domain "base_domains" running in Development Mode> <Jan 17, 2018 9:50:07 PM CST> <Warning> <Server> <BEA-002611> <Hostname "wls1", maps to multiple IP addresses: 192.168.188.61, fe80:0:0:0:16a8:b4c:e936:926e%2> <Jan 17, 2018 9:50:07 PM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING> <Jan 17, 2018 9:50:07 PM CST> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode>
[root@wls1 ~]# ps aux | grep java root 5548 44.1 12.7 3678524 491664 pts/0 Sl+ 21:49 0:13 /opt/java/bin/java -server -Xms512m -Xmx1024m -classpath /opt/weblogic/wlserver_10.3/server/lib/weblogic.jar -Dweblogic.Name=AdminServer -Dplatform.home=/opt/weblogic/wlserver_10.3 -Dweblogic.management.username=weblogic -Dweblogic.management.password=!QAZ2wsx -Djava.security.policy=/opt/weblogic/wlserver_10.3/server/lib/weblogic.policy weblogic.Server root 5588 0.0 0.0 112660 972 pts/2 S+ 21:50 0:00 grep --color=auto java |
weblogic server自帶的server腳本就是這樣用選項堆積起來的。
四、啟動腳本分析
weblogic server自帶的存放路徑:
/opt/wldomains/base_domains/startWebLogic.sh [root@wls1 base_domains]# cat startWebLogic.sh #!/bin/sh
# WARNING: This file is created by the Configuration Wizard. # Any changes to this script may be lost when adding extensions to this configuration.
DOMAIN_HOME="/opt/wldomains/base_domains"
${DOMAIN_HOME}/bin/startWebLogic.sh $* |
會啟動bin/startWebLogic.sh腳本
該腳本會去讀setDomainEnv.sh這是變量,最終執行效果如:第一步:直接啟動weblogic,所示
五、啟動admin Server做了哪些事情
- 讀取config/config.xml的配置信息,並加載至內存中,如有修改會寫入該配置文件。