In one of my earlier posts I had described the 12c agent silent method installation
This note explains another silent procedure used to install a 12c management agent but this time using a .rpm file.
Currently the Agent RPM is only available on Linux 32-bit and 64-bit platforms.
At a high level these are the steps involved:
- Download the .rpm file on the OMS host server using EMCLI
- Copy the .rpm file from the OMS host to the destination host where we want to install the agent.
- Install the .rpm file.
It should be noted that using the RPM method, the agent gets installed under a directory /usr/lib/oracle and this cannot be amended manually at this time.
It is documented in the MOS note:
EM 12c: Enterprise Manager 12.1.0.2 Cloud Control Agent Deployment with the RPM Method Does not Allow Passing a Custom Agent Base Directory Location [ID 1531693.1]
Installation Procedure
On the OMS host login to the EMCLI client.
After logging in, synchronize the EMCLI and check the platforms for which we currently have the agent software available in our Software Library.
[oracle@kens-oem-prod bin]$ ./emcli login -username=sysman Enter password : Login successful [oracle@kens-oem-prod bin]$ ./emcli sync Synchronized successfully [oracle@kens-oem-prod bin]$ ./emcli get_supported_platforms Getting list of platforms ... Check the logs at /u01/app/Middleware/gc_inst/em/EMGC_OMS1/sysman/emcli/setup/.emcli/agent.log About to access self-update code path to retrieve the platforms list.. Getting Platforms list ... ----------------------------------------------- Version = 12.1.0.2.0 Platform = Linux x86-64 ----------------------------------------------- Version = 12.1.0.2.0 Platform = Microsoft Windows x64 (64-bit) ----------------------------------------------- Platforms list displayed successfully.
Download the .rpm file from the Software Library to a temporary location on the OMS host.
Note – we had to create the directory /usr/lib/oracle on the OMS host as well otherwise the get_agentimage_rpm command failed and this was the error which was logged:
“Directory /usr/lib/oracle doesnt exist. Please create the directory with write permissions and then retry the emcli command.”
[oracle@kens-oem-prod bin]$ ./emcli get_agentimage_rpm -destination=/u01/stage -platform="Linux x86-64" -version="12.1.0.2.0" Platform:Linux x86-64 Destination:/u01/stage Exalogic:false Checking for disk space requirements... === Partition Detail === Space free : 9 GB Space required : 1 GB RPM creation in progress ... Check the logs at /u01/app/Middleware/gc_inst/em/EMGC_OMS1/sysman/emcli/setup/.emcli/get_agentimage_rpm_2013-06-19_09-53-32-AM.log Copying agent image from software library to /u01/stage Setting property ORACLE_HOME to:/u01/app/Middleware/oms calling pulloneoffs with arguments:/u01/app/Middleware/oms/u01/app/Middleware/oms/sysman/agent/12.1.0.2.0_AgentCore_226.zip12.1.0.2.0Linux x86-64/u01/stagetrue Agent Image copied successfully... Creation of RPM started... Agent image to rpm conversion failed
After creating the directory on the OMS host, we ran the command again and it still failed. This time with a different error message.
“RPM creation failed…
/u01/app/Middleware/oms/install/rpm/rpm.sh: line 61: rpmbuild: command not found”
So we need to install the rpmbuild package as it was not present on our OMS host.
We installed it using the yum command ‘yum install rpm-build‘
Confirmed the package was now present.
[root@kens-oem-prod bin]# which rpmbuild
/usr/bin/rpmbuild
Now the command ran fine and the .rpm file was successfully created.
[oracle@kens-oem-prod bin]$ ./emcli get_agentimage_rpm -destination=/u01/stage -platform="Linux x86-64" -version="12.1.0.2.0" Platform:Linux x86-64 Destination:/u01/stage Exalogic:false Checking for disk space requirements... === Partition Detail === Space free : 9 GB Space required : 1 GB RPM creation in progress ... Check the logs at /u01/app/Middleware/gc_inst/em/EMGC_OMS1/sysman/emcli/setup/.emcli/get_agentimage_rpm_2013-06-19_10-08-55-AM.log Copying agent image from software library to /u01/stage Setting property ORACLE_HOME to:/u01/app/Middleware/oms calling pulloneoffs with arguments:/u01/app/Middleware/oms/u01/app/Middleware/oms/sysman/agent/12.1.0.2.0_AgentCore_226.zip12.1.0.2.0Linux x86-64/u01/stagetrue Agent Image copied successfully... Creation of RPM started... RPM creation successful. Agent image to rpm conversion completed successfully
[oracle@kens-oem-prod bin]$ cd /u01/stage
[oracle@kens-oem-prod stage]$ ls -lrt
total 480384
-rw-r----- 1 oracle oinstall 255521471 May 8 11:34 12.1.0.2.0_AgentCore_233.zip
-rw-r----- 1 oracle oinstall 235885551 Jun 19 10:13 oracle-agt-12.1.0.2.0-1.0.x86_64.rpm
Next copy the .rpm file to the target server where we wish to install the 12c agent.
On the target host, as root, install the .rpm file. Create the directory /usr/lib/oracle as well and give permissions.
[root@kens-orawebl-001-dev ~]# mkdir /usr/lib/oracle [root@kens-orawebl-001-dev ~]# chown oracle:dba /usr/lib/oracle [root@kens-orawebl-001-dev stage]# rpm -ivh oracle-agt-12.1.0.2.0-1.0.x86_64.rpm Preparing... ########################################### [100%] Running the prereq 1:oracle-agt ########################################### [100%] Agent RPM installation is completed successfully. Now to configure the agent follow the below steps: 1. Edit the properties file: /usr/lib/oracle/agent/agent.properties with the correct values 2. Execute the script /etc/init.d/oracle-agt RESPONSE_FILE=/usr/lib/oracle/agent/agent.properties
Edit the agent.properties file and add the following values as shown in this example.
[root@kens-orawebl-001-dev stage]# vi /usr/lib/oracle/agent/agent.properties #------------------------------------------------------------------------------- #OMS_HOST: OMS host info required to connect to OMS #OMS_PORT: OMS port info required to connect to OMS #AGENT_REGISTRATION_PASSWORD: Agent Registration Password needed to # establish a secure connection to the OMS. #------------------------------------------------------------------------------- OMS_HOST="kens-oem-prod.domain" OMS_PORT="4909" AGENT_REGISTRATION_PASSWORD='password" #------------------------------------------------------------------------------- #AGENT_USERNAME: User name with which the agent should be installed. #AGENT_GROUP: Group to which the agent user belogs. #AGENT_PORT: Port in which the agent process will come up. #------------------------------------------------------------------------------- AGENT_USERNAME="oracle" AGENT_GROUP="dba" AGENT_PORT='3876" #------------------------------------------------------------------------------- #ORACLE_HOSTNAME: Virtual hostname where the agent is deployed. #Example: ORACLE_HOSTNAME=hostname.domain #------------------------------------------------------------------------------- ORACLE_HOSTNAME="kens-orawebl-001-dev.corporateict.domain"
Run the following command (as root) to complete the agent installation
[root@kens-orawebl-001-dev oracle]# /etc/init.d/oracle-agt RESPONSE_FILE=/usr/lib/oracle/agent/agent.properties Response File:/usr/lib/oracle/agent/agent.properties