Oracle EM 13c Agent for Oracle 19c Databases Running in Docker
Recently I had the task of adding two Oracle 19c (19.10) databases running in Docker containers on one server to an on-premise Oracle Enterprise Manager 13c(OEM) Cloud management infrastructure. It was quite a challenge because I did not find any documentation pertaining to this topic. I am writing this article for my own sake for the future.
I achieved this goal by deploying the OEM agent into a folder on the host outside of the Docker file system and then mounting that folder in the Docker container.
The picture below depicts the technical architecture of my setup.
The diagram displays the following components.
oem13chost - It is an Oracle Linux server.
Oracle OEM 13c Server - It is an OEM 13c installation
compassion.hqsft.com (10.10.0.100) - It is an Oracle Linux Server
ganga.hqsft.com (10.10.0.101) - It is an Oracle 19.10 database running in a Docker container. The Oracle SERVICE_NAME and ORACLE_SID for the database are GANGA.
yamuna.hqsft.com (10.10.0.102) - It is an Oracle 19.10 database running in a Docker container. The Oracle SERVICE_NAME and ORACLE_SID for the database are YAMUNA.
I recommend that you read my article on creating an Oracle 19c database in Docker before continuing with this article. Here is the link to my article https://ravi-verma-48164.medium.com/starting-oracle-19-9-0-0-docker-container-2e5dd325a644.
The task of adding the two databases to be managed by OEM 13c requires the following steps.
- Create the DNS entries for the two Docker containers
- Set up the database scripts for the two databases
- Deploy OEM 13c Agent for each database
- Start OEM 13c Agents in the containers
- Test the Agent to OEM server
- Add local targets
1 Create the DNS entries for the two Docker containers
ganga.hqsft.com 10.10.0.101
yamuna.hqsft.com 10.10.0.102
If you can't get the DNS entries for the two Docker containers, you will not be able to add them to OEM 13c.
2. Set up the database scripts for the two databases
Please note that the database containers should be not running at this time.
A. GANGA
Please note the three important directives. The directive "--hostname ganga.hqsft.com" is crucial as the OEM Agent would not start in the container if the hostname is not set to the DNS entry. The directive "-p 10.10.0.101:3872:3872" forwards the port OEM Agent listener port 3872 to the Docker internal port 3872. The directive "-v /opt/emc13c/ganga:/opt/emc13c/ganga" mounts the host directory /opt/emc13c/ganga to the directory /opt/emc13c/ganga by the same name. It is critical that the two folders have identical names.
docker run -d --network=ganga --name ganga --hostname ganga.hqsft.com --user oracle --ip 10.250.1.10 \ -p 10.10.0.101:1521:1521 -p 10.10.0.101:5500:5500 -p 10.10.0.101:2484:2484 \ -p 10.10.0.101:3872:3872 \ -e ORACLE_SID=GANGA \ -e ORACLE_PDB=GANGAPDB \ -e TZ=America/Los_Angeles \ -v /oradrive/oradata/GANGA/admin:/opt/oracle/admin \ -v /oradrive/oradata/GANGA/diag:/opt/oracle/diag \ -v /oradrive/oradata/GANGA/network/admin:/opt/oracle/product/19c/dbhome_1/network/admin \ -v /oradrive/oradata/GANGA/dbs:/opt/oracle/product/19c/dbhome_1/dbs \ -v /oradrive/oradata/GANGA/wallet:/opt/oracle/wallet \ -v /oradrive/fast_recovery_area:/opt/oracle/fast_recovery_area \ -v /opt/emc13c/ganga:/opt/emc13c/ganga \ -v /oradrive/rman:/opt/oracle/rman \ -v /oradrive/oradata:/opt/oracle/oradata \ oracle/database:19.3.0-ee
B. YAMUNA
Please note the three important directives. The directive "--hostname yamuna.hqsft.com" is crucial as the OEM Agent would not start in the container if the hostname is not set to the DNS entry. The directive "-p 10.10.0.102:3874:3874" forwards the port OEM Agent listener port 3874 to the Docker internal port 3874. The directive "-v /opt/emc13c/yamuna:/opt/emc13c/yamuna" mounts the host directory /opt/emc13c/yamuna to the directory /opt/emc13c/yamuna by the same name. It is critical that the two folders have identical names.
docker run -d --network=yamuna --name yamuna --hostname yamuna.hqsft.com --user oracle --ip 10.250.3.10 \ -p 10.10.0.102:1521:1521 -p 10.10.0.102:5500:5500 -p 10.10.0.102:2484:2484 \ -p 10.10.0.102:3874:3874 \ -e ORACLE_SID=YAMUNA \ -e ORACLE_PDB=YAMUNAPDB \ -e TZ=America/Los_Angeles \ -v /oradrive/oradata/YAMUNA/admin:/opt/oracle/admin \ -v /oradrive/oradata/YAMUNA/diag:/opt/oracle/diag \ -v /oradrive/oradata/YAMUNA/network/admin:/opt/oracle/product/19c/dbhome_1/network/admin \ -v /oradrive/oradata/YAMUNA/dbs:/opt/oracle/product/19c/dbhome_1/dbs \ -v /oradrive/oradata/YAMUNA/wallet:/opt/oracle/wallet \ -v /oradrive/fast_recovery_area:/opt/oracle/fast_recovery_area \ -v /opt/emc13c/yamuna:/opt/emc13c/yamuna \ -v /oradrive/rman:/opt/oracle/rman \ -v /oradrive/oradata:/opt/oracle/oradata \ oracle/database:19.3.0-ee
3. Deploy OEM 13c Agent for each database
In this step, we will deploy the OEM Agent for the two databases. We will need the following information.
*Make sure to have the Linux package gcc installed on the target server. Otherwise, the agent would not install.*
- DNS Entry ganga.hqsft.com and yamuna.hqsft.com
- The destination directory for the two OEM Agents /opt/emc13c/ganga and /opt/emc13c/yamuna
- The ports for the two OEM Agents: 3872 for ganga.hqsft.com and 3874 for yamuna.hqsft.com
4. Start OEM 13c Agents in the containers
A. After the successful deployment of the two Agents, you will find that there are two OEM Agents are running. Please stop them.
/opt/emc13c/ganga/agent_13.4.0.0.0/bin/emctl stop agent /opt/emc13c/yamuna/agent_13.4.0.0.0/bin/emctl stop agent
B. Start the Database Containers using the scripts I have shared above
[oracle@compassion]$ docker exec -it ganga bash [oracle@ganga /] /opt/emc13c/yamuna/agent_13.4.0.0.0/bin/emctl start agent [oracle@compassion]$ docker exec -it yamuna bash [oracle@ganga /] /opt/emc13c/yamuna/agent_13.4.0.0.0/bin/emctl start agent
C. If all went well, you will be able to check the status of the OEM agent from within the Docker container and get the following results
[oracle@compassion /]$ /opt/oem13c/ganga/agent_13.4.0.0.0/bin/emctl status agent Oracle Enterprise Manager Cloud Control 13c Release 4 Copyright (c) 1996, 2020 Oracle Corporation. All rights reserved. --------------------------------------------------------------- Agent Version : 13.4.0.0.0 OMS Version : 13.4.0.0.0 Protocol Version : 12.1.0.1.0 Agent Home : /opt/oem13c/ganga/agent/agent_inst Agent Log Directory : /opt/oem13c/ganga/agent_inst/sysman/log Agent Binaries : /opt/oem13c/ganga/agent_13.4.0.0.0 Core JAR Location : /opt/oem13c/ganga/agent_13.4.0.0.0/jlib Agent Process ID : 64414 Parent Process ID : 64363 Agent URL : https://compassion.hqsft.com:3872/emd/main/ Local Agent URL in NAT : https://compassion.hqsft.com:3872/emd/main/ Repository URL : https://oem13c.hqsft.com:4903/empbs/upload Started at : 2021-04-23 16:58:19 Started by user : oracle Operating System : Linux version 5.4.17-2102.200.13.el8uek.x86_64 (amd64) Number of Targets : 5 Last Reload : (none) Last successful upload : 2021-04-24 16:10:23 Last attempted upload : 2021-04-24 16:10:23 Total Megabytes of XML files uploaded so far : 0.65 Number of XML files pending upload : 0 Size of XML files pending upload(MB) : 0 Available disk space on upload filesystem : 75.57% Collection Status : Collections enabled Heartbeat Status : Ok Last attempted heartbeat to OMS : 2021-04-24 16:10:12 Last successful heartbeat to OMS : 2021-04-24 16:10:12 Next scheduled heartbeat to OMS : 2021-04-24 16:11:12 --------------------------------------------------------------- Agent is Running and Ready
6. Add local targets
./agent_13.4.0.0.0/bin/emctl config agent addInternalTargets
7. Check the targets
./agent_13.4.0.0.0/bin/emctl config agent listtargets
Good luck to all of you. I look forward to your feedback.
Tidak ada komentar:
Posting Komentar