java - Weblogic 在 VM(VirtualBox 和 VMware)下启动缓慢(11 分钟)

标签 java weblogic virtual-machine vmware virtualbox

(已解决!通过伪造系统随机生成器,见下文)

我正在为我的开发/构建团队设置 VM 镜像。在该 VM 内,应该运行一个 Weblogic 域。我使用 Ububtu 服务器发行版,WLS 9.2MP3 + ALSB。

一切正常,速度非常快,但在开始时 WLS 会停止两次,持续一段可测量的时间。总共停两站大约延迟 10 分钟。对于部署需要重新启动服务器的任务,这非常烦人。 :-(

hibernate 时间不是固定的,有时服务器启动很快,有时马马虎虎,有时10分钟或更长时间。

有趣的是,如果我在查看已停止的服务器时按 Enter,它会更快唤醒,有时会在几秒钟后唤醒。 WLST(Weblogic Jython shell)在 VM 中执行时也会挂起很长时间。不过它对 Enter 没有反应。

这肯定是一些用虚拟机运行 WLS 的开发人员。我想知道其他人是否有同样的问题?有人能解决吗?

这是服务器输出(仅用于案例):

Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_12-b04)
Java HotSpot(TM) Client VM (build 1.5.0_12-b04, mixed mode)
Starting WLS with line:
/shared2/beahome/jdk150_12/bin/java -client   -Xmx256m  -XX:MaxPermSize=128m  -Xverify:none  -da -Dplatform.home=/shared2/beahome/weblogic92
 -Dwls.home=/shared2/beahome/weblogic92/server -Dwli.home=/shared2/beahome/weblogic92/integration  -Dweblogic.management.discover=true  -Dwl
w.iterativeDev= -Dwlw.testConsole= -Dwlw.logErrorsToConsole= -Dweblogic.ext.dirs=/shared2/beahome/patch_weblogic923/profiles/default/sysext_
manifest_classpath -Dweblogic.management.username=admin -Dweblogic.management.password=wlsadmin -Dweblogic.Name=LOGMGR-admin -Djava.security
.policy=/shared2/beahome/weblogic92/server/lib/weblogic.policy   weblogic.Server
<1-Apr-2010 12:47:22 o'clock PM GMT-05:00> <Notice> <WebLogicServer> <BEA-000395> <Following extensions directory contents added to the end
of the classpath:
/shared2/beahome/weblogic92/platform/lib/p13n/p13n-schemas.jar:/shared2/beahome/weblogic92/platform/lib/p13n/p13n_common.jar:/shared2/beahom
e/weblogic92/platform/lib/p13n/p13n_system.jar:/shared2/beahome/weblogic92/platform/lib/wlp/netuix_common.jar:/shared2/beahome/weblogic92/pl
atform/lib/wlp/netuix_schemas.jar:/shared2/beahome/weblogic92/platform/lib/wlp/netuix_system.jar:/shared2/beahome/weblogic92/platform/lib/wl
p/wsrp-common.jar>
<1-Apr-2010 12:47:22 o'clock PM GMT-05:00> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) Client VM Ve
rsion 1.5.0_12-b04 from Sun Microsystems Inc.>
<1-Apr-2010 12:47:23 o'clock PM GMT-05:00> <Info> <Management> <BEA-141107> <Version: WebLogic Server 9.2 MP3  Mon Mar 10 08:28:41 EDT 2008
1096261 >
<1-Apr-2010 12:47:25 o'clock PM GMT-05:00> <Info> <WebLogicServer> <BEA-000215> <Loaded License : /shared2/beahome/license.bea>
<1-Apr-2010 12:47:25 o'clock PM GMT-05:00> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING>
<1-Apr-2010 12:47:25 o'clock PM GMT-05:00> <Info> <WorkManager> <BEA-002900> <Initializing self-tuning thread pool>
<1-Apr-2010 12:47:25 o'clock PM GMT-05:00> <Notice> <Log Management> <BEA-170019> <The server log file /shared2/wldomains/beaadmd/LOGMGR/ser
vers/LOGMGR-admin/logs/LOGMGR-admin.log is opened. All server side log events will be written to this file.>

这里我们有第一个延迟,最多 5 分钟...

<1-Apr-2010 12:53:21 o'clock PM GMT-05:00> <Notice> <Security> <BEA-090082> <Security initializing using security realm myrealm.>
<1-Apr-2010 12:53:24 o'clock PM GMT-05:00> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STANDBY>
<1-Apr-2010 12:53:24 o'clock PM GMT-05:00> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING>
<1-Apr-2010 12:53:25 o'clock PM GMT-05:00> <Notice> <Log Management> <BEA-170027> <The server initialized the domain log broadcaster success
fully. Log messages will now be broadcasted to the domain log.>
<1-Apr-2010 12:53:25 o'clock PM GMT-05:00> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to ADMIN>
<1-Apr-2010 12:53:25 o'clock PM GMT-05:00> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RESUMING>
<1-Apr-2010 12:53:28 o'clock PM GMT-05:00> <Notice> <Security> <BEA-090171> <Loading the identity certificate and private key stored under t
he alias adminuialias from the jks keystore file /shared2/wldomains/beaadmd/LOGMGR/CustomIdentity.jks.>

这是第二个,也是最多 5 分钟。

<1-Apr-2010 12:58:56 o'clock PM GMT-05:00> <Notice> <Security> <BEA-090169> <Loading trusted certificates from the jks keystore file /shared
2/wldomains/beaadmd/LOGMGR/CustomTrust.jks.>
<1-Apr-2010 12:58:57 o'clock PM GMT-05:00> <Notice> <Server> <BEA-002613> <Channel "DefaultSecure" is now listening on 192.168.56.102:7002 f
or protocols iiops, t3s, ldaps, https.>
<1-Apr-2010 12:58:57 o'clock PM GMT-05:00> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on 192.168.56.102:8012 for pro
tocols iiop, t3, ldap, http.>
<1-Apr-2010 12:58:57 o'clock PM GMT-05:00> <Notice> <WebLogicServer> <BEA-000331> <Started WebLogic Admin Server "LOGMGR-admin" for domain "
LOGMGR" running in Development Mode>
<1-Apr-2010 12:58:57 o'clock PM GMT-05:00> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING>
<1-Apr-2010 12:58:57 o'clock PM GMT-05:00> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode>

更新

我想我找到了轨道:它一定是随机种子初始化。这可以解释为什么生成键盘事件会释放服务器。我已经制作了线程转储,一个线程处于可运行状态,但正在等待:

"[STANDBY] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'" daemon prio=1 tid=0x0a7b06e8 nid=0xeda runnable [0x728a500
0..0x728a6d80]
        at java.io.FileInputStream.readBytes(Native Method)
        at java.io.FileInputStream.read(FileInputStream.java:194)
        at sun.security.provider.NativePRNG$RandomIO.readFully(NativePRNG.java:185)
        at sun.security.provider.NativePRNG$RandomIO.implGenerateSeed(NativePRNG.java:202)
        - locked <0x7d928c78> (a java.lang.Object)
        at sun.security.provider.NativePRNG$RandomIO.access$300(NativePRNG.java:108)
        at sun.security.provider.NativePRNG.engineGenerateSeed(NativePRNG.java:102)
        at java.security.SecureRandom.generateSeed(SecureRandom.java:475)
        at weblogic.security.AbstractRandomData.ensureInittedAndSeeded(AbstractRandomData.java:83)

最佳答案

已解决

Weblogic 使用 SecureRandom 来初始化安全子系统。 SecureRandom 默认使用/dev/urandom 设备。出于某种原因,在 VM 下读取此设备经常会停止。生成控制台事件有助于创造更多的随机性,并发布 WLS。

出于测试目的,我更改了 jre/lib/security/java.security 文件:

securerandom.source=file:/tmp/big.random.file

Weblogic 现在在 15 秒内启动。

由于我们不在 VM 中测试任何安全性内容,因此重复种子对我们来说完全没问题。

关于java - Weblogic 在 VM(VirtualBox 和 VMware)下启动缓慢(11 分钟),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2563135/

相关文章:

sql-server - 寻求有关将现有 asp.net/sql 服务器网站迁移到 Azure VM 的建议

java - Primefaces DataTable 排序不正确

java - weblogic 12 中的 EJB 初始化错误,但 10 中没有

jms - 来自集群中分布式队列的所有 JMS 消息

Java 1.4.2内存分析工具

java - 在虚拟机中从 Linux 启动 Windows 程序。

java - 如果响应与帖子类不同,如何从帖子请求中获得响应

Java:测验 Android 应用程序 - 添加更多问题

java - 邮件发送失败,SMTP 连接失败

docker - 在主机上运行docker命令