Redhat6.10下静默安装WebLogic
title: Redhat6.10下静默安装WebLogic
categories: Linux
tags:
- WebLogic
timezone: Asia/Shanghai
date: 2019-01-06
环境
[root@redhat610-ch-gui home]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.10 (Santiago
[root@redhat610-ch-gui home]# javac -version
javac 1.8.0_191
[root@redhat610-ch-gui home]# java -version
java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)
WebLogic Server 版本: 12.2.1.0.0
官方地址:https://www.oracle.com/technetwork/middleware/weblogic/downloads/index.html
(第零步)。关闭防火墙
setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
systemctl stop firewalld
systemctl disable firewalld
systemctl status firewalld
service iptables stop
chkconfig iptables off
(一).配置java环境
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
当前最新版本下载地址:http://www.oracle.com/technetwork/java/javase/downloads/index.html
历史版本下载地址:http://www.oracle.com/technetwork/java/javase/archive-139210.html
1.解压下载好的文件并重命名
tar -vxzf jdk-8u191-linux-x64.tar.gz
mv jdk1.8.0_191/ jdk
2.设置java环境变量
vim /etc/profile
export JAVA_HOME=/home/jdk
export CLASSPATH=.:${JAVA_HOME}/jre/lib/rt.jar:${JAVA_HOME}/lib/dt.jar:${JAVA_HOME}/lib/tools.jar
export PATH=$PATH:${JAVA_HOME}/bin
source /etc/profile
3.验证是否安装成功
javac -version
java -version
(二).下载安装WebLogic
下载地址:https://www.oracle.com/technetwork/middleware/weblogic/downloads/wls-main-097127.html
https://www.cnblogs.com/fibonaccixue/p/6577377.html
https://www.cnblogs.com/vhua/p/weblogic_1.html
1.增加weblogic用户,weblogic不允许安装在root权限下
groupadd weblogic
useradd -g weblogic weblogic
su - weblogic
2.上传并解压WebLogic安装包
unzip fmw_12.2.1.2.0_wls_Disk1_1of1.zip
3.创建响应文件 wls.rsp
vim /home/weblogic/wls.rsp
[ENGINE]
#DO NOT CHANGE THIS.
Response File Version=1.0.0.0.0
[GENERIC]
#Set this to true if you wish to skip software updates
DECLINE_AUTO_UPDATES=true
#
MOS_USERNAME=
#
MOS_PASSWORD=<SECURE VALUE>
#If the Software updates are already downloaded and available on your local system, then specify the path to the directory where these patches are available and set SPECIFY_DOWNLOAD_LOCATION to true
AUTO_UPDATES_LOCATION=
#
SOFTWARE_UPDATES_PROXY_SERVER=
#
SOFTWARE_UPDATES_PROXY_PORT=
#
SOFTWARE_UPDATES_PROXY_USER=
#
SOFTWARE_UPDATES_PROXY_PASSWORD=<SECURE VALUE>
#The oracle home location. This can be an existing Oracle Home or a new Oracle Home
ORACLE_HOME=/home/weblogic/Oracle/Middleware/Oracle_Home
#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=
4.创建初始化环境文件oraInst.loc
vim /home/weblogic/oraInst.loc
inventory_loc=/home/weblogic/oraInventory
inst_group=weblogic
5.开始静默安装
java -jar fmw_12.1.3.0.0_wls.jar -silent -responseFile file -invPtrLoc file
-response file:响应文件(必须是绝对路径)
-invPtrLoc file:初始化环境文件(必须是绝对路径)
java -jar /home/weblogic/fmw_12.2.1.0.0_wls.jar -silent -responseFile /home/weblogic/wls.rsp -invPtrLoc /home/weblogic/oraInst.loc
6.安装完成后会有提示成功,下一步配置环境变量。
执行以下文件,将输出的两行内容追加到/etc/profile
/home/weblogic/Oracle/Middleware/Oracle_Home/wlserver/server/bin/setWLSEnv.sh
vim /etc/profile
CLASSPATH=/home/jdk/lib/tools.jar:/home/weblogic/Oracle/Middleware/Oracle_Home/wlserver/modules/features/wlst.wls.classpath.jar:.:/home/jdk/jre/lib/rt.jar:/home/jdk/lib/dt.jar:/home/jdk/lib/tools.jar
PATH=/home/weblogic/Oracle/Middleware/Oracle_Home/wlserver/server/bin:/home/weblogic/Oracle/Middleware/Oracle_Home/wlserver/../oracle_common/modules/org.apache.ant_1.9.2/bin:/home/jdk/jre/bin:/home/jdk/bin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/home/jdk/bin:/root/bin:/home/weblogic/Oracle/Middleware/Oracle_Home/wlserver/../oracle_common/modules/org.apache.maven_3.2.5/bin
source /etc/profile
7.创建静默创建域脚本
mkdir -p /home/weblogic/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain
cd /home/weblogic/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain
cp /home/weblogic/Oracle/Middleware/Oracle_Home/wlserver/common/templates/scripts/wlst/basicWLSDomain.py .
vim basicWLSDomain.py
在# Please set password here before using this script, e.g. cmo.setPassword('value')下边增加(设置密码)
口令要求:口令至少必须为 8 个字母数字字符, 且至少包含一个数字或一个特殊字符
cmo.setPassword('xiaoliu')
删除以下段内容
# Create a JMS Server.
...
Write the domain and close the domain template.
8.使用以下命令开始安装,会有一个漫长的等待
/home/weblogic/Oracle/Middleware/Oracle_Home/oracle_common/common/bin/wlst.sh basicWLSDomain.py
9.启动
前台启动weblogic
./startWeblogic.sh
后台启动weblogic
vim startWeblogic.sh
${DOMAIN_HOME}/bin/startWeblogic.sh $*
修改为:
${DOMAIN_HOME}/bin/startWeblogic.sh $* > /dev/null 2>&1 &
10.如果很长时间没有启动完毕,修改以下内容
vim setDomainEnv.sh
set WLS_MEM_ARGS_64BIT=”-Xms2048m –Xmx2048m”
set WLS_MEM_ARGS_32BIT=”-Xms2048m –Xmx2048m”
修改为
set WLS_MEM_ARGS_64BIT=”-Xms2048m –Xmx2048m -Djava.security.egd=file:/dev/./urandom”
set WLS_MEM_ARGS_32BIT=”-Xms2048m –Xmx2048m -Djava.security.egd=file:/dev/./urandom”