Skip to content

Commit a79b41c

Browse files
authored
fix-nfs (#2759)
* fix-nfs * permissive policy update * add cleanup scripts * add cleanup scripts
1 parent 8377b74 commit a79b41c

File tree

5 files changed

+93
-14
lines changed

5 files changed

+93
-14
lines changed

OracleDatabase/RAC/OracleDNSServer/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ docker network create --driver=bridge --subnet=192.168.17.0/24 rac_priv1_nw
3838
```
3939
**Note:** You can change the subnet according to your environment.
4040

41-
### Running RAC DNS server container
42-
Execute following command to create the container on Docker Host:
41+
## Running RAC DNS server container
42+
### Execute following command to create the container on Docker Host
4343

4444
```bash
4545
docker create --hostname racdns \
@@ -61,7 +61,7 @@ docker network connect rac_priv1_nw --ip 192.168.17.25 rac-dnsserver
6161
docker start rac-dnsserver
6262
```
6363

64-
Execute following command to create the container on Podman Host:
64+
### Execute following command to create the container on Podman Host
6565

6666
```bash
6767
podman create --hostname racdns \
@@ -99,4 +99,4 @@ you should see the following in docker logs output:
9999
#################################################
100100
DNS Server IS READY TO USE!
101101
#################################################
102-
```
102+
```

OracleDatabase/RAC/OracleRACStorageServer/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,12 @@ mkdir -p /scratch/stage/rac-storage/$ORACLE_DBNAME
136136
rm -rf /scratch/stage/rac-storage/$ORACLE_DBNAME/asm_disk0*
137137
```
138138

139+
If SELinux is enabled on Podman Host (you can check by running `sestatus` command), then execute below to make SELinux policy as `permissive` and reboot the host machine. This will allow permissions to write to `asm-disks*` in the `/oradata` folder inside the podman containers-
140+
```bash
141+
sed -i 's/^SELINUX=.*/SELINUX=permissive/' /etc/selinux/config
142+
reboot
143+
```
144+
139145
Execute following command to create the container:
140146

141147
```bash

OracleDatabase/RAC/OracleRealApplicationClusters/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ You must install and configure [Podman release 4.0.2](https://docs.oracle.com/en
623623
624624
- You can check the details on [Oracle Linux and Unbreakable Enterprise Kernel (UEK) Releases](https://blogs.oracle.com/scoter/post/oracle-linux-and-unbreakable-enterprise-kernel-uek-releases)
625625
626-
- You do not need to execute step 2 in this section to create and enable `Podman-rac-cgroup.service` when we are running Oracle Linux 8 with Unbreakable Enterprise Kernel R7.
626+
- You do not need to execute step 2 in this section to create and enable `podman-rac-cgroup.service` when we are running Oracle Linux 8 with Unbreakable Enterprise Kernel R7.
627627
628628
**IMPORTANT:** Completing prerequisite steps is a requirement for successful configuration.
629629

OracleDatabase/RAC/OracleRealApplicationClusters/samples/racdockercompose/README.md

+33
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Once you have built your Oracle RAC container image, you can create a Oracle RAC
1414
- [Section 4.1: Add Additional Node in Existing Oracle RAC Cluster with Block Devices](#section-41-add-additional-node-in-existing-oracle-rac-cluster-with-block-devices)
1515
- [Section 4.2: Add Additional Node in Existing Oracle RAC Cluster with NFS Volume](#section-42-add-additional-node-in-existing-oracle-rac-cluster-with-nfs-volume)
1616
- [Section 5: Connect to the RAC container](#connect-to-the-rac-container)
17+
- [Cleanup RAC Environment](#cleanup-rac-environment)
1718
- [Copyright](#copyright)
1819

1920
## Section 1 : Prerequisites for RAC Database on Docker with Docker Compose
@@ -451,6 +452,38 @@ docker exec -i -t racnoded1 /bin/bash
451452

452453
If the install fails for any reason, log in to container using the above command and check `/tmp/orod.log`. You can also review the Grid Infrastructure logs located at `$GRID_BASE/diag/crs` and check for failure logs. If the failure occurred during the database creation then check the database logs.
453454

455+
## Cleanup RAC Environment
456+
Below commands can be executed to cleanup above RAC Environment -
457+
458+
### Cleanup RAC based on Block Devices
459+
```bash
460+
#----Cleanup RAC Containers-----
461+
docker rm -f racnoded1 racnoded2 rac-dnsserver racnodedc1-cman
462+
#----Cleanup Disks--------------
463+
dd if=/dev/zero of=/dev/oracleoci/oraclevde bs=8k count=10000 status=progress && dd if=/dev/zero of=/dev/oracleoci/oraclevdd bs=8k count=10000 status=progress
464+
#----Cleanup Files and Folders--
465+
rm -rf /opt/containers /opt/.secrets
466+
#----Cleanup Docker Networks--
467+
docker network rm -f rac_pub1_nw rac_pzriv1_nw
468+
#----Cleanup Docker Images--
469+
docker rmi -f oracle/rac-dnsserver:latest oracle/database-rac:19.3.0 oracle/client-cman:19.3.0
470+
```
471+
472+
### Cleanup RAC based on NFS Storage Devices
473+
```bash
474+
#----Cleanup RAC Containers-----
475+
docker rm -f racnoded1 racnoded2 rac-dnsserver racnode-storage racnodedc1-cman
476+
#----Cleanup Files and Folders--
477+
rm -rf /opt/containers /opt/.secrets
478+
export ORACLE_DBNAME=ORCLCDB
479+
rm -rf /docker_volumes/asm_vol/$ORACLE_DBNAME/asm_disk0*
480+
#----Cleanup Docker Volumes---
481+
docker volume -f racstorage
482+
#----Cleanup Docker Networks--
483+
docker network rm -f rac_pub1_nw rac_pzriv1_nw
484+
#----Cleanup Docker Images--
485+
docker rmi -f oracle/rac-dnsserver:latest oracle/rac-storage-server:19.3.0 oracle/database-rac:19.3.0 oracle/client-cman:19.3.0
486+
```
454487

455488
## Copyright
456489

OracleDatabase/RAC/OracleRealApplicationClusters/samples/racpodmancompose/README.md

+49-9
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Once you have built your Oracle RAC container image, you can create a Oracle RAC
1414
- [Section 4.1: Add Additional Node in Existing Oracle RAC Cluster with Block Devices](#section-41-add-additional-node-in-existing-oracle-rac-cluster-with-block-devices)
1515
- [Section 4.2: Add Additional Node in Existing Oracle RAC Cluster with NFS Volume](#section-42-add-additional-node-in-existing-oracle-rac-cluster-with-nfs-volume)
1616
- [Section 5: Connect to the RAC container](#connect-to-the-rac-container)
17+
- [Cleanup RAC Environment](#cleanup-rac-environment)
1718
- [Copyright](#copyright)
1819

1920
## Section 1 : Prerequisites for RAC Database on Podman with Podman Compose
@@ -92,6 +93,12 @@ In order to setup Oracle RAC on Podman with Oracle RAC Storage Container with Po
9293
yum -y install nfs-utils
9394
```
9495

96+
If SELinux is enabled on Podman Host (you can check by running `sestatus` command), then execute below to make SELinux policy as `permissive` and reboot host machine. This will allow permissions to write to `asm-disks*` in the `/oradata` folder inside the podman containers-
97+
```bash
98+
sed -i 's/^SELINUX=.*/SELINUX=permissive/' /etc/selinux/config
99+
reboot
100+
```
101+
95102
Lets identify necessary variables to export that will be used by `podman-compose.yml` file later. Below is one example of exporting necessary variables related to docker network, DNS container, Storage Container, RAC Container and CMAN container discussed in this repo.
96103
```bash
97104
export HEALTHCHECK_INTERVAL=30s
@@ -241,15 +248,6 @@ mkdir -p /scratch/stage/rac-storage/$ORACLE_DBNAME
241248
rm -rf /scratch/stage/rac-storage/ORCLCDB/asm_disk0*
242249
```
243250

244-
```bash
245-
#----------Create NFS volume--------------
246-
podman volume create --driver local \
247-
--opt type=nfs \
248-
--opt o=addr=192.168.17.80,rw,bg,hard,tcp,vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0 \
249-
--opt device=192.168.17.80:/oradata \
250-
racstorage
251-
```
252-
253251
After copying compose file, you can bring up DNS Container, Storage Container, RAC Container and CMAN container by following below commands-
254252
```bash
255253
#---------Bring up DNS------------
@@ -278,6 +276,16 @@ Export list for racnode-storage:
278276
#################################################
279277
```
280278

279+
```bash
280+
#----------Create NFS volume--------------
281+
podman volume create --driver local \
282+
--opt type=nfs \
283+
--opt o=addr=192.168.17.80,rw,bg,hard,tcp,vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0 \
284+
--opt device=192.168.17.80:/oradata \
285+
racstorage
286+
```
287+
288+
281289
```bash
282290
#-----Bring up racnode1----------
283291
podman-compose --podman-run-args="-t -i --systemd=always --cpuset-cpus 0-1 --memory 16G --memory-swap 32G" up -d ${RACNODE1_CONTAINER_NAME} && \
@@ -444,6 +452,38 @@ podman exec -i -t racnodep1 /bin/bash
444452

445453
If the install fails for any reason, log in to container using the above command and check `/tmp/orod.log`. You can also review the Grid Infrastructure logs located at `$GRID_BASE/diag/crs` and check for failure logs. If the failure occurred during the database creation then check the database logs.
446454

455+
## Cleanup RAC Environment
456+
Below commands can be executed to cleanup above RAC Environment -
457+
458+
### Cleanup RAC based on Block Devices
459+
```bash
460+
#----Cleanup RAC Containers-----
461+
podman rm -f racnodep1 racnodep2 rac-dnsserver racnodepc1-cman
462+
#----Cleanup Disks--------------
463+
dd if=/dev/zero of=/dev/oracleoci/oraclevde bs=8k count=10000 status=progress && dd if=/dev/zero of=/dev/oracleoci/oraclevdd bs=8k count=10000 status=progress
464+
#----Cleanup Files and Folders--
465+
rm -rf /opt/containers /opt/.secrets
466+
#----Cleanup Docker Networks--
467+
podman network rm -f rac_pub1_nw rac_zriv1_nw
468+
#----Cleanup Docker Images--
469+
podman rmi -f localhost/oracle/rac-dnsserver:latest localhost/oracle/database-rac:21.3.0-21.13.0 localhost/oracle/client-cman:21.3.0
470+
```
471+
472+
### Cleanup RAC based on NFS Storage Devices
473+
```bash
474+
#----Cleanup RAC Containers-----
475+
podman rm -f racnodep1 racnodep2 rac-dnsserver racnode-storage racnodepc1-cman
476+
#----Cleanup Files and Folders--
477+
rm -rf /opt/containers /opt/.secrets
478+
export ORACLE_DBNAME=ORCLCDB
479+
rm -rf /scratch/stage/rac-storage/ORCLCDB/asm_disk0*
480+
#----Cleanup Docker Volumes---
481+
podman volume -f racstorage
482+
#----Cleanup Docker Networks--
483+
podman network rm -f rac_pub1_nw rac_priv1_nw
484+
#----Cleanup Docker Images--
485+
podman rmi -f localhost/oracle/rac-dnsserver:latest localhost/oracle/rac-storage-server:latest localhost/oracle/database-rac:21.3.0-21.13.0 localhost/oracle/client-cman:21.3.0
486+
```
447487

448488
## Copyright
449489

0 commit comments

Comments
 (0)