1. 程式人生 > 其它 >Linux建立靜默安裝weblogic12.1.3建立域及 解除安裝域

Linux建立靜默安裝weblogic12.1.3建立域及 解除安裝域

1. 到官網下載weblogic12C的jar包fmw_12.1.3.0.0_wls.jar https://www.oracle.com/middleware/technologies/fusionmiddleware-downloads.html

2.建立相對應的使用者組和使用者

建立使用者組
weblogic:groupadd weblogic
建立使用者
weblogic:useradd -d /home/weblogic -g weblogic weblogic
-g:指定使用者所屬的起始群組。
-d: 指定家目錄位置
設定使用者密碼,禁止使用弱口令
passwd weblogic

3.設定oraInst.loc目錄

建立/home/weblogic/oraInst.loc,內容如下:
inventory_loc=/software/app_weblogic/oraInventory
inst_group=weblogic

4.在使用者目錄下建立wls.rsp響應檔案/home/weblogic,內容如下:

[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=/software/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=

a.使用 readTemplate 函式讀取建域模版指令碼, Weblogic 預置了多種建域指令碼,我們僅使用最基礎的建域指令碼即可。
b.設定 AdminServer 的監聽地址和埠號, ListenAddress 為監聽地址,預設為 '' 表示監聽所有本機地址;ListenPort 為監聽埠號,這裡根據實際情況設定,不衝突即可。
c.設定使用者名稱密碼, 'Security/base_domain/User/weblogic' 中 weblogic 就是使用者名稱,cmo.setPassword('weblogic123') 用於將密碼設定為 weblogic123
d.設定域引數:OverwriteDomain 設定為覆蓋已有域檔案;JavaHome 設定 Weblogic 域執行時用到的 JVM 。
e.設定域路徑並寫入,使用 writeDomain 函式設定待寫入的域路徑,並執行寫入過程。
f.使用 closeTemplate 函式在執行完域寫入後關閉域模版。
g.使用 exit 函式退出指令碼。
以上例項為最簡單的域建立指令碼, WLST 本身提供了豐富的函式進行域建立和域操作,詳細的說明請參考 Oracle 的官方文件。

5.建立完2個檔案後,開始靜默安裝 java -jar fmw_12.1.3.0.0_wls.jar -silent -responseFile /home/weblogic/wls.rsp -invPtrLoc /home/weblogic/oraInst.loc

6.建立域目錄 mkdir -p /software/weblogic/Oracle/Middleware/user_projects/domains/ats50_domain

7.到域目錄下,複製修改建立域的指令碼檔案

cd /software/weblogic/Oracle/Middleware/user_projects/domains/ats50_domain
cp /software/weblogic/Oracle/Middleware/wlserver/common/templates/scripts/wlst/basicWLSDomain.py .
修改指令碼如下:(粗體為新增)
刪除從# Create a JMS Server. 到
#Write the domain and close the domain template.
新增設定密碼 cmo.setPassword('weblogic23')

8.執行/software/weblogic/Oracle/Middleware/oracle_common/common/bin/wlst.sh basicWLSDomain.py

9.安裝完成。linux建立weblogic域12C 在域目錄下後臺啟動weblogic

nohup ./startWebLogic.sh &

解除安裝域的步驟:

1.刪除weblogic域目錄
比如說我有一個TESTDomain的域想要刪除,直接刪除該域存放的目錄即可

rm -rf /home/weblogic/Oracle/Middleware/user_projects/domains/TESTDomain
2.手動修改域註冊資訊
進入/home/weblogic/Oracle/Middleware目錄,修改域註冊資訊檔案。