using rpms to “automagically” install oracle · pdf filelearn how secure-24 is...
TRANSCRIPT
USING RPMS TO “AUTOMAGICALLY” INSTALL ORACLE AGENTS TO EM12C
Mike Gangler – Senior Database Specialist / Team LeadSecure-24 - @[email protected]
ABOUT MIKE GANGLER
• Oracle ACE• DBA for over 28 years, working with Oracle since version 4
• Team Lead and Senior Database Specialist at Secure-24• Currently serving on the board of the Southeast Michigan Oracle
Professionals (SEMOP) group• Charter member of the Board of Directors for the International Oracle
Users Group (IOUG) – www.ioug.org
• Follow me on my Blog http://mjgangler.wordpress.com • twitter! @mjgangler
3
ABOUT SECURE-24
4
FOUNDED
HEADQUARTERS
OPERATION CENTERS
DATA CENTERS
Secure-24 was founded in 2001 and
since then has grown to 500+ employees
and has received recognition as one of
Computerworld’s Best Places to Work in IT,
4-years running.
Secure-24 is headquartered in
Southfield, MI Serving customers around the globe,
Secure-24 has two (2) Operation Centers in Michigan, one (1) in
Nevada and one (1) in Hyderabad India.
Secure-24 has three (3) data centers in Michigan,
one (1) in Nevada, plus several global partnerships. We only choose the safest
locations for our data centers.
Secure-24 has 16 years of experience delivering managed IT operations, application hosting and cloud services to enterprises worldwide. We manage SAP, Hyperion, PeopleSoft, JD Edwards, Oracle E-Business Suite and other
mission critical applications across all industries for businesses of every size.
TODAYS DISCUSSION
Learn how Secure-24 is leveraging RPM’s to “automagically” install Oracle Agents to EM12C (Using Puppet). This presentation uses the Linux x86-64 operating system and may not apply to your environment.
Agenda:• Overview• Creating an Oracle Agent for EM12C• Connecting OMS• Puppet Details• Demo • Additional items – Puppet Promoting Databases
5
RPM OVERVIEW
RPM OVERVIEW
• RPM – Uses Tar / Zip type technology to package the software
• Allows for automated installation of new servers to our Monitoring systems
• Uses “Service Now” and database table for new customer information (i.e. type of machine, Customer, etc) – Secure-24 specific
• Future use – Oracle 11G and Oracle 12C RAC software Installation
7
RPM SUPPORTED PLATFORM - (OMS HOST)
#1 – display your supported platforms:[oracle@msp-oempl01 bin]$ emcli get_supported_platforms ç==-----------------------------------------------Version = 12.1.0.5.0Platform = Microsoft Windows x64 (64-bit)
-----------------------------------------------Version = 12.1.0.5.0 Platform = Linux x86-64
-----------------------------------------------Version = 12.1.0.5.0Platform = Linux x86-----------------------------------------------Platforms list displayed successfully.
8
#1Display your supported platforms
RPM CREATING (OMS HOST)
#2 – Generate a RPM for your supported platforms:>> emcli get_agentimage_rpm -destination=/tmp -platform="Linux x86-64" -version="12.1.0.5.0"Platform:Linux x86-64
Destination:/tmp
Exalogic:false
Checking for disk space requirements...
=== Partition Detail ===
Space free : 1 GB
Space required : 1 GB
RPM Creation in progress ...
Check the logs at /u01/app/oracle/oem12c/gc_inst/em/EMGC_OMS1/sysman/emcli/setup/.emcli/get_agentimage_rpm_2016-02-29_23-35-01-PM.log
This operation may take few minutes, please wait ...
….........
•Agent Image copied successfully...
•Creation of RPM started...
•RPM creation successful.
•Agent image to rpm conversion completed successfully
9
#2Generate a RPM
for your supported platforms
RPM CREATING (OMS HOST)
Copy the Agent to target system
#3 - scp oracle-agt-12.1.0.5.0-1.0.x86_64.rpm oracle@target system
10
#3Copy the Agent to
target system.
RPM CREATING TARGET – MANUAL
As RootMake agent directory:>> mkdir /usr/lib/oracle>> chmod oracle:oinstall /usr/lib/oracle
Apply the RPM>> rpm -ivh oracle-agt-12.1.0.5.0-1.0.x86_64.rpmPreparing... ########################################### [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
11
#1
#2
RPM CONNECTING TO OMS
At this point the agent software is installed but not connected to the OMS.
#1 – Modify /usr/lib/oracle/agent/agent.propertiesChangeOMS_HOSTOMS_PORTAGENT_REGISTRATION_PASSWORDAGENT_USERNAMEAGENT_GROUPAGENT_PORTORACLE_HOSTNAMEORAINVLOC
12
RPM CONNECTING TO OMS – PART 2
Example
OMS_HOST=gridcontrol.companyname.comOMS_PORT=4903AGENT_REGISTRATION_PASSWORD=<Password>AGENT_USERNAME=oracleAGENT_GROUP=oinstallAGENT_PORT=3872ORACLE_HOSTNAME=host_nameOraInvLoc=/u01/app/oraInventory
13
RPM CONNECTING TO OMS – PART 3
Run the following to attach the host machine and agent to the OMS
/etc/init.d/oracle-agt RESPONSE_FILE=/usr/lib/oracle/agent/agent.properties
After this completes, you will have a connected agent to the OMS Host
14
RPM - VERIFY AGENTRun the following to verify Agent is running :
oracle@mycc-hyodl01 bin]$ ./emctl status agent
Oracle Enterprise Manager Cloud Control 12c Release 5
Copyright (c) 1996, 2015 Oracle Corporation. All rights reserved.
---------------------------------------------------------------
Agent Version : 12.1.0.5.0
OMS Version : 12.1.0.5.0
Protocol Version : 12.1.0.1.0
Agent Home : /usr/lib/oracle/agent/agent_inst
Agent Log Directory : /usr/lib/oracle/agent/agent_inst/sysman/log
Agent Binaries : /usr/lib/oracle/agent/core/12.1.0.5.0
Agent Process ID : 3360
Parent Process ID : 3279
Agent URL : https://host-name:3872/emd/main/
Local Agent URL in NAT : https://host-name:3872/emd/main/
Repository URL : https://gridcontrol.companyname.net:4903/empbs/upload
Started at : 2016-02-12 19:48:07
Started by user : oracle
Agent is Running and Ready
15
RPM CONNECTING TO OMS – PART 3
•Once the agent is installed, connected and running – Only the Host and agent will show up on the OMS.
•You will have to promote and add any other targets independently
16
RPM CONNECTING TO OMS – PART 3
•Passing a parameter for the agent directory Is not supported at this time.
•Using the RPM method, the agent gets installed under a directory /usr/lib/oracle and this cannot be amended manually at this time.
•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]
17
DEMO OF MANUAL INSTALLATION
19 Secure-24 Confidential – Internal – Copyright © 2015 Secure-24 and/or its affiliates. All rights reserved.
PUPPET OVERVIEW - INFORMATION
PUPPET BENEFITS
•Puppet is an automated program that can perform many operating system commands and operations.
•Puppet gives us the Automatic process that we are trying to achieve.
•We have many machines getting built daily – Puppet allows us to remove manual effort.
21
PUPPET NOTES
•We (DBA)’s provided the prerequisites
•Linux Team created the Oracle Policy for Puppet
•Puppets runs Every hour on all Linux boxes and checks pre-requisites listed next
22
PUPPET - AUTOMATED PROCESS DETAILS
PUPPET PREREQUISITES
•There must not be a Grid control <Machine name> host file entry manually entered into Puppet or it will cause a resource conflict. The “PUPPET_POLICY” module will ensure the correct generation of a host file entry.
•The RPM will do a port check to make sure it can communicate with the OMS.
24
PUPPET PREREQUISITES
• A previously installed agent must NOT be running or present on the system. The module will endeavor to detect the case where an existing agent is installed and running and not proceed. (emwd.pl agent)
• There needs to be a proper /etc/oraInst.loc file to outline where the oraInventory location is. Puppet will check the location of the oraInventory and install the agent as this user.
• Does the Oracle user and oinstall group exist?
25
PUPPET STEPS (HIGH LEVEL)
26
Puppet adds the grid control
name to the machine host file
Checks Host file for current
machine name
Verifies Oracle user an Oinstall
Group
Verifies Port is opened
Copies and runs RPM (sudo as oracle)
Modifies agent.
properties
Runs /etc/init.d/oracle-agt
PUPPET STEPS (HIGH LEVEL) – PART 2
• Puppet will install the RPM and configure the OEM agent to check in to the master.
• The targets will still need to be promoted, but the hosts will show up on the console.
• The agent will be installed in the /usr/lib/oracle directory.
• Puppet will manage the /usr/lib/oracle/agent/agent_inst/sysman/config/emd.propertiesfile to allow us to control all the agents configurations centrally.
27
LESSONS LEARNED
• Puppet can only do 1 OMS version at a time. We had to change our process to only run Puppet on our Production system Linux servers.
• Managing the Host file was critical – many didn't have the correct host machine names, and many were not fully qualified.
• Puppet is mindless. So it will run the Oracle Agent process no matter if you were in the middle of an install (manual or not). It will override any changes you made.
• Still need a process to promote the targets within the agent and host.
29
LESSONS LEARNED
REFERENCES
A huge thanks to the following blogs and websites:
http://www.gokhanatil.com/2012/12/how-to-deploy-oracle-management-agent-using-rpm-file.html
https://martincarstenbach.wordpress.com/2011/11/22/installing-oem-12c-agents-in-rpm-format/
http://gavinsoorma.com/2013/06/installing-the-12c-management-agent-using-the-rpm-method/
http://docs.oracle.com/cd/E25054_01/install.1111/e24089/install_agent_usng_rpm.htm
30