Skip to content

Commit e8c057d

Browse files
authored
compose file changes (#2749)
1 parent 021a04c commit e8c057d

File tree

12 files changed

+1368
-39
lines changed

12 files changed

+1368
-39
lines changed

OracleDatabase/RAC/OracleRealApplicationClusters/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ To create an Oracle RAC environment, complete these steps in order:
3636
- [Assign Network to additional Oracle RAC container](#assign-network-to-additional-oracle-rac-container)
3737
- [Start Oracle RAC racnode2 container](#start-oracle-rac-racnode2-container)
3838
- [Connect to the Oracle RAC racnode2 container](#connect-to-the-oracle-rac-racnode2-container)
39+
- [Section 4.4: Setup Oracle RAC Container on Docker with Docker Compose](#section-44-setup-oracle-rac-container-on-docker-with-docker-compose)
3940
- [Section 5: Oracle RAC on Podman](#section-5-oracle-rac-on-podman)
4041
- [Section 5.1 : Prerequisites for Running Oracle RAC on Podman](#section-51--prerequisites-for-running-oracle-rac-on-podman)
4142
- [Section 5.2: Setup RAC Containers on Podman](#section-52-setup-rac-containers-on-podman)
@@ -49,6 +50,7 @@ To create an Oracle RAC environment, complete these steps in order:
4950
- [Deploying Oracle RAC Additional Node on Container with Oracle RAC Storage Container on Podman](#deploying-oracle-rac-additional-node-on-container-with-oracle-rac-storage-container-on-podman)
5051
- [Assign Network to additional Oracle RAC container Created Using Podman](#assign-network-to-additional-oracle-rac-container-created-using-podman)
5152
- [Start Oracle RAC container](#start-oracle-rac-container)
53+
- [Section 5.4: Setup Oracle RAC Container on Podman with Podman Compose](#section-54-setup-oracle-rac-container-on-podman-with-podman-compose)
5254
- [Section 6: Connecting to an Oracle RAC Database](#section-6-connecting-to-an-oracle-rac-database)
5355
- [Section 7: Environment Variables for the First Node](#section-7-environment-variables-for-the-first-node)
5456
- [Section 8: Environment Variables for the Second and Subsequent Nodes](#section-8-environment-variables-for-the-second-and-subsequent-nodes)
@@ -578,6 +580,18 @@ To connect to the container execute the following command:
578580

579581
If the node addition fails, log in to the container using the preceding command and review `/tmp/orod.log`. You can also review the Grid Infrastructure logs i.e. `$GRID_BASE/diag/crs` and check for failure logs. If the node creation has failed during the database creation process, then check DB logs.
580582

583+
## Section 4.4: Setup Oracle RAC Container on Docker with Docker Compose
584+
585+
Oracle RAC database can also be deployed with Docker Compose. An example of how to install Oracle RAC Database on Single Host via Bridge Network is explained in this [README.md](./samples/racdockercompose/README.md)
586+
587+
Same section covers various below scenarios as well with docker compose-
588+
1. Deploying Oracle RAC on Container with Block Devices on Docker with Docker Compose
589+
2. Deploying Oracle RAC on Container With Oracle RAC Storage Container with Docker Compose
590+
3. Deploying Oracle RAC Additional Node on Container with Block Devices on Docker with Docker Compose
591+
4. Deploying Oracle RAC Additional Node on Container with Oracle RAC Storage Container on Docker with Docker Compose
592+
593+
***Note:*** Docker and Docker Compose is not supported with OL8. You need OL7.9 with UEK R5 or R6.
594+
581595
## Section 5: Oracle RAC on Podman
582596

583597
If you are deploying Oracle RAC On Docker, skip to [Section 4: Oracle RAC on Docker](#section-4-oracle-rac-on-docker)
@@ -988,6 +1002,15 @@ You should see the database creation success message at the end.
9881002
ORACLE RAC DATABASE IS READY TO USE!
9891003
####################################
9901004
```
1005+
## Section 5.4: Setup Oracle RAC Container on Podman with Podman Compose
1006+
1007+
Oracle RAC database can also be deployed with podman Compose. An example of how to install Oracle RAC Database on Single Host via Bridge Network is explained in this [README.md](./samples/racpodmancompose/README.md)
1008+
1009+
Same section covers various below scenarios as well with podman compose-
1010+
1. Deploying Oracle RAC on Container with Block Devices on Podman with Podman Compose
1011+
2. Deploying Oracle RAC Additional Node on Container with Block Devices on Podman with Podman Compose
1012+
1013+
***Note:*** Podman and Podman Compose is not supported with OL7. You need OL8.8 with UEK R7.
9911014
9921015
## Section 6: Connecting to an Oracle RAC Database
9931016

OracleDatabase/RAC/OracleRealApplicationClusters/dockerfiles/19.3.0/setupGridEnv.sh

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -192,22 +192,39 @@ fi
192192
####################################### Set Resetting Failed Units ##########################
193193
resetFailedUnits()
194194
{
195-
if [ "${RESET_FAILED_SYSTEMD}" != 'false' ]; then
196-
197-
cp $SCRIPT_DIR/$RESET_FAILED_UNITS /var/tmp/$RESET_FAILED_UNITS
198-
chmod 755 /var/tmp/$RESET_FAILED_UNITS
199-
print_message "Setting Crontab"
200-
cmd='su - $GRID_USER -c "sudo crontab $SCRIPT_DIR/$SET_CRONTAB"'
201-
eval $cmd
202-
203-
if [ $? -eq 0 ];then
204-
print_message "Sucessfully installed $SET_CRONTAB using crontab"
205-
else
206-
error_exit "Error occurred in crontab setup"
207-
fi
208-
209-
fi
195+
if [ "${RESET_FAILED_SYSTEMD}" != 'false' ]; then
196+
# Define the service name
197+
SERVICE_NAME="rhnsd"
198+
199+
# Check if the service is running
200+
if pgrep -x "$SERVICE_NAME" >/dev/null; then
201+
print_message "$SERVICE_NAME is running."
202+
203+
# Check if the service is responding
204+
if ! systemctl is-active --quiet "$SERVICE_NAME"; then
205+
print_message "$SERVICE_NAME is not responding. Stopping the service."
206+
systemctl stop "$SERVICE_NAME"
207+
systemctl disable "$SERVICE_NAME"
208+
print_message "$SERVICE_NAME stopped."
209+
else
210+
print_message "$SERVICE_NAME is responsive. No action needed."
211+
fi
212+
else
213+
print_message "$SERVICE_NAME is not running."
214+
fi
215+
216+
cp "$SCRIPT_DIR/$RESET_FAILED_UNITS" "/var/tmp/$RESET_FAILED_UNITS"
217+
chmod 755 "/var/tmp/$RESET_FAILED_UNITS"
218+
print_message "Setting Crontab"
219+
cmd="su - $GRID_USER -c \"sudo crontab $SCRIPT_DIR/$SET_CRONTAB\""
220+
eval "$cmd"
221+
if [ $? ]; then
222+
print_message "Sucessfully installed $SET_CRONTAB using crontab"
223+
else
224+
error_exit "Error occurred in crontab setup"
225+
fi
210226

227+
fi
211228
}
212229

213230

@@ -323,6 +340,7 @@ fi
323340
print_message "Process id of the program : $TOP_ID"
324341
##### start ntpd #######
325342
startNTPD
343+
resetFailedUnits
326344
pre_grid_deploy_steps
327345
checkHostName
328346
SetupEtcHosts

OracleDatabase/RAC/OracleRealApplicationClusters/dockerfiles/21.3.0/setupGridEnv.sh

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -194,25 +194,41 @@ fi
194194
####################################### Set Resetting Failed Units ##########################
195195
resetFailedUnits()
196196
{
197-
if [ "${RESET_FAILED_SYSTEMD}" != 'false' ]; then
198-
199-
cp "$SCRIPT_DIR"/"$RESET_FAILED_UNITS" /var/tmp/$RESET_FAILED_UNITS
200-
chmod 755 /var/tmp/$RESET_FAILED_UNITS
201-
print_message "Setting Crontab"
202-
# shellcheck disable=SC2016
203-
cmd='su - $GRID_USER -c "sudo crontab $SCRIPT_DIR/$SET_CRONTAB"'
204-
205-
if eval "$cmd";then
206-
print_message "Sucessfully installed $SET_CRONTAB using crontab"
207-
else
208-
error_exit "Error occurred in crontab setup"
209-
fi
210-
211-
fi
197+
if [ "${RESET_FAILED_SYSTEMD}" != 'false' ]; then
198+
# Define the service name
199+
SERVICE_NAME="rhnsd"
200+
201+
# Check if the service is running
202+
if pgrep -x "$SERVICE_NAME" >/dev/null; then
203+
print_message "$SERVICE_NAME is running."
204+
205+
# Check if the service is responding
206+
if ! systemctl is-active --quiet "$SERVICE_NAME"; then
207+
print_message "$SERVICE_NAME is not responding. Stopping the service."
208+
systemctl stop "$SERVICE_NAME"
209+
systemctl disable "$SERVICE_NAME"
210+
print_message "$SERVICE_NAME stopped."
211+
else
212+
print_message "$SERVICE_NAME is responsive. No action needed."
213+
fi
214+
else
215+
print_message "$SERVICE_NAME is not running."
216+
fi
217+
218+
cp "$SCRIPT_DIR/$RESET_FAILED_UNITS" "/var/tmp/$RESET_FAILED_UNITS"
219+
chmod 755 "/var/tmp/$RESET_FAILED_UNITS"
220+
print_message "Setting Crontab"
221+
cmd="su - $GRID_USER -c \"sudo crontab $SCRIPT_DIR/$SET_CRONTAB\""
222+
eval "$cmd"
223+
if [ $? ]; then
224+
print_message "Sucessfully installed $SET_CRONTAB using crontab"
225+
else
226+
error_exit "Error occurred in crontab setup"
227+
fi
212228

229+
fi
213230
}
214231

215-
216232
#############################################################################################
217233
####################################### Start NTPD ###################################################################
218234
startNTPD()
@@ -324,6 +340,7 @@ fi
324340
print_message "Process id of the program : $TOP_ID"
325341
##### start ntpd #######
326342
startNTPD
343+
resetFailedUnits
327344
pre_grid_deploy_steps
328345
checkHostName
329346
SetupEtcHosts
Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
11
Examples of how to extend the Oracle Database Docker Image
2-
================================
2+
=======================================================
33

4-
# applypatch
4+
applypatch
5+
----------
6+
Example of how to apply a custom patch or Release Update (RU) to the image. You can apply RU or a custom patch on Oracle Grid Infrastructure Home or on Oracle RAC DB Home. For details, please refer to [README.MD of applypatch](./applypatch/README.md).
57

6-
Example of how to apply a custom patch or Release Update (RU) to the image. You can apply RU or custom patch on Oracle Grid Infrastructure Home or on Oracle RAC DB Home. For details, pelase refer [README.MD of applypatch](./applypatch/README.md).
8+
customracdb
9+
-----------
10+
Example of how to create a 2-node RAC based on sample response files provided under customracdb/<version> folder. You can create a multi-node RAC using response files based on your environment. For details, please refer to [README.MD of customracdb](./customracdb/README.md).
711

8-
# customracdb
12+
racdockercompose
13+
----------------
14+
Example of how to create a 2-node RAC based on Docker Compose. You can create a single-node RAC using Docker Compose based on your environment. For details, please refer to [README.MD of racdockercompose](./racdockercompose/README.md).
915

10-
Example of how to create 2 node RAC based on sample responsefiles provided under customracdb/<version> folder. You can create multinode rac using responsefiles based on your environment. For details, pelase refer [README.MD of customracdb](./customracdb/README.md).
16+
racpodmancompose
17+
----------------
18+
Example of how to create a 2-node RAC based on Podman Compose. You can create a single-node RAC using Podman Compose based on your environment. For details, please refer to [README.MD of racpodmancompose](./racpodmancompose/README.md).
1119

12-
# Copyright
13-
14-
Copyright (c) 2014-2019 Oracle and/or its affiliates. All rights reserved.
20+
Copyright
21+
---------
22+
Copyright (c) 2014-2019 Oracle and/or its affiliates. All rights reserved.

0 commit comments

Comments
 (0)