在 CentOS 上 WebLogic 启动慢,通常不是 WebLogic 本身的问题,而是 操作系统环境或配置 导致的。以下是最常见原因及对应解决办法:
这是 CentOS + WebLogic 启动慢的头号原因。
Initializing Security...WebLogic 使用 SecureRandom,默认读取 /dev/random
CentOS(尤其虚拟机)熵值不足,会阻塞等待。
方案 1(推荐):使用 urandom
export JAVA_OPTIONS="-Djava.security.egd=file:/dev/./urandom"
方案 2:安装熵增强服务
yum install -y rng-tools
systemctl start rngd
systemctl enable rngd
UnknownHostExceptionWebLogic 启动时会解析本机 hostname
hostname
在 /etc/hosts 中加:
127.0.0.1 your-hostname
free -m
top
ulimit -n 65535
/etc/security/limits.conf
* soft nofile 65535
* hard nofile 65535
iostat -x 1
urandom(90% 解决)/etc/hostsfree、top如果你愿意,可以贴:
我可以帮你精确定位是哪一条原因。