Weblogic14c安装部署(非集群)


项目要求需要收悉WebLogic,抽空装了一个总结一下遇到的问题和安装配置过程。

环境介绍: - 操作系统:openEuler - jdk版本:1.8.202 - weblogic版本:14.1.1.0.0

首先你得需要一个WebLogic的安装程序,去官网下一个就好,一般是个压缩文件。解压后里面是个jar包。安装WebLogic不能使用root用户,否则会报错。操作系统需要有java环境,安装配置jdk8就行了,别装9或9以上的版本,会出问题,至于什么问题,文章末尾会说。jdk安装配置我就不再赘述了,网上一找一大把。

我新建了一个ap用户,这个用户用于weblogic安装和运行。ap用户的家目录为/home/ap。在其家目录中新建两个目录weblogic14c、wlsinsfiles,weblogic14c用于安装WebLogic,wlsinsfiles用于存放安装时候需要准备的文件。将weblogic的jar包上传至/home/ap/weblogic14c下,进入目录/home/ap/wlsinsfiles下创建loc文件,文件名为:oraInst.loc,文件内容如下:

inventory_loc=/home/ap/weblogic14c/oraInventory
inst_group=ap

inventory_loc表示指定oracle产品清单目录,inst_group表示安装、运行weblogic的用户所属组。

在/home/ap/wlsinsfiles目录下创建响应文件,文件名为:wls.rsp,文件内容如下:

[ENGINE]
#DO NOT CHANGE THIS.
Response File Version=1.0.0.0.0
[GENERIC]
#The oracle home location. This can be an existing Oracle Home or a new Oracle Home
ORACLE_HOME=/home/ap/weblogic14c
#Set this variable value to the Installation Type selected. e.g. WebLogic Server, Coherence, Complete with Examples.
INSTALL_TYPE=WebLogic Server
#Provide the My Oracle Support Username. If you wish to ignore Oracle Configuration Manager configuration provide empty string for user name.
MYORACLESUPPORT_USERNAME=
#Provide the My Oracle Support Password
MYORACLESUPPORT_PASSWORD=<SECURE VALUE>
#Set this to true if you wish to decline the security updates. Setting this to true and providing empty string for My Oracle Support username will ignore the Oracle Configuration Manager configuration
DECLINE_SECURITY_UPDATES=true
#Set this to true if My Oracle Support Password is specified
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
#Provide the Proxy Host
PROXY_HOST=
#Provide the Proxy Port
PROXY_PORT=
#Provide the Proxy Username
PROXY_USER=
#Provide the Proxy Password
PROXY_PWD=<SECURE VALUE>
#Type String (URL format) Indicates the OCM Repeater URL which should be of the format [scheme[Http/Https]]://[repeater host]:[repeater port]
COLLECTOR_SUPPORTHUB_URL=

重点修改ORACLE_HOME字段,用于指定Oralce家目录。

两个文件创建完成后,进入/home/ap/weblogic14c目录,执行如下命令开始安装weblogic。命令如下:

java -jar fmw_14.1.1.0.0_wls_lite_quick_generic.jar -silent -responseFile /home/ap/wlsinfiles/wls.rsp -invPtrLoc /home/ap/wlsinfiles/oraInst.loc

等待安装完成,然后在/home/ap/weblogic14c下创建域目录,命令如下:

mkdir -p /home/ap/weblogic14c/user_projects/domains/base_domain/

进入/home/ap/wlsinsfiles目录创建域响应文件create_domain.rsp,文件内容如下:(依据自身情况进行修改)

read template from "/home/ap/weblogic14c/wls1411/wlserver/common/templates/wls/wls.jar";
set JavaHome "/usr/local/jdk1.8.0_202";
set ServerStartMode "dev";
find Server "AdminServer" as AdminServer;
set AdminServer.ListenAddress "";
set AdminServer.ListenPort "7001";
set AdminServer.SSL.Enabled "true";
set AdminServer.SSL.ListenPort "8002";
//We can directly create a new managed server.
create Server "base" as BASE;
set BASE.ListenAddress "";
set BASE.ListenPort "8003";
//set BASE.SSL.Enabled "true";
//set BASE.SSL.ListenPort "8004″;
//Create Machine
create Machine "base" as Machinename;
//use templates default weblogic user
find User "weblogic" as u1;
set u1.password "weblogic";
//create a new user
create User "monitor" as u2;
set u2.password "weblogic";
write domain to "/home/ap/weblogic14c/user_projects/domains/base_domain/";
//The domain name will be "demo-domain"
close template;

这里有点需要说明的,文件中涉及两个账号,如下图:

其中第一个weblogic表示管理员角色,monitor表示监控角色。

使用刚刚创建的域响应文件完成域的创建以及weblogic安装配置。操作命令如下:

cd /home/ap/weblogic14c/wls1411/wlserver/common/bin
./config.sh -mode=silent -silent_script=/home/ap/wlsinsfiles/create_domain.rsp -logfile=/home/ap/wlsinsfiles/create_domain.log

等待执行完成,进入域目录下启动weblogic,命令如下:

cd /home/ap/weblogic14c/user_projects/domains/base_domain
./startWebLogic.sh (前台启动)
./startWebLogic.sh & (后台启动)

启动后能进行正常登录则表示weblogic安装配置完成。界面如下图:

下面写一下遇到的问题

问题一:响应文件中已经指定Oracle主目录,但是再安装的时候还是会提示”未指定Oracle主目录“,如下图:

这个问题是应为什么导致的,我现在还没有解决,有知道的朋友欢迎留言。

问题二:操作系统在安装的时候没有指定/tmp目录,但是在安装时提示/tmp目录空间不足。 解决办法:通过修改/etc/fstab文件调整/tmp目录大小,命令如下:

echo "tmpfs /tmp tmpfs nodev,nosuid,size=1G 0 0" >> /etc/fstab

问题三:安装过程在复制文件过程中发生错误,提示“内部错误,安装中断”,这个问题通过查日志发现,过程中出现的第一个错误为“Error occured during Product Variables initialization !!!”,通过查找资料得知:jdk9及以上版本中,引入了模块。如果在default package建立一个单独运行的类,就无法通过编译。

解决办法:将jdk更换为jdk8