【WebLogic】通过WLST命令行为WebLogic 14c创建域
OracleWebLogic早期版本,如10g、11g,都支持GUI界面以及控制台模式创建应用域,但是从12c开始,控制台模式创建应用域的模式被取消了。而生产环境的Linux服务器,一般都不会采用带gnome桌面的安装模式,通常用的都是最小化模式。不过我们还是可以通过WebLogic自带的wlst脚本来创建一个简单的应用域。下面的命令就演示了在本地虚拟机,通过wlst脚本来创建一个简单的应用域,只
·
Oracle WebLogic早期版本,如10g、11g,都支持GUI界面以及控制台模式创建应用域,但是从12c开始,控制台模式创建应用域的模式被取消了。而生产环境的Linux服务器,一般都不会采用带gnome桌面的安装模式,通常用的都是最小化模式。这样WebLogic 12c、14c,创建应用域就比较麻烦了。不过我们还是可以通过WebLogic自带的wlst脚本来创建一个简单的应用域。
下面的命令就演示了在本地虚拟机,通过wlst脚本来创建一个简单的应用域,只创建应用域和管理服务器,受管服务器可以在控制台来创建。
这个目录下的wlst脚本已经不推荐使用了!
[app@www ~]$ sh /weblogic/Oracle/Middleware/Oracle_Home/wlserver/common/bin/wlst.sh
WARNING: This is a deprecated script. Please invoke the wlst.sh script under oracle_common/common/bin.
Initializing WebLogic Scripting Tool (WLST) ...
Welcome to WebLogic Server Administration Scripting Shell
Type help() for help on available commands
wls:/offline> exit()
Exiting WebLogic Scripting Tool.
使用下面的脚本成功创建。
[app@www ~]$ sh /weblogic/Oracle/Middleware/Oracle_Home/oracle_common/common/bin/wlst.sh
Initializing WebLogic Scripting Tool (WLST) ...
Welcome to WebLogic Server Administration Scripting Shell
Type help() for help on available commands
wls:/offline> selectTemplate('Basic WebLogic Server Domain');
wls:/offline/>loadTemplates();
wls:/offline/base_domain>cd('Servers/AdminServer');
wls:/offline/base_domain/Server/AdminServer>set('ListenAddress','192.168.223.199');
wls:/offline/base_domain/Server/AdminServer>set('ListenPort', 9600);
wls:/offline/base_domain/Server/AdminServer>cd('/')
wls:/offline/base_domain>cd('Security/base_domain/User/weblogic')
wls:/offline/base_domain/Security/base_domain/User/weblogic>cmo.setPassword('weblogic!123')
wls:/offline/base_domain/Security/base_domain/User/weblogic>setOption('OverwriteDomain', 'true')
wls:/offline/base_domain/Security/base_domain/User/weblogic>writeDomain('/app/domains/wls14cdomain')
wls:/offline/wls14cdomain/Security/wls14cdomain/User/weblogic>closeTemplate()
wls:/offline>exit()
Exiting WebLogic Scripting Tool.
上面的命令是在cli界面一条一条输入的,如果嫌麻烦,可以将上面的命令保存为一个py文件,然后直接使用wlst脚本运行即可。
# createDomain.py
selectTemplate('Basic WebLogic Server Domain');
loadTemplates();
cd('Servers/AdminServer');
set('ListenAddress','192.168.223.199');
set('ListenPort', 9600);
cd('/')
cd('Security/base_domain/User/weblogic')
cmo.setPassword('weblogic!123')
setOption('OverwriteDomain', 'true')
writeDomain('/app/domains/wls14cdomain')
closeTemplate()
exit()
创建
[app@www ~]$ /weblogic/Oracle/Middleware/Oracle_Home/oracle_common/common/bin/wlst.sh ./creatDomain.py
Initializing WebLogic Scripting Tool (WLST) ...
Welcome to WebLogic Server Administration Scripting Shell
Type help() for help on available commands
Exiting WebLogic Scripting Tool.
[app@www ~]$ cd domains/
[app@www domains]$ ls
wls12cdomain wls14cdomain
[app@www domains]$ cd wls14cdomain/
[app@www wls14cdomain]$ ls
autodeploy bin common config console-ext fileRealm.properties init-info lib nodemanager resources security servers startWebLogic.sh
控制台密码会在服务器的目录里面生成,并被加密。此时AdminServer并没有启动!
[app@www ~]$ cd domains/wls14cdomain/servers/AdminServer/security/
[app@www security]$ cat boot.properties
# Generated by Configuration Wizard on Fri Jul 22 10:05:30 CST 2022
username={AES256}R2N/k8NR4w8ZJE23d/jmxkJrm8M9oQnRnJVTDCvOXzc=
password={AES256}7dB7KBxcEPtbWT4KzKdBW1d9j+llODMOX2fNctDDGak=
启动管理服务器
[app@www ~]$ cd domains/
[app@www domains]$ ls
wls12cdomain wls14cdomain
[app@www domains]$ cd wls14cdomain/
[app@www wls14cdomain]$ ls
autodeploy bin common config console-ext fileRealm.properties init-info lib nodemanager resources security servers startWebLogic.sh
[app@www wls14cdomain]$ sh startWebLogic.sh
.
.
JAVA Memory arguments: -Xms256m -Xmx512m -XX:CompileThreshold=8000
.
CLASSPATH=/usr/jdk1.8.0_341/lib/tools.jar:/weblogic/Oracle/Middleware/Oracle_Home/wlserver/server/lib/weblogic.jar:/weblogic/Oracle/Middleware/Oracle_Home/wlserver/../oracle_common/modules/thirdparty/ant-contrib-1.0b3.jar:/weblogic/Oracle/Middleware/Oracle_Home/wlserver/modules/features/oracle.wls.common.nodemanager.jar::/weblogic/Oracle/Middleware/Oracle_Home/wlserver/common/derby/lib/derbynet.jar:/weblogic/Oracle/Middleware/Oracle_Home/wlserver/common/derby/lib/derbyclient.jar:/weblogic/Oracle/Middleware/Oracle_Home/wlserver/common/derby/lib/derby.jar:.:/usr/jdk1.8.0_333/lib:/usr/jdk1.8.0_333/lib/tools.jar
.
PATH=/app/domains/wls14cdomain/bin:/weblogic/Oracle/Middleware/Oracle_Home/wlserver/server/bin:/weblogic/Oracle/Middleware/Oracle_Home/wlserver/../oracle_common/modules/thirdparty/org.apache.ant/1.10.5.0.0/apache-ant-1.10.5/bin:/usr/jdk1.8.0_341/jre/bin:/usr/jdk1.8.0_341/bin:/usr/jdk1.8.0_333/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/usr/local/bin:/app/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 WLS with line:
/usr/jdk1.8.0_341/bin/java -server -Xms256m -Xmx512m -XX:CompileThreshold=8000 -cp /weblogic/Oracle/Middleware/Oracle_Home/wlserver/server/lib/weblogic-launcher.jar -Dlaunch.use.env.classpath=true -Dweblogic.Name=AdminServer -Djava.security.policy=/weblogic/Oracle/Middleware/Oracle_Home/wlserver/server/lib/weblogic.policy -Djava.system.class.loader=com.oracle.classloader.weblogic.LaunchClassLoader -javaagent:/weblogic/Oracle/Middleware/Oracle_Home/wlserver/server/lib/debugpatch-agent.jar -da -Dwls.home=/weblogic/Oracle/Middleware/Oracle_Home/wlserver/server -Dweblogic.home=/weblogic/Oracle/Middleware/Oracle_Home/wlserver/server -Djava.endorsed.dirs=/usr/jdk1.8.0_341/jre/lib/endorsed:/weblogic/Oracle/Middleware/Oracle_Home/wlserver/../oracle_common/modules/endorsed:/weblogic/Oracle/Middleware/Oracle_Home/wlserver/modules/endorsed weblogic.Server
<2022-7-22 上午09时21分08秒 CST> <Info> <Security> <BEA-090905> <Disabling the CryptoJ JCE Provider self-integrity check for better startup performance. To enable this check, specify -Dweblogic.security.allowCryptoJDefaultJCEVerification=true.>
<2022-7-22 上午09时21分08秒 CST> <Info> <Security> <BEA-090906> <Changing the default Random Number Generator in RSA CryptoJ from ECDRBG128 to HMACDRBG. To disable this change, specify -Dweblogic.security.allowCryptoJDefaultPRNG=true.>
<2022-7-22 上午09时21分08秒 CST> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) 64-Bit Server VM Version 25.341-b25 from Oracle Corporation.>
<2022-7-22 上午09时21分12秒 CST> <Info> <Management> <BEA-141107> <Version: WebLogic Server 14.1.1.0.0
OPatch Patches:
No patches installed>
<2022-7-22 上午09时21分13秒 CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING.>
<2022-7-22 上午09时21分13秒 CST> <Info> <WorkManager> <BEA-002900> <Initializing self-tuning thread pool.>
<2022-7-22 上午09时21分14,453秒 CST> <Notice> <Log Management> <BEA-170019> <The server log file weblogic.logging.FileStreamHandler instance=440559002
Current log file=/app/domains/wls14cdomain/servers/AdminServer/logs/AdminServer.log
Rotation dir=/app/domains/wls14cdomain/servers/AdminServer/logs
is opened. All server side log events will be written to this file.>
<2022-7-22 上午09时21分14,632秒 CST> <Notice> <Security> <BEA-090946> <Security pre-initializing using security realm: myrealm>
<2022-7-22 上午09时21分15,141秒 CST> <Notice> <Security> <BEA-090947> <Security post-initializing using security realm: myrealm>
<2022-7-22 上午09时21分15,790秒 CST> <Notice> <Security> <BEA-090082> <Security initialized using administrative security realm: myrealm>
<2022-7-22 上午09时21分16,275秒 CST> <Notice> <JMX> <BEA-149512> <JMX Connector Server started at service:jmx:iiop://192.168.223.199:9600/jndi/weblogic.management.mbeanservers.runtime.>
<2022-7-22 上午09时21分16,593秒 CST> <Notice> <JMX> <BEA-149512> <JMX Connector Server started at service:jmx:iiop://192.168.223.199:9600/jndi/weblogic.management.mbeanservers.domainruntime.>
<2022-7-22 上午09时21分16,741秒 CST> <Notice> <JMX> <BEA-149512> <JMX Connector Server started at service:jmx:iiop://192.168.223.199:9600/jndi/weblogic.management.mbeanservers.edit.>
<2022-7-22 上午09时21分17,724秒 CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STANDBY.>
<2022-7-22 上午09时21分17,725秒 CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING.>
<2022-7-22 上午09时21分17,780秒 CST> <Notice> <Log Management> <BEA-170036> <The Logging monitoring service timer has started to check for logged message counts every 30 seconds.>
<2022-7-22 上午09时21分18,059秒 CST> <Notice> <Security> <BEA-090171> <Loading the identity certificate and private key stored under the alias DemoIdentity from the jks keystore file /app/domains/wls14cdomain/security/DemoIdentity.jks.>
<2022-7-22 上午09时21分18,068秒 CST> <Notice> <Security> <BEA-090169> <Loading trusted certificates from the jks keystore file /weblogic/Oracle/Middleware/Oracle_Home/wlserver/server/lib/DemoTrust.jks.>
<2022-7-22 上午09时21分18,076秒 CST> <Notice> <Security> <BEA-090169> <Loading trusted certificates from the jks keystore file /usr/jdk1.8.0_341/jre/lib/security/cacerts.>
<2022-7-22 上午09时21分18,345秒 CST> <Notice> <Log Management> <BEA-170027> <The server has successfully established a connection with the Domain level Diagnostic Service.>
<2022-7-22 上午09时21分18,570秒 CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to ADMIN.>
<2022-7-22 上午09时21分18,625秒 CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RESUMING.>
<2022-7-22 上午09时21分18,782秒 CST> <Notice> <WebLogicServer> <BEA-000331> <Started the WebLogic Server Administration Server "AdminServer" for domain "wls14cdomain" running in development mode.>
<2022-7-22 上午09时21分18,782秒 CST> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on 192.168.223.199:9600 for protocols iiop, t3, ldap, snmp, http.>
<2022-7-22 上午09时21分18,782秒 CST> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on 192.168.223.199:9600 for protocols iiop, t3, ldap, snmp, http.>
<2022-7-22 上午09时21分18,799秒 CST> <Notice> <WebLogicServer> <BEA-000360> <The server started in RUNNING mode.>
<2022-7-22 上午09时21分18,814秒 CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING.>
<2022-7-22 上午09时21分49,358秒 CST> <Warning> <Socket> <BEA-000449> <Closing the socket, as no data read from it on 192.168.223.1:57,327 during the configured idle timeout of 5 seconds.>
访问下WebLogic 14c的管理控制台,页面还是很漂亮的。
更多推荐
已为社区贡献5条内容
所有评论(0)