CentOS 7静默安装Weblogic 12C

1.前言

我相信刚刚接触weblogic的部署很多人都会遇到很多坑,我也不例外,遇到很多坑,最后才总结出来,希望能给你们带来帮助!!!

2.准备环境

3.创建用户

groupadd weblogic
useradd weblogic -g weblogic
添加用户密码:
echo "weblogic" | passwd --stdin weblogic

4.安装JAVA环境

创建weblogic安装目录:mkdir /bea
授权:chown weblogic:weblogic /bea
上传jdk-7u75-linux-x64.tar.gz至/home/weblogic目录下
解压至/usr/local/目录下
tar –zxvf jdk-7u75-linux-x64.tar.gz –C /usr/local
添加环境变量:vim /etc/profile
export JAVA_HOME=/usr/local/jdk1.7.0_75
export JRE_HOME=/usr/local/jdk1.7.0_75/jre
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
export ORACLE_HOME=/bea
使其环境变量生效:source /etc/profile

验证JAVA是否安装成功:java –version

5.创建安装配置文件

cd /home/weblogic

创建响应文件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=/bea
#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>
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>
COLLECTOR_SUPPORTHUB_URL=

创建Loc文件oraInst.loc

inventory_loc=/home/weblogic/oraInventory
#用户的组名称,根据实际的修改
inst_group=weblogic

6.安装weblogic

cd /home/weblogic

授权:chown weblogic:weblogic fmw_12.1.3.0.0_wls.jar

切换weblogic用户:su – weblogic

java -jar fmw_12.1.3.0.0_wls.jar -silent -responseFile /home/weblogic/wls.rsp -invPtrLoc /home/weblogic/oraInst.loc

安装过程:

7.创建域

导入环境变量:

export MW_HOME="/bea"
export WL_HOME="/bea/oracle_common"

进入目录:cd /bea/wlserver/common/bin

./commEnv.sh  #设置环境变量

方法一:

直接运行:./wlst.sh

Initializing WebLogic Scripting Tool (WLST) ... Welcome to WebLogic Server Administration Scripting Shell Type help() for help on available commands wls:/offline>readTemplate('/bea/wlserver/common/templates/wls/wls.jar')

wls:/offline/base_domain>cd('Servers/AdminServer')

wls:/offline/base_domain/Server/AdminServer>set('ListenAddress','')

wls:/offline/base_domain/Server/AdminServer>set('ListenPort',7001)

wls:/offline/base_domain/Server/AdminServer>cd('../..')

wls:/offline/base_domain>cd('Security/base_domain/User/weblogic')

wls:/offline/base_domain/Security/base_domain/User/weblogic>cmo.setPassword('weblogic123') wls:/offline/base_domain/Security/base_domain/User/weblogic>setOption('OverwriteDomain','true') wls:/offline/base_domain/Security/base_domain/User/weblogic>writeDomain('/bea/user_projects/domains/servyou_domain')

closeTemplate()

exit()

这一步的时间比较长一点,耐心等待……

方法二:

进入目录:cd /bea/wlserver/common/bin

vim create_domain.py

create_domain.py

readTemplate('/bea/wlserver/common/templates/wls/wls.jar')

cd('Servers/AdminServer')

set('ListenAddress','')

set('ListenPort',7001)

cd('../..')

cd('Security/base_domain/User/weblogic')

cmo.setPassword('weblogic123')

setOption('OverwriteDomain','true')

writeDomain('/bea/user_projects/domains/servyou_domain')

closeTemplate()

exit()

执行:./wlst.sh ./create_domain.py

8.启动weblogic

cd /bea/user_projects/domains/servyou_domain

./startWeblogic.sh

或者nohup startWeblogic.sh > note.log & tail -f note.log

修改Weblogic默认的SERVER NAME

步骤:

1 重命名..\你的域名\servers 下AdminServer文件夹。

2 将..\你的域名\config\config.xml中所有的AdminServer修改成新名称,与第1步中一致。

3 编辑..\你的域名\bin下setDomainEnv.cmd(setDomainEnv.sh),找到

set SERVER_NAME=AdminServer 并修改。

4 重启服务。

猜你喜欢

转载自www.linuxidc.com/Linux/2018-08/153530.htm