- Vorbereitung
- ASMLib installieren
- Primäre Partitionen für die ASM-Disks anlegen
- ASM-Disks Konfigurieren
- SSH Setup einrichten
- RAC Installation
- Installation einer Datenbank im RAC
Vorbereitung
DNS-Server
Scan-Adresse einrichten
C:\>nslookup scan.rac1.demo.local
Server: localhost
Address: 127.0.0.1
Name: scan.rac1.demo.local
Addresses: 192.168.111.136
192.168.111.133
192.168.111.137
Die Template VM 2 mal klonen siehe hierzu Template VM.
2 Netzwerk-Interfaces hinzufügen
Es wurde ein Netzwerk für den Interconnect (VMnet2) und ein Netzwerk für iSCSI und FLex-ASM (VMnet3) eingerichtet.
Mit iSCSI an den Storage Server anschließen, siehe hierzu Red Hat Storage Server iSCSI
Jedoch muss für jeden RAC-Node ein eigener Initiator angelegt werden.
#Auf dem Storage-Server
[root@storage-server] /root
$ targetcli
cd /iscsi/iqn.2020-12.local.demo:asm/tpg1/acls
/iscsi/iqn.20...asm/tpg1/acls> create iqn.2020-12.rac-node-1.local.demo:init1
Created Node ACL for iqn.2020-12.rac-node-1.local.demo:init1
Created mapped LUN 0.
Created mapped LUN 1.
Created mapped LUN 2.
Created mapped LUN 3.
Created mapped LUN 4.
Created mapped LUN 5.
Created mapped LUN 6.
Created mapped LUN 7.
Created mapped LUN 8.
/iscsi/iqn.20...asm/tpg1/acls> create iqn.2020-12.rac-node-2.local.demo:init1
Created Node ACL for iqn.2020-12.rac-node-2.local.demo:init1
Created mapped LUN 0.
Created mapped LUN 1.
Created mapped LUN 2.
Created mapped LUN 3.
Created mapped LUN 4.
Created mapped LUN 5.
Created mapped LUN 6.
Created mapped LUN 7.
Created mapped LUN 8.
/iscsi/iqn.20...asm/tpg1/acls>
Nun noch auf den RAC-Nodes die Datei "/etc/iscsi/initiatorname.iscsi" anpassen.
rac-node-1:
InitiatorName=iqn.2020-12.rac-node-1.local.demo:init1
rac-node-2:
InitiatorName=iqn.2020-12.rac-node-2.local.demo:init1
Nach den Vorbereitungen haben wir die beteiligten Komponenten:
Funktion | Hostname | IP | IP-Interconnect | IP-Storage |
Nameserver | dc1.demo.local | 192.168.111.100 | ||
Storage-Server | storage-server | 192.168.111.106 | 192.168.112.100 | 192.168.112.100 |
RAC-Node-1 | rac-node-1 | 192.168.111.131 | 192.168.113.131 | 192.168.112.131 |
RAC-Node-2 | rac-node-2 | 192.168.111.132 | 192.168.113.132 | 192.168.112.132 |
ASMLib installieren
Bei der Entscheidung für ASMLIB oder AFD sollte die Support Note berücksichtigt werden:
ACFS Support On OS Platforms (Certification Matrix). (Doc ID 1369107.1)
Ich habe mich hier für ASMLIB entschieden, da wir RHEL 8 benutzen.
## Auf allen RAC-Node!
dnf install -y kmod-redhat-oracleasm.x86_64
dnf install -y https://download.oracle.com/otn_software/asmlib/oracleasmlib-2.0.17-1.el8.x86_64.rpm
dnf install -y https://public-yum.oracle.com/repo/OracleLinux/OL8/addons/x86_64/getPackage/oracleasm-support-2.1.12-1.el8.x86_64.rpm
Primäre Partitionen für die ASM-Disks anlegen
#Unsere Disks sollten auf allen RAC-Node gleich sein!
[root@rac-node-2] /root
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 10G 0 disk
sdb 8:16 0 10G 0 disk
sdc 8:32 0 10G 0 disk
sdd 8:48 0 10G 0 disk
sde 8:64 0 10G 0 disk
sdf 8:80 0 10G 0 disk
sdg 8:96 0 10G 0 disk
sdh 8:112 0 10G 0 disk
sdi 8:128 0 10G 0 disk
sr0 11:0 1 8,8G 0 rom /run/media/oracle/RHEL-8-3-0-BaseOS-x86_64
nvme0n1 259:0 0 150G 0 disk
├─nvme0n1p1 259:1 0 1G 0 part /boot
└─nvme0n1p2 259:2 0 149G 0 part
├─rhel-root 253:0 0 130G 0 lvm /
├─rhel-swap 253:1 0 7,9G 0 lvm [SWAP]
└─rhel-home 253:2 0 10G 0 lvm /home
Ich nutze noch immer fdisk von /dev/sda bis /dev/sdi
fdisk /dev/sdi
Willkommen bei fdisk (util-linux 2.32.1).
Änderungen werden vorerst nur im Speicher vorgenommen, bis Sie sich
entscheiden, sie zu schreiben.
Seien Sie vorsichtig, bevor Sie den Schreibbefehl anwenden.
Gerät enthält keine erkennbare Partitionstabelle.
Eine neue DOS-Festplattenbezeichnung 0x01f98e3d wurde erstellt.
Befehl (m für Hilfe): n
Partitionstyp
p Primär (0 primär, 0 erweitert, 4 frei)
e Erweitert (Container für logische Partitionen)
Wählen (Vorgabe p): p
Partitionsnummer (1-4, Vorgabe 1):
Erster Sektor (16384-20971519, Vorgabe 16384):
Letzter Sektor, +Sektoren oder +Größe{K,M,G,T,P} (16384-20971519, Vorgabe 20971519):
Eine neue Partition 1 des Typs „Linux“ und der Größe 10 GiB wurde erstellt.
Befehl (m für Hilfe): w
Die Partitionstabelle wurde verändert.
ioctl() wird aufgerufen, um die Partitionstabelle neu einzulesen.
Festplatten werden synchronisiert.
Nach der Anlage der Primären Partitionen
[root@rac-node-2] /root
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 10G 0 disk
└─sda1 8:1 0 10G 0 part
sdb 8:16 0 10G 0 disk
└─sdb1 8:17 0 10G 0 part
sdc 8:32 0 10G 0 disk
└─sdc1 8:33 0 10G 0 part
sdd 8:48 0 10G 0 disk
└─sdd1 8:49 0 10G 0 part
sde 8:64 0 10G 0 disk
└─sde1 8:65 0 10G 0 part
sdf 8:80 0 10G 0 disk
└─sdf1 8:81 0 10G 0 part
sdg 8:96 0 10G 0 disk
└─sdg1 8:97 0 10G 0 part
sdh 8:112 0 10G 0 disk
└─sdh1 8:113 0 10G 0 part
sdi 8:128 0 10G 0 disk
└─sdi1 8:129 0 10G 0 part
sr0 11:0 1 8,8G 0 rom /run/media/oracle/RHEL-8-3-0-BaseOS-x86_64
nvme0n1 259:0 0 150G 0 disk
├─nvme0n1p1 259:1 0 1G 0 part /boot
└─nvme0n1p2 259:2 0 149G 0 part
├─rhel-root 253:0 0 130G 0 lvm /
├─rhel-swap 253:1 0 7,9G 0 lvm [SWAP]
└─rhel-home 253:2 0 10G 0 lvm /home
ASM-Disks Konfigurieren
Auf allen RAC-Nodes
# Treiber konfigurieren
[root@rac-node-1] /root
$ oracleasm configure -i
Configuring the Oracle ASM library driver.
This will configure the on-boot properties of the Oracle ASM library
driver. The following questions will determine whether the driver is
loaded on boot and what permissions it will have. The current values
will be shown in brackets ('[]'). Hitting <ENTER> without typing an
answer will keep that current value. Ctrl-C will abort.
Default user to own the driver interface []: oracle
Default group to own the driver interface []: oinstall
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done
# Treiber starten
[root@rac-node-1] /root
$ oracleasm init
Creating /dev/oracleasm mount point: /dev/oracleasm
Loading module "oracleasm": oracleasm
Configuring "oracleasm" to use device physical block size
Mounting ASMlib driver filesystem: /dev/oracleasm
Disks anlegen, nur auf einen Knoten, da die Disks ja geshared sind!
#Von /dev/sda1 bis /dev/sdi1
[root@rac-node-1] /root
$ oracleasm createdisk DISK01 /dev/sda1
Writing disk header: done
Instantiating disk: done
...
[root@rac-node-1] /root
$ oracleasm createdisk DISK09 /dev/sdi1
Writing disk header: done
Instantiating disk: done
Ergebnis auf allen RAC-Nodes prüfen
#RAC-Node-1
[root@rac-node-1] /root
$ oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
[root@rac-node-1] /root
$ oracleasm listdisks
DISK01
DISK02
DISK03
DISK04
DISK05
DISK06
DISK07
DISK08
DISK09
#RAC-Node-2
root@rac-node-2] /root
$ oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
Instantiating disk "DISK01"
Instantiating disk "DISK02"
Instantiating disk "DISK03"
Instantiating disk "DISK04"
Instantiating disk "DISK05"
Instantiating disk "DISK06"
Instantiating disk "DISK07"
Instantiating disk "DISK08"
Instantiating disk "DISK09"
[root@rac-node-2] /root
$ oracleasm listdisks
DISK01
DISK02
DISK03
DISK04
DISK05
DISK06
DISK07
DISK08
DISK09
SSH Setup einrichten
Die SSH Konnektivität haben wir ja schon in Template VM eingerichtet.
Fehler mit der SSH Version 8
INS-06006 GI RunInstaller Fails If OpenSSH Is Upgraded to 8.x (Doc ID 2555697.1)
# Rename the original scp.
mv /usr/bin/scp /usr/bin/scp.orig
# Create a new file </usr/bin/scp>.
vi /usr/bin/scp
# Add the below line to the new created file </usr/bin/scp>.
/usr/bin/scp.orig -T $*
# Change the file permission.
chmod 555 /usr/bin/scp
After installation:
mv /usr/bin/scp.orig /usr/bin/scp
RAC Installation
Installation starten
[oracle@rac-node-1@] /app/oracle/product/19grid
$ ./gridSetup.sh
Setupassistent von Oracle Grid Infrastructure wird gestartet...
Das "root.sh" Skript nicht "automatisch" ausführen lassen. Hat bei mir nicht richtig funktioniert.
Nochmals prüfen ob alles OK ist.
Nun noch das aktuelle RU installieren zur Zeit 19.9, als User root!
Auf allen RAC-Nodes!
root@rac-node-1] /app/oracle/product/19grid
$ export ORACLE_HOME=/app/oracle/product/19grid
[root@rac-node-1] /app/oracle/product/19grid
$ $ORACLE_HOME/OPatch/opatchauto apply /tmp/31750108 -oh $ORACLE_HOME
Nach dem Patchen
--------------------------------Summary--------------------------------
Patching is completed successfully. Please find the summary as follows:
Host:rac-node-1
CRS Home:/app/oracle/product/19grid
Version:19.0.0.0.0
Summary:
==Following patches were SUCCESSFULLY applied:
Patch: /tmp/31750108/31771877
Log: /app/oracle/product/19grid/cfgtoollogs/opatchauto/core/opatch/opatch2020-12-29_08-31-03AM_1.log
Patch: /tmp/31750108/31772784
Log: /app/oracle/product/19grid/cfgtoollogs/opatchauto/core/opatch/opatch2020-12-29_08-31-03AM_1.log
Patch: /tmp/31750108/31773437
Log: /app/oracle/product/19grid/cfgtoollogs/opatchauto/core/opatch/opatch2020-12-29_08-31-03AM_1.log
Patch: /tmp/31750108/31780966
Log: /app/oracle/product/19grid/cfgtoollogs/opatchauto/core/opatch/opatch2020-12-29_08-31-03AM_1.log
OPatchauto session completed at Tue Dec 29 08:36:35 2020
Time taken to complete the session 6 minutes, 6 seconds
Nun kommt die eigentliche Installation
Ist am Nameserver konfiguriert!
Wichtig Discovery-Pfad sollte auf "ORCL:*" stehen.
Root.sh wird händisch ausgeführt! Bei mir bleibt die automatische Ausführung immer hängen.
cvuqdisk-1.0.10-1 werden wir heheben, auf beiden Knoten von Hand.
root@rac-node-1] /tmp/GridSetupActions2020-12-29_08-43-44AM/CVU_19.0.0.0.0_oracle
$ rpm -Uhv cvuqdisk-1.0.10-1.rpm
Verifying... ################################# [100%]
Vorbereiten … ################################# [100%]
Aktualisierung/ Installation …
1:cvuqdisk-1.0.10-1 ################################# [100%]
root.sh wurde auf allen RAC-Nodes erfolgreich ausgeführt.
2020/12/29 09:48:19 CLSRSC-594: Executing installation step 17 of 19: 'StartCluster'.
2020/12/29 09:49:19 CLSRSC-343: Successfully started Oracle Clusterware stack
2020/12/29 09:49:19 CLSRSC-594: Executing installation step 18 of 19: 'ConfigNode'.
2020/12/29 09:50:56 CLSRSC-594: Executing installation step 19 of 19: 'PostConfig'.
2020/12/29 09:51:24 CLSRSC-325: Configure Oracle Grid Infrastructure for a Cluster ... succeeded
Die Installation ist nun abgeschlossen
Noch eine kurze Prüfung, ob wirklich alles Ok ist.
[oracle@rac-node-1@] /app/oracle/product/19grid
$ crsctl status resource -t
--------------------------------------------------------------------------------
Name Target State Server State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr
ONLINE ONLINE rac-node-1 STABLE
ONLINE ONLINE rac-node-2 STABLE
ora.chad
ONLINE ONLINE rac-node-1 STABLE
ONLINE ONLINE rac-node-2 STABLE
ora.net1.network
ONLINE ONLINE rac-node-1 STABLE
ONLINE ONLINE rac-node-2 STABLE
ora.ons
ONLINE ONLINE rac-node-1 STABLE
ONLINE ONLINE rac-node-2 STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)
1 ONLINE ONLINE rac-node-1 STABLE
2 ONLINE ONLINE rac-node-2 STABLE
ora.DATA.dg(ora.asmgroup)
1 ONLINE ONLINE rac-node-1 STABLE
2 ONLINE ONLINE rac-node-2 STABLE
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE rac-node-2 STABLE
ora.LISTENER_SCAN2.lsnr
1 ONLINE ONLINE rac-node-1 STABLE
ora.LISTENER_SCAN3.lsnr
1 ONLINE ONLINE rac-node-1 STABLE
ora.asm(ora.asmgroup)
1 ONLINE ONLINE rac-node-1 STABLE
2 ONLINE ONLINE rac-node-2 Started,STABLE
ora.asmnet1.asmnetwork(ora.asmgroup)
1 ONLINE ONLINE rac-node-1 STABLE
2 ONLINE ONLINE rac-node-2 STABLE
ora.cvu
1 ONLINE ONLINE rac-node-1 STABLE
ora.qosmserver
1 ONLINE ONLINE rac-node-1 STABLE
ora.rac-node-1.vip
1 ONLINE ONLINE rac-node-1 STABLE
ora.rac-node-2.vip
1 ONLINE ONLINE rac-node-2 STABLE
ora.scan1.vip
1 ONLINE ONLINE rac-node-2 STABLE
ora.scan2.vip
1 ONLINE ONLINE rac-node-1 STABLE
ora.scan3.vip
1 ONLINE ONLINE rac-node-1 STABLE
--------------------------------------------------------------------------------
Installation einer Datenbank im RAC
Mit dem RAC funktioniert unsere vorinstallierte Datenbank aus dem Template leider nicht, da es keine RAC Installation ist. Somit müssen wir vorab die Installation durchführen, incl. Patches.
Da chrony als Zeitserver verwendet wird sind uns die Fehlermeldungen egal.
Jetzt noch bei allen RAC-Nodes das letzte RU (DB/OJVM) in den DB_HOME's installieren.
Nun kann eine RAC Datenbank erzeugt werden.
...
Die Fehlermeldung wird ignoriert.
Prüfen ob alles läuft.
$ crsctl status resource -t
--------------------------------------------------------------------------------
Name Target State Server State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr
ONLINE ONLINE rac-node-1 STABLE
ONLINE ONLINE rac-node-2 STABLE
ora.chad
ONLINE ONLINE rac-node-1 STABLE
ONLINE ONLINE rac-node-2 STABLE
ora.net1.network
ONLINE ONLINE rac-node-1 STABLE
ONLINE ONLINE rac-node-2 STABLE
ora.ons
ONLINE ONLINE rac-node-1 STABLE
ONLINE ONLINE rac-node-2 STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)
1 ONLINE ONLINE rac-node-1 STABLE
2 ONLINE ONLINE rac-node-2 STABLE
ora.DATA.dg(ora.asmgroup)
1 ONLINE ONLINE rac-node-1 STABLE
2 ONLINE ONLINE rac-node-2 STABLE
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE rac-node-1 STABLE
ora.LISTENER_SCAN2.lsnr
1 ONLINE ONLINE rac-node-2 STABLE
ora.LISTENER_SCAN3.lsnr
1 ONLINE ONLINE rac-node-2 STABLE
ora.asm(ora.asmgroup)
1 ONLINE ONLINE rac-node-1 Started,STABLE
2 ONLINE ONLINE rac-node-2 STABLE
ora.asmnet1.asmnetwork(ora.asmgroup)
1 ONLINE ONLINE rac-node-1 STABLE
2 ONLINE ONLINE rac-node-2 STABLE
ora.cvu
1 ONLINE ONLINE rac-node-2 STABLE
ora.qosmserver
1 ONLINE ONLINE rac-node-2 STABLE
ora.rac-node-1.vip
1 ONLINE ONLINE rac-node-1 STABLE
ora.rac-node-2.vip
1 ONLINE ONLINE rac-node-2 STABLE
ora.racdb1.db
1 ONLINE ONLINE rac-node-1 Open,HOME=/app/oracl
e/product/19racdb,ST
ABLE
2 ONLINE ONLINE rac-node-2 Open,HOME=/app/oracl
e/product/19racdb,ST
ABLE
ora.scan1.vip
1 ONLINE ONLINE rac-node-1 STABLE
ora.scan2.vip
1 ONLINE ONLINE rac-node-2 STABLE
ora.scan3.vip
1 ONLINE ONLINE rac-node-2 STABLE
--------------------------------------------------------------------------------
Die Ressource "ora.rac-db1.db" ist nun vorhanden und läuft auf allen Nodes.