在 CentOS 上使用 WebLogic 时,有几个关键点和常见坑需要特别注意,下面按“系统层面 → 安装配置 → 运行维护”给你梳理一下。
export JAVA_HOME=/usr/java/jdk1.8.0_xxx
export PATH=$JAVA_HOME/bin:$PATH
groupadd weblogic
useradd -g weblogic weblogic
weblogic 用户运行常见两种:
java -jar fmw_xxx.jar -silent -responseFile response.txt
response 文件CentOS 7+ 默认 firewalld:
firewall-cmd --permanent --add-port=7001/tcp
firewall-cmd --reload
常见端口:
setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=permissive/' /etc/selinux/config
推荐结构:
/u01/weblogic/
├── oracle/
├── domains/
│ └── base_domain/
避免放在 /root 或 /home
编辑:
domain/bin/setDomainEnv.sh
示例:
export USER_MEM_ARGS="-Xms2048m -Xmx2048m -XX:MaxPermSize=512m"
(JDK 8 以后用 Metaspace)
不要用:
startWebLogic.sh
直接前台跑
推荐:
nohup ./startWebLogic.sh > admin.log 2>&1 &
或配置 systemd(推荐生产)
ulimit -n 65536
/etc/security/limits.conf:
weblogic soft nofile 65536
weblogic hard nofile 65536
net.core.somaxconn=1024
net.ipv4.tcp_tw_reuse=1
domains/base_domain/servers/AdminServer/logs/
✅ JDK 版本不匹配
✅ SELinux 导致启动失败
✅ 用 root 跑被安全扫描扣分
✅ 防火墙没开端口
✅ 内存没调,默认太小
如果你愿意,可以告诉我:
我可以给你一套 可直接用的安装+启动方案。