Skip to content

Latest commit

 

History

History
148 lines (108 loc) · 7.35 KB

File metadata and controls

148 lines (108 loc) · 7.35 KB

Deploying Oracle Globally Distributed Database Containers using podman-compose

For Oracle Linux 8 host machines,podman-compose can be used for deploying containers to create an Oracle Globally Distributed Database.

For Example: You can use GSM and RDBMS Podman Images with Oracle 21c Enterprise Edition Software and deploy with the sharding option of your choice: System-Managed Sharding or User Defined Sharding.

The example that follows shows how to use podman-compose to create the Podman network and to deploy containers for an Oracle Globally Distributed Database on a single Oracle Linux 8 host.

In this example, we deploy an Oracle Globally Distributed Database with System-Managed Sharding Topology with Four shard containers, a Catalog Container, a Primary GSM container, and a Standby GSM Container.

IMPORTANT: This example uses 21c RDBMS and 21c GSM Podman Images while deploying the Oracle Globally Distributed database.

Install Podman compose

dnf config-manager --enable ol8_developer_EPEL
dnf install podman-compose

Complete the prerequisite steps

Complete each of these steps before proceeding with deployment.

Create Podman Secrets

Complete the procedure to create Podman secrets from Password Management. These Podman secrets are also used during the deployment of Oracle Globally Distributed Database Containers.

Prerequisites script file

Run the script file podman-compose-prerequisites.sh. This script exports the environment variables, creates the network host file, and creates required directories.

NOTE: You must change the values for SIDB_IMAGE and GSM_IMAGE to use the images that you want to use for the deployment.

source podman-compose-prerequisites.sh

SELinux Configuration Management for Podman Host

If SELinux is enabled on your podman-host, then load the necessary shard-podman policy, as explained in SELinux Configuration on Podman Host

To set SELinux contexts for required files and folders, run the file set-file-context.sh

source set-file-context.sh

Create Podman Compose file

Copy the podman-compose.yml into your working directory. In this example, our working directory is [<github_cloned_path>/db-sharding/container-based-sharding-deployment/containerfiles]

Create services using "podman-compose" command

After you have completed all the prerequisties successfully, run the following command to create the services:

# Ensure "podman-compose.yml" file is present in your working directory and then run the following command:
 
podman-compose up -d

Wait for all the services setup to be complete and ready:

podman ps -a
CONTAINER ID  IMAGE                                             COMMAND               CREATED        STATUS        PORTS       NAMES
56fd25ab3476  localhost/oracle/database-ext-sharding:21.3.0-ee  /bin/sh -c exec $...  7 minutes ago  Up 7 minutes              catalog
05e1d72ae93e  localhost/oracle/database-ext-sharding:21.3.0-ee  /bin/sh -c exec $...  7 minutes ago  Up 7 minutes              shard1
7dbd9ce5564b  localhost/oracle/database-ext-sharding:21.3.0-ee  /bin/sh -c exec $...  7 minutes ago  Up 7 minutes              shard2
5e1341e3eeab  localhost/oracle/database-ext-sharding:21.3.0-ee  /bin/sh -c exec $...  7 minutes ago  Up 7 minutes              shard3
dad4f89a8aaa  localhost/oracle/database-ext-sharding:21.3.0-ee  /bin/sh -c exec $...  7 minutes ago  Up 7 minutes              shard4
a265f8438bb7  localhost/oracle/database-gsm:21.3.0              /bin/sh -c exec $...  7 minutes ago  Up 7 minutes              gsm1
f155a7f61830  localhost/oracle/database-gsm:21.3.0              /bin/sh -c exec $...  7 minutes ago  Up 7 minutes              gsm2

Check the logs

# You can monitor the logs for all the containers using the following command:
 
podman-compose logs -f

Look for successful message in all containers. For example:-

podman logs -f catalog
==============================================
         GSM Catalog Setup Completed
==============================================

podman logs -f shard1
==============================================
     GSM Shard Setup Completed                
==============================================

podman logs -f shard2
==============================================
     GSM Shard Setup Completed                
==============================================

podman logs -f shard3
==============================================
     GSM Shard Setup Completed                
==============================================

podman logs -f shard4
==============================================
     GSM Shard Setup Completed                
==============================================

podman logs -f gsm1
==============================================
     GSM Setup Completed                      
==============================================

podman logs -f gsm2
==============================================
     GSM Setup Completed
==============================================

Remove the deployment

If you want to remove the deployment, then run the podman-compose command. To remove the deployment:

  • With the environment variables set in Prerequisites Section, run the following command to remove the Oracle Globally Distributed Database Containers and folders:
podman-compose down
rm -rf ${PODMANVOLLOC}

Oracle 23ai FREE Database and GSM Images

You can also use the Oracle 23ai FREE Database and GSM Images with podman-compose to deploy the Oracle Globally Distributed Database with System-Managed Sharding or with System-Managed Sharding with RAFT replication or with User Defined Sharding.

For Example: If you plan to use Oracle 23ai FREE Database and GSM Images for deploying the Oracle Globally Distributed Database with System-Managed Sharding Topology with Raft replication, then complete these steps:

NOTE: You must change the values for SIDB_IMAGE and GSM_IMAGE to use the Oracle 23ai FREE Images you want to use for the deployment.

  • Take the file podman-compose-free.yml and rename it as podman-compose.yml to deploy the setup using the podman-compose command.

Copyright

Copyright (c) 2022 - 2024 Oracle and/or its affiliates. Released under the Universal Permissive License v1.0 as shown at https://oss.oracle.com/licenses/upl/