逐步部署流程
本頁介紹在NetApp ONTAP儲存上部署 Oracle19c 的自動化方法。
AWX/Tower 部署 Oracle 19c 資料庫
1.為您的環境建立清單、群組、主機和憑證
本節介紹 AWX/Ansible Tower 中的庫存、群組、主機和存取憑證的設置,為使用NetApp自動化解決方案準備環境。
-
配置庫存。
-
導覽至資源 → 庫存 → 新增,然後按一下新增庫存。
-
提供姓名和組織詳細信息,然後按一下「儲存」。
-
在庫存頁面上,按一下建立的庫存。
-
如果有任何庫存變量,請將其貼到變數欄位中。
-
導航至“群組”子選單並點擊“新增”。
-
提供ONTAP的群組名稱,貼上群組變數(如果有),然後按一下「儲存」。
-
對 Oracle 的另一個群組重複此程序。
-
選擇已建立的ONTAP群組,前往「主機」子選單並點選「新增主機」。
-
提供ONTAP叢集管理 IP 的 IP 位址,貼上主機變數(如果有),然後按一下「儲存」。
-
必須對 Oracle 群組和 Oracle 主機管理 IP/主機名稱重複此程序。
-
-
建立憑證類型。對於涉及ONTAP的解決方案,您必須設定憑證類型以符合使用者名稱和密碼項目。
-
導覽至管理 → 憑證類型,然後按一下新增。
-
提供名稱和描述。
-
在輸入配置中貼上以下內容:
-
fields:
- id: username
type: string
label: Username
- id: password
type: string
label: Password
secret: true
- id: vsadmin_password
type: string
label: vsadmin_password
secret: true
-
將以下內容貼到注入器配置中:
extra_vars:
password: '{{ password }}'
username: '{{ username }}'
vsadmin_password: '{{ vsadmin_password }}'
-
配置憑證。
-
導覽至資源 → 憑證,然後按一下新增。
-
輸入ONTAP的名稱和組織詳細資料。
-
選擇您為ONTAP建立的自訂憑證類型。
-
在類型詳細資料下,輸入使用者名稱、密碼和 vsadmin_password。
-
按一下“返回憑證”,然後按一下“新增”。
-
輸入 Oracle 的名稱和組織詳細資訊。
-
選擇機器憑證類型。
-
在類型詳細資料下,輸入 Oracle 主機的使用者名稱和密碼。
-
選擇正確的權限提升方法,並輸入使用者名稱和密碼。
-
2.創建專案
-
前往資源 → 項目,然後按一下新增。
-
輸入姓名和組織詳細資料。
-
在原始碼控制憑證類型欄位中選擇 Git。
-
進入 `\https://github.com/NetApp-Automation/na_oracle19c_deploy.git`作為原始碼控制 URL。
-
按一下「Save(儲存)」。
-
當原始程式碼發生變化時,專案可能需要偶爾同步。
-
3.配置 Oracle host_vars
本節定義的變數適用於每個單獨的 Oracle 伺服器和資料庫。
-
在下列嵌入式 Oracle 主機變數或 host_vars 表單中輸入特定環境的參數。
|
必須更改藍色項目以符合您的環境。 |
主機 VARS 配置
######################################################################
############## Host Variables Configuration ##############
######################################################################
# Add your Oracle Host
ansible_host: "10.61.180.15"
# Oracle db log archive mode: true - ARCHIVELOG or false - NOARCHIVELOG
log_archive_mode: "true"
# Number of pluggable databases per container instance identified by sid. Pdb_name specifies the prefix for container database naming in this case cdb2_pdb1, cdb2_pdb2, cdb2_pdb3
oracle_sid: "cdb2"
pdb_num: "3"
pdb_name: "{{ oracle_sid }}_pdb"
# CDB listener port, use different listener port for additional CDB on same host
listener_port: "1523"
# CDB is created with SGA at 75% of memory_limit, MB. Consider how many databases to be hosted on the node and how much ram to be allocated to each DB. The grand total SGA should not exceed 75% available RAM on node.
memory_limit: "5464"
# Set "em_configuration: DBEXPRESS" to install enterprise manager express and choose a unique port from 5500 to 5599 for each sid on the host.
# Leave them black if em express is not installed.
em_configuration: "DBEXPRESS"
em_express_port: "5501"
# {{groups.oracle[0]}} represents first Oracle DB server as defined in Oracle hosts group [oracle]. For concurrent multiple Oracle DB servers deployment, [0] will be incremented for each additional DB server. For example, {{groups.oracle[1]}}" represents DB server 2, "{{groups.oracle[2]}}" represents DB server 3 ... As a good practice and the default, minimum three volumes is allocated to a DB server with corresponding /u01, /u02, /u03 mount points, which store oracle binary, oracle data, and oracle recovery files respectively. Additional volumes can be added by click on "More NFS volumes" but the number of volumes allocated to a DB server must match with what is defined in global vars file by volumes_nfs parameter, which dictates how many volumes are to be created for each DB server.
host_datastores_nfs:
- {vol_name: "{{groups.oracle[0]}}_u01", aggr_name: "aggr01_node01", lif: "172.21.94.200", size: "25"}
- {vol_name: "{{groups.oracle[0]}}_u02", aggr_name: "aggr01_node01", lif: "172.21.94.200", size: "25"}
- {vol_name: "{{groups.oracle[0]}}_u03", aggr_name: "aggr01_node01", lif: "172.21.94.200", size: "25"}
-
在藍色欄位中填寫所有變數。
-
完成變數輸入後,按一下表單上的複製按鈕,複製所有要傳輸到 AWX 或 Tower 的變數。
-
導覽回 AWX 或 Tower,前往資源 → 主機,然後選擇並開啟 Oracle 伺服器設定頁面。
-
在“詳細資料”標籤下,按一下“編輯”,然後將步驟 1 中複製的變數貼上到 YAML 標籤下的“變數”欄位中。
-
按一下「Save(儲存)」。
-
對系統中的任何其他 Oracle 伺服器重複此程序。
4.配置全域變數
本節定義的變數適用於所有 Oracle 主機、資料庫和ONTAP叢集。
-
在以下嵌入式全域變數或 vars 形式中輸入特定於環境的參數。
|
必須更改藍色項目以符合您的環境。 |
#######################################################################
###### Oracle 19c deployment global user configuration variables ######
###### Consolidate all variables from ontap, linux and oracle ######
#######################################################################
###########################################
### Ontap env specific config variables ###
###########################################
#Inventory group name
#Default inventory group name - 'ontap'
#Change only if you are changing the group name either in inventory/hosts file or in inventory groups in case of AWX/Tower
hosts_group: "ontap"
#CA_signed_certificates (ONLY CHANGE to 'true' IF YOU ARE USING CA SIGNED CERTIFICATES)
ca_signed_certs: "false"
#Names of the Nodes in the ONTAP Cluster
nodes:
- "AFF-01"
- "AFF-02"
#Storage VLANs
#Add additional rows for vlans as necessary
storage_vlans:
- {vlan_id: "203", name: "infra_NFS", protocol: "NFS"}
More Storage VLANsEnter Storage VLANs details
#Details of the Data Aggregates that need to be created
#If Aggregate creation takes longer, subsequent tasks of creating volumes may fail.
#There should be enough disks already zeroed in the cluster, otherwise aggregate create will zero the disks and will take long time
data_aggregates:
- {aggr_name: "aggr01_node01"}
- {aggr_name: "aggr01_node02"}
#SVM name
svm_name: "ora_svm"
# SVM Management LIF Details
svm_mgmt_details:
- {address: "172.21.91.100", netmask: "255.255.255.0", home_port: "e0M"}
# NFS storage parameters when data_protocol set to NFS. Volume named after Oracle hosts name identified by mount point as follow for oracle DB server 1. Each mount point dedicates to a particular Oracle files: u01 - Oracle binary, u02 - Oracle data, u03 - Oracle redo. Add additional volumes by click on "More NFS volumes" and also add the volumes list to corresponding host_vars as host_datastores_nfs variable. For multiple DB server deployment, additional volumes sets needs to be added for additional DB server. Input variable "{{groups.oracle[1]}}_u01", "{{groups.oracle[1]}}_u02", and "{{groups.oracle[1]}}_u03" as vol_name for second DB server. Place volumes for multiple DB servers alternatingly between controllers for balanced IO performance, e.g. DB server 1 on controller node1, DB server 2 on controller node2 etc. Make sure match lif address with controller node.
volumes_nfs:
- {vol_name: "{{groups.oracle[0]}}_u01", aggr_name: "aggr01_node01", lif: "172.21.94.200", size: "25"}
- {vol_name: "{{groups.oracle[0]}}_u02", aggr_name: "aggr01_node01", lif: "172.21.94.200", size: "25"}
- {vol_name: "{{groups.oracle[0]}}_u03", aggr_name: "aggr01_node01", lif: "172.21.94.200", size: "25"}
#NFS LIFs IP address and netmask
nfs_lifs_details:
- address: "172.21.94.200" #for node-1
netmask: "255.255.255.0"
- address: "172.21.94.201" #for node-2
netmask: "255.255.255.0"
#NFS client match
client_match: "172.21.94.0/24"
###########################################
### Linux env specific config variables ###
###########################################
#NFS Mount points for Oracle DB volumes
mount_points:
- "/u01"
- "/u02"
- "/u03"
# Up to 75% of node memory size divided by 2mb. Consider how many databases to be hosted on the node and how much ram to be allocated to each DB.
# Leave it blank if hugepage is not configured on the host.
hugepages_nr: "1234"
# RedHat subscription username and password
redhat_sub_username: "xxx"
redhat_sub_password: "xxx"
####################################################
### DB env specific install and config variables ###
####################################################
db_domain: "your.domain.com"
# Set initial password for all required Oracle passwords. Change them after installation.
initial_pwd_all: "netapp123"
-
在藍色欄位中填寫所有變數。
-
完成變數輸入後,點選表單上的複製按鈕,將所有要傳輸到 AWX 或 Tower 的變數複製到下列作業範本中。
5.配置並啟動作業範本。
-
建立作業模板。
-
導覽至資源 → 範本 → 新增,然後按一下新增作業範本。
-
輸入名稱和描述
-
選擇作業類型;運行根據劇本配置系統,檢查執行劇本的試運行而不實際配置系統。
-
為劇本選擇相應的庫存、項目、劇本和憑證。
-
選擇 all_playbook.yml 作為要執行的預設劇本。
-
將從步驟 4 複製的全域變數貼上到 YAML 標籤下的範本變數欄位中。
-
勾選「作業標籤」欄位中的「啟動時提示」複選框。
-
按一下「Save(儲存)」。
-
-
啟動作業模板。
-
導航至資源 → 範本。
-
按一下所需的模板,然後按一下啟動。
-
啟動時提示輸入作業標籤時,輸入 requirements_config。您可能需要按一下 requirements_config 下方的「建立作業標籤」行來輸入作業標籤。
-
|
requirements_config 確保您擁有正確的程式庫來執行其他角色。 |
-
按一下“下一步”,然後按一下“啟動”以開始作業。
-
按一下檢視 → 作業來監控作業輸出和進度。
-
啟動時提示輸入作業標籤時,輸入 ontap_config。您可能需要點擊 ontap_config 正下方的建立「作業標籤」行來輸入作業標籤。
-
按一下“下一步”,然後按一下“啟動”以開始作業。
-
點選查看 → 作業來監控作業輸出和進度
-
ontap_config 角色完成後,再次為 linux_config 執行此程序。
-
導航至資源 → 範本。
-
選擇所需的模板,然後按一下啟動。
-
當啟動時提示在 linux_config 中輸入作業標籤類型時,您可能需要選擇 linux_config 正下方的建立「作業標籤」行來輸入作業標籤。
-
按一下“下一步”,然後按一下“啟動”以開始作業。
-
選擇檢視 → 作業來監控作業輸出和進度。
-
linux_config 角色完成後,再次為 oracle_config 執行此程序。
-
前往資源 → 模板。
-
選擇所需的模板,然後按一下啟動。
-
啟動時提示輸入作業標籤時,請輸入 oracle_config。您可能需要選擇 oracle_config 正下方的建立「作業標籤」行來輸入作業標籤。
-
按一下“下一步”,然後按一下“啟動”以開始作業。
-
選擇檢視 → 作業來監控作業輸出和進度。
6.在同一 Oracle 主機上部署附加資料庫
劇本的 Oracle 部分每次執行都會在 Oracle 伺服器上建立一個 Oracle 容器資料庫。若要在同一伺服器上建立其他容器資料庫,請完成下列步驟。
-
修改 host_vars 變數。
-
返回步驟 2 - 設定 Oracle host_vars。
-
將 Oracle SID 變更為不同的命名字串。
-
將偵聽器連接埠變更為不同的號碼。
-
如果您正在安裝 EM Express,請將 EM Express 連接埠變更為其他號碼。
-
將修改後的主機變數複製並貼上到「主機配置詳細資料」標籤中的「Oracle 主機變數」欄位。
-
-
僅使用 oracle_config 標籤啟動部署作業範本。
-
以oracle用戶登入Oracle伺服器,執行以下命令:
ps -ef | grep ora
如果安裝如預期完成且 Oracle DB 已啟動,這將列出 Oracle 進程 -
登入資料庫,檢查資料庫配置設定和使用以下命令集建立的 PDB。
[oracle@localhost ~]$ sqlplus / as sysdba SQL*Plus: Release 19.0.0.0.0 - Production on Thu May 6 12:52:51 2021 Version 19.8.0.0.0 Copyright (c) 1982, 2019, Oracle. All rights reserved. Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.8.0.0.0 SQL> SQL> select name, log_mode from v$database; NAME LOG_MODE --------- ------------ CDB2 ARCHIVELOG SQL> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 CDB2_PDB1 READ WRITE NO 4 CDB2_PDB2 READ WRITE NO 5 CDB2_PDB3 READ WRITE NO col svrname form a30 col dirname form a30 select svrname, dirname, nfsversion from v$dnfs_servers; SQL> col svrname form a30 SQL> col dirname form a30 SQL> select svrname, dirname, nfsversion from v$dnfs_servers; SVRNAME DIRNAME NFSVERSION ------------------------------ ------------------------------ ---------------- 172.21.126.200 /rhelora03_u02 NFSv3.0 172.21.126.200 /rhelora03_u03 NFSv3.0 172.21.126.200 /rhelora03_u01 NFSv3.0
這證實 dNFS 運作正常。
-
使用下列命令透過監聽器連接到資料庫來檢查 Oracle 監聽器配置。變更為適當的監聽連接埠和資料庫服務名稱。
[oracle@localhost ~]$ sqlplus system@//localhost:1523/cdb2_pdb1.cie.netapp.com SQL*Plus: Release 19.0.0.0.0 - Production on Thu May 6 13:19:57 2021 Version 19.8.0.0.0 Copyright (c) 1982, 2019, Oracle. All rights reserved. Enter password: Last Successful login time: Wed May 05 2021 17:11:11 -04:00 Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.8.0.0.0 SQL> show user USER is "SYSTEM" SQL> show con_name CON_NAME CDB2_PDB1
這證實 Oracle 監聽器正常運作。
去哪裡尋求協助?
如果您需要工具包的協助,請加入"NetApp解決方案自動化社群支援 Slack 頻道"並尋找解決方案自動化管道來發布您的問題或詢問。