在 CentOS 上部署 WebLogic 时出现启动或部署很慢,是常见现象,通常不是硬件问题,而是环境配置导致的。下面按最常见原因 → 解决方法给你梳理。
WebLogic / Java 启动时会大量使用 /dev/random,而 CentOS 默认熵池不足,会卡住几十秒甚至几分钟。
修改 JDK 随机数源:
方法一:改 JAVA_OPTIONS
export JAVA_OPTIONS="-Djava.security.egd=file:/dev/./urandom"
方法二:修改 WebLogic 启动脚本
$WL_HOME/bin/setDomainEnv.sh
加入上面这行。
✅ 效果立竿见影
WebLogic 启动时会解析本机 hostname,如果 /etc/hosts 没配,会超时。
hostname
编辑:
vi /etc/hosts
确保有:
127.0.0.1 localhost
192.168.x.x yourhostname
⚠️ 不要只写 127.0.0.1 hostname
修改 config.xml 或控制台:
如果是应用部署慢,通常是:
✅ 建议:
ServletContextListenerWebLogic 对 IPv6 支持一般
vi /etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
sysctl -p
ulimit -n 65535
永久:
vi /etc/security/limits.conf
* soft nofile 65535
* hard nofile 65535
你可以按顺序检查:
/dev/urandom/etc/hosts你可以贴一下:
我可以直接告诉你具体改哪一行配置。