Forcing the Oracle Cloud agent on AlmaLinux 9
table of contents
Hello, this is Kitada from Beyond Co., Ltd.
This time I will explain how to install Oracle Cloud Agent on his Alma Linux 9.
*The method described in this article is an installation method that is not officially recommended, so we cannot take any responsibility for it.
Also, please note that the document information, etc. may be different from the situation at the time of article creation (2024/05/01).
background
Beyond is currently training new graduates to build environments on various clouds.
I tried to install Oracle Cloud Agent to monitor an instance created with AlmaLinux 9, the successor to CentOS
No match for argument: oracle-cloud-agent
An error occurred, and looking at the official documentation, it seems that Alma Linux 9 is an unsupported image...
Oracle Cloud Agent: Oracle Cloud Agent is supported on current platform image custom images based on the current platform image Oracle Cloud Agent is installed on the current platform image by default.
If you are using an older platform image, you must manually install the Oracle Cloud Agent Select images with dates after November 15, 2018. (For Ubuntu, it must be after February 28, 2019)
You may be able to successfully manually install Oracle Cloud Agent on other images
〇 Citation: https://docs.oracle.com/ja-jp/iaas/Content/Compute/Tasks/manage-plugins.htm#manage-plugins
As written in the documentation, it is possible that Oracle Cloud Agent can be installed with other images, but as it has not been tested, operation cannot be guaranteed .
Also, if you dig a little further into the official documentation, it says something like
, "To obtain the Oracle Cloud Agent installation files, please contact support." However, this time I really wanted to install it, so I decided to force it.
First of all, what is Oracle Cloud Agent?
Oracle Cloud Agent is a lightweight process that manages plug-ins running on Compute instances in Oracle Cloud Infrastructure (OCI).
Plug-ins collect performance metrics, install OS updates, and perform other instance management tasks.
To use plug-ins on your instances, you the Oracle Cloud Agent software on your instances, enable the plug-ins, and run the respective plug-ins. You may need to perform additional configuration tasks before using certain plug-ins.
Since we want to perform "Monitoring of Compute Instances" this time please check the prerequisites
procedure
1. Add the repository
First, check before installation.
# sudo dnf info oracle-cloud-agent Last metadata expiration check: 0:18:11 ago on Wed May 1 05:36:04 2024. Error: No matching Packages to list
Since there is no repository, No matching Packages to list will be displayed.
The repository information is specified in the files under /etc/yum.repo.d, so we will place the files directly here.
# sudo vi /etc/yum.repos.d/oci-included-ol9.repo
[ol9_oci_included] name=Oracle Linux $releasever OCI Included Packages ($basearch) baseurl=https://yum-phx.oracle.com/repo/OracleLinux/OL9/oci/included/$basearch/ gpgcheck=1 priority=1 enabled =1
The content to be written looks like this.
This base URL refers to an Oracle Linux 9 package.
Also, please change the priority depending on the environment.
As for the GPG key, since it is not a supported distribution, it is not under /etc/pki/rpm-gpg/, so we will import it directly.
# sudo rpm --import https://yum.oracle.com/RPM-GPG-KEY-oracle-ol9
Reference: https://linux.oracle.com/security/gpg/
It is OK if the import is successful.
2. Installing required modules
If the module called librepo, which is required to load the plug-in "osmsplugin", is not present before installing the Agent, the following error will be displayed.
Failed loading plugin "osmsplugin": No module named 'librepo'
So, install the module using the following command.
# sudo dnf install python3-librepo
Failed loading plugin "osmsplugin": No module named 'librepo' Last metadata expiration check: 0:53:43 ago on Wed May 1 07:24:35 2024. Dependencies resolved. ============ ================================================== ================================================== ================================================== ================================================== ========================= Package Architecture Version Repository Size ==================== ================================================== ================================================== ================================================== ================================================== ================= Installing: python3-librepo x86_64 1.14.5-1.el9 baseos 49 k Transaction Summary =============== ================================================== ================================================== ================================================== ================================================== ====================== Install 1 Package Total download size: 49 k Installed size: 183 k Is this ok [y/N]: y Downloading Packages: python3 -librepo-1.14.5-1.el9.x86_64.rpm 1.9 MB/s | 49 kB 00:00 -------------------------- -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- ----------- Total 57 kB/s | 49 kB 00:00 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : python3-librepo-1.14 .5-1.el9.x86_64 1/1 Running scriptlet: python3-librepo-1.14.5-1.el9.x86_64 1/1 Verifying : python3-librepo-1.14.5-1.el9.x86_64 1/1 Installed: python3-librepo-1.14.5-1.el9.x86_64 Complete!
After installing the module, we will install Oracle Cloud Agent.
3. Installing Oracle Cloud Agent
# sudo dnf install oracle-cloud-agent
Last metadata expiration check: 0:02:16 ago on Wed May 1 07:24:35 2024. Dependencies resolved. ========================= ================================================== ================================================== ================================================== ================================================== ============ Package Architecture Version Repository Size ================================= ================================================== ================================================== ================================================== ================================================== ==== Installing: oracle-cloud-agent x86_64 1.40.0-11632.el9 ol9_oci_included 127 M</pre& Transaction Summary ============================ ================================================== ================================================== ================================================== ================================================== ========= Install 1 Package Total download size: 127 M Installed size: 360 M Is this ok [y/N]: y Downloading Packages: oracle-cloud-agent-1.40.0-11632.el9. x86_64.rpm 15 MB/s | 127 MB 00:08 ------------------------------------- -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- Total 15 MB/s | 127 MB 00:08 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Running scriptlet: oracle-cloud-agent-1.40.0-11632.el9.x86_64 1/1 Installing : oracle-cloud-agent-1.40.0-11632.el9.x86_64 1/1 Running scriptlet: oracle-cloud-agent-1.40.0-11632.el9.x86_64 1/1 Changing ownership of agent.yml * files to oracle-cloud-agent:oracle-cloud-agent Changing ownership of /var/log/oracle-cloud-agent/updater.log to oracle-cloud-agent-updater:adm Setting capabilities on bastions plugin 2024/05/ 01 07:53:02 Capability set on filePath: /usr/libexec/oracle-cloud-agent/plugins/bastions = [1 0 0 10 11 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] 2024/ 05/01 07:53:02 Capability set on filePath: 20 = [1 0 0 10 11 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] 2024/05/01 07:53:02 Capability set properly : [1 0 0 10 11 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] Changing ownership of /var/lib/ocarun/db/runcommand.db to ocarun:oracle-cloud-agent post install: starting services Verifying : oracle-cloud-agent-1.40.0-11632.el9.x86_64 1/1 Installed: oracle-cloud-agent-1.40.0-11632.el9.x86_64 Complete!
4. Post-installation confirmation
Once installed, we will check each one.
First, check if the installation is done properly.
# sudo dnf list installed | grep "oracle-cloud-agent"
oracle-cloud-agent.x86_64 1.40.0-11632.el9 @ol9_oci_included
It is OK if it is installed from the placed repository.
Next, confirm that the program has started.
# sudo systemctl status oracle-cloud-agent.service
● oracle-cloud-agent.service - Oracle Cloud Infrastructure agent for management and monitoring Loaded: loaded (/etc/systemd/system/oracle-cloud-agent.service; enabled; preset: disabled) Active: active (running) since Wed 2024-05-01 08:12:01 UTC; 28min ago Docs: https://docs.cloud.oracle.com/iaas/ Main PID: 4071 (agent) Tasks: 25 (limit: 48708) Memory: 38.8M CPU : 1.948s CGroup: /oca.slice/oracle-cloud-agent.service tq4071 /usr/libexec/oracle-cloud-agent/agent tq4081 /usr/libexec/oracle-cloud-agent/plugins/gomon/gomon mq4118 /usr /libexec/oracle-cloud-agent/plugins/oci-wlp/oci-wlp
If it is running, it is running.
Finally, let's check whether the value is obtained from the console.
■ Before installation
■ After installation
It's well worth the price!
The above is how to forcefully install Oracle Cloud Agent on AlmaLinux 9.
However, I think it's only a matter of time before official support comes out, so I'd appreciate it if you could use it as a reference!