CentOS7命令行(靜默)部署weblogic 12c

最近負(fù)責(zé)在linux上安裝weblogic,客戶說(shuō)要安裝最新的版本,版本號(hào)為 12.2.X(12.2.1.3.0)。開(kāi)始以為和舊版安裝一樣,使用控制臺(tái)的方式,下載bin文件,然后一步步在console執(zhí)行下來(lái)就行了。萬(wàn)萬(wàn)沒(méi)想到,從12C版本后,

bin文件不提供了,改成全系統(tǒng)通用的jar文件 (generic.jar)。試了半天原來(lái)那種安裝方式不能用了,非得用圖形界面安裝。由于服務(wù)器是在其他地方,肯定不能跑到主機(jī)的地址那邊。于是各種google、各種找材料,

最后終于找到一種靜默方式的安裝。大家看下文。

一 前期準(zhǔn)備

1.新建用戶組 web

[root@edwcube3 ~]# groupadd web

2.新建用戶weblogic 并修改用戶密碼

[root@edwcube3 ~]# useradd -g web weblogic
[root@edwcube3 ~]# passwd weblogic

二 安裝java環(huán)境

安裝jdk:rpm -ivh jdk-7u55-linux-x64.rpm

在/etc/profile最后加入以下內(nèi)容:

export JAVA_HOME=/usr/java/jdk1.7.0_55

export JRE_HOME=/usr/java/jdk1.7.0_55/jre

export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib

export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
使之生效
source /etc/profile
驗(yàn)證JDK安裝成功與否:
javac

三 安裝weblogic

Slient Mode靜默方式

首先看命令的格式:
java -jar wls_121200.jar -silent -responseFile file -invPtrLoc file

-response file:響應(yīng)文件

-invPtrLoc file:初始化環(huán)境文件

文件詳解:

1.創(chuàng)建 oraInst.loc 文件,內(nèi)容如下

#Oracle Installer Location File Location
inst_group=web 組名稱(chēng)
inventory_loc=/opt/weblogic/oraInventory 產(chǎn)品清單目錄

2.創(chuàng)建 wls.rsp 響應(yīng)文件
su - weblogic
chmod 777 /opt/weblogic/fmw_12.2.1.3.0_wls.jar
wls.rsp這個(gè)文件你可以在圖形界面安裝時(shí),點(diǎn)擊保存生產(chǎn)該文件。本機(jī)使用的文件內(nèi)容如下:

[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=/opt/weblogic/Oracle/Middleware
#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=

chmod 664 wls.rsp

3.配置文件創(chuàng)建后,就可以進(jìn)行安裝了:(注:一定要切換為weblogic用戶?。。。。?!)
響應(yīng)文件必須寫(xiě)絕對(duì)路徑

[weblogic@test ~]$ java -jar fmw_12.2.1.3.0_wls.jar -silent -responseFile /opt/weblogic/wls.rsp -invPtrLoc /etc/oraInst.loc

啟動(dòng)程序日志文件為/tmp/OraInstall2016-08-10_10-59-01AM/launcher2016-08-10_10-59-01AM.log。
正在提取文件.........................................
啟動(dòng) Oracle Universal Installer
檢查 CPU 速度是否大于 300 MHz。 實(shí)際為 1496.639 MHz 通過(guò)
檢查交換空間: 必須大于 512 MB。 實(shí)際為 2093048 MB 通過(guò)
檢查此平臺(tái)是否需要 64 位 JVM。 實(shí)際為64 通過(guò) (不需要 64 位)
檢查臨時(shí)空間: 必須大于 300 MB。 實(shí)際為 69017 MB 通過(guò)
準(zhǔn)備從/tmp/OraInstall2016-08-10_10-59-01AM啟動(dòng) Oracle Universal Installer日志:/tmp/OraInstall2016-08-10_10-59-01AM/install2016-08-10_10-59-01AM.log
版權(quán)所有 (c) 1996, 2014, Oracle 和/或其附屬公司。保留所有權(quán)利。
正在讀取響應(yīng)文件...
開(kāi)始檢查: CertifiedVersions
預(yù)期的結(jié)果: enterprise-4,enterprise-5,enterprise-6,redhat-6,redhat-4,redhat-5,SuSE-11之一
實(shí)際結(jié)果: enterprise-6
檢查完成。此次檢查的總體結(jié)果為: 通過(guò)
CertifiedVersions 檢查: 成功。
開(kāi)始檢查: CheckJDKVersion
預(yù)期的結(jié)果: 1.7.0_15
實(shí)際結(jié)果: 1.7.0_55
檢查完成。此次檢查的總體結(jié)果為: 通過(guò)
CheckJDKVersion 檢查: 成功。
已啟用此會(huì)話的驗(yàn)證。
正在驗(yàn)證數(shù)據(jù)...
正在復(fù)制文件...
可以在以下位置找到本次安裝會(huì)話的日志:
/tmp/OraInstall2016-08-10_10-59-01AM/install2016-08-10_10-59-01AM.log
-----------20%----------40%----------60%----------80%--------100%
Oracle Fusion Middleware 12c WebLogic Server 和 Coherence 12.1.3.0.0 的 安裝 已成功完成。
日志已成功復(fù)制到/opt/weblogic/oraInventory/logs。

4.接下來(lái)要?jiǎng)?chuàng)建域domain
[weblogic@test ~]$ mkdir -p
/opt/weblogic/Oracle/Middleware/user_projects/domains/base_domain/
創(chuàng)建參數(shù)文件
創(chuàng)建文件: create_domain.rsp

read template from "/opt/weblogic/Oracle/Middleware/wlserver/common/templates/wls/wls.jar";
set JavaHome "/usr/java/jdk1.7.0_55";
set ServerStartMode "dev";
find Server "AdminServer" as AdminServer;
set AdminServer.ListenAddress "";
set AdminServer.ListenPort "8001";
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 "weblogic123";
//create a new user
create User "weblogic2" as u2;
set u2.password "weblogic123";
write domain to "/opt/weblogic/Oracle/Middleware/user_projects/domains/base_domain/";
// The domain name will be "demo-domain"
close template;

靜默創(chuàng)建域(注:一定要切換為weblogic用戶?。。。。?!)
cd /opt/weblogic/Oracle/Middleware/wlserver/common/bin

[weblogic@test ~]$ cd Oracle/Middleware/wlserver/common/bin
[weblogic@test bin]$ ./config.sh -mode=silent -silent_script=/opt/weblogic/create_domain.rsp -logfile=/opt/weblogic/create_domain.log
出現(xiàn)如下輸出:

<< read template from "/opt/weblogic/Oracle/Middleware/wlserver/common/templates/wls/wls.jar"
>> succeed: read template from "/opt/weblogic/Oracle/Middleware/wlserver/common/templates/wls/wls.jar"
<< set config option JavaHome to "/usr/java/jdk1.7.0_55"
>> succeed: set config option JavaHome to "/usr/java/jdk1.7.0_55"
<< set config option ServerStartMode to "dev"
>> succeed: set config option ServerStartMode to "dev"
<< find Server "AdminServer" as AdminServer
>> succeed: find Server "AdminServer" as AdminServer
<< set AdminServer attribute ListenAddress to ""
>> succeed: set AdminServer attribute ListenAddress to ""
<< set AdminServer attribute ListenPort to "8001"
>> succeed: set AdminServer attribute ListenPort to "8001"
<< set AdminServer attribute SSL!Enabled to "true"
>> succeed: set AdminServer attribute SSL!Enabled to "true"
<< set AdminServer attribute SSL!ListenPort to "8002"
>> succeed: set AdminServer attribute SSL!ListenPort to "8002"
<< create Server "base" as BASE
>> succeed: create Server "base" as BASE
<< set BASE attribute ListenAddress to ""
>> succeed: set BASE attribute ListenAddress to ""
<< set BASE attribute ListenPort to "8003"
>> succeed: set BASE attribute ListenPort to "8003"
<< create Machine "base" as Machinename
>> succeed: create Machine "base" as Machinename
<< find User "weblogic" as u1
>> succeed: find User "weblogic" as u1
<< set u1 attribute Password to "********"
>> succeed: set u1 attribute Password to "********"
<< create User "weblogic2" as u2
>> succeed: create User "weblogic2" as u2
<< set u2 attribute Password to "********"
>> succeed: set u2 attribute Password to "********"
<< write Domain to "/opt/weblogic/Oracle/Middleware/user_projects/domains/base_domain/"
..........................................................................................
>> succeed: write Domain to "/opt/weblogic/Oracle/Middleware/user_projects/domains/base_domain/"
<< close template
>> succeed: close template

WebLogic的后臺(tái)啟動(dòng)、停止運(yùn)行的方法

[weblogic@test ~]# cd /user_projects/domains/base_domain/bin/
[weblogic@test bin]# nohup ./startWebLogic.sh &

最后就可以訪問(wèn) http://ip:8001/console 進(jìn)入控制臺(tái)了
停止運(yùn)行:

[weblogic@test bin]# ./stopWebLogic.sh

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容