当我与 Chef 合作进行自动化时,我需要为 weblogic 创建一本食谱。问题是,当执行说明书时,它会在最后一步挂起,这是完全正常的,因为该步骤运行 weblogic.Server Java 类以创建新域,然后运行服务器。所以,我想运行 weblogic.Server 来只创建域并继续执行最后的步骤。有没有办法做到这一点?
我已经尝试过这个论点weblogic.management.startupMode = SHUTDOWN
,但它不起作用。我知道考虑的论点,因为tail -n 1000 | grep SHUTDOWN
在日志文件中执行 a 时,我看到:
ip-addres-root:~ # tail -n 1000 -f /opt/middleware/weblogic/mydomain/servers/myserver/logs/myserver.log | grep SHUTDOW
weblogic.management.startupMode = SHUTDOWN
我正在使用它来创建域:
$JAVA_HOME/bin/java $JAVA_OPTIONS -Xmx1024m -Dweblogic.management.username=myuser \
-Dweblogic.management.password=mypassword1 \
-Dweblogic.management.GenerateDefaultConfig=true \
-Dweblogic.management.startupMode=SHUTDOWN weblogic.Server
如果我执行运行 weblogic 的步骤并尝试在输出末尾创建一个新域(使用上一个命令),则会看到:
<06-jul-2014 04H35' UTC> <Notice> <Security> <BEA-090082> <Security initializing using security realm myrealm.>
<06-jul-2014 04H35' UTC> <Warning> <Store> <BEA-280101> <The persistent file store "_WLS_myserver" is forced to use buffered I/O and so may have significantly degraded performance. Either the OS/hardware environment does not support the chosen write policy or the native wlfileio library is missing. See store open log messages for the requested and final write policies. See the documentation on store synchronous write policy configuration for advice.>
<06-jul-2014 04H35' UTC> <Warning> <HTTP> <BEA-101296> <Unable to load the default compiler class "com.sun.tools.javac.Main". Using the default javac compiler to compile JSPs.>
<06-jul-2014 04H35' UTC> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STANDBY>
<06-jul-2014 04H35' UTC> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING>
<06-jul-2014 04H35' UTC> <Notice> <Log Management> <BEA-170027> <The Server has established connection with the Domain level Diagnostic Service successfully.>
<06-jul-2014 04H35' UTC> <Notice> <Server> <BEA-002613> <Channel "Default[2]" is now listening on 127.0.0.2:7001 for protocols iiop, t3, ldap, snmp, http.>
<06-jul-2014 04H35' UTC> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on 10.101.1.63:7001 for protocols iiop, t3, ldap, snmp, http.>
<06-jul-2014 04H35' UTC> <Notice> <Server> <BEA-002613> <Channel "Default[1]" is now listening on 127.0.0.1:7001 for protocols iiop, t3, ldap, snmp, http.>
<06-jul-2014 04H35' UTC> <Notice> <WebLogicServer> <BEA-000331> <Started WebLogic Admin Server "myserver" for domain "mydomain" running in Development Mode>
<06-jul-2014 04H35' UTC> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to ADMIN>
<06-jul-2014 04H35' UTC> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RESUMING>
<06-jul-2014 04H35' UTC> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING>
<06-jul-2014 04H35' UTC> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode>
这让我认为 startupMode=SHUTDOWN 被忽略了,因为它最后说<Server started in RUNNING mode>
有没有办法创建一个域但不启动它,或者告诉厨师,在我不知道 15 分钟后继续?