Centos7靜默安裝Weblogic12C

 
1.前言
    WebLogic是美國Oracle公司出品的一個application server,確切的說是一個基於JAVAEE架構的中間件,WebLogic是用於開發、集成、部署和管理大型分佈式Web應用、網絡應用和數據庫應用的Java應用服務器。將Java的動態功能和Java Enterprise標準的安全性引入大型網絡應用的開發、集成、部署和管理之中。
    我相信剛剛接觸weblogic的部署不少人都會遇到不少坑,我也不例外,遇到不少坑,最後才總結出來,但願能給大家帶來幫助!!!
2.準備環境
操做系統:centos7
Weblogic版本:fmw_12.1.3.0.0_wls.jar
JAVA版本:jdk-7u75-linux-x64.tar.gz
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
安裝過程:
啓動程序日誌文件爲/tmp/OraInstall2016-05-13_01-02-56PM/launcher2016-05-13_01-02-56PM.log。 正在提取文件.........
啓動 Oracle Universal Installer
檢查 CPU 速度是否大於 300 MHz。 實際爲 2400.217 MHz 經過
檢查交換空間: 必須大於 512 MB。 實際爲 18513912 MB 經過
檢查此平臺是否須要 64 位 JVM。 實際爲64 經過 (不須要 64 位)
檢查臨時空間: 必須大於 300 MB。 實際爲 36518 MB 經過 準備從/tmp/OraInstall2016-05-13_01-02-56PM啓動 Oracle Universal Installer 日誌:/tmp/OraInstall2016-05-13_01-02-56PM/install2016-05-13_01-02-56PM.log 版權全部 (c) 1996, 2014, Oracle 和/或其附屬公司。保留全部權利。
正在讀取響應文件... 開始檢查: CertifiedVersions 預期的結果: enterprise-4,enterprise-5,enterprise-6,redhat-6,redhat-4,redhat-5,SuSE-11之一 實際結果: unkown()
這次檢查的整體結果爲: 經過 CertifiedVersions 檢查: 成功。
開始檢查: CheckJDKVersion 預期的結果: 1.7.0_15 實際結果: 1.7.0_80
檢查完成。這次檢查的整體結果爲: 經過 CheckJDKVersion 檢查: 成功。
已啓用此會話的驗證。 正在驗證數據... 正在複製文件... 能夠在如下位置找到本次安裝會話的日誌: /tmp/OraInstall2016-05-13_01-02-56PM/install2016-05-13_01-02-56PM.log -----------20%----------40%----------60%----------80%--------100%
Oracle Fusion Middleware 12c WebLogic Server 和 Coherence 12.1.3.0.0 的 安裝 已成功完成。
日誌已成功複製到/home/weblogic/oraInventory/logs。

 

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
步驟: 
1 重命名..\你的域名\servers 下AdminServer文件夾。 
2 將..\你的域名\config\config.xml中全部的AdminServer修改爲新名稱,與第1步中一致。 
3 編輯..\你的域名\bin下setDomainEnv.cmd(setDomainEnv.sh),找到 
set SERVER_NAME=AdminServer 並修改。 
4 重啓服務。
相關文章
相關標籤/搜索