OCM 12c升级考试-使用命令行agentDeploy安装cloud control agent

上一篇写过用图形界面来安装cloud control agent,传送门,那么考试中只有一种手段肯定是不行的,这里我们在研究一下使用命令行来安装cloud control agent

1.在Server端查看OMS的状态。

[oracle@orae12 bin]$ ./emctl status oms -details
Oracle Enterprise Manager Cloud Control 12c Release 4  
Copyright (c) 1996, 2014 Oracle Corporation.  All rights reserved.
Enter Enterprise Manager Root (SYSMAN) Password : 
Console Server Host        : orae12.us.oracle.com
HTTP Console Port          : 7788
HTTPS Console Port         : 7802
HTTP Upload Port           : 4889
HTTPS Upload Port          : 4903
EM Instance Home           : /u01/app/oracle/gc_inst/em/EMGC_OMS1
OMS Log Directory Location : /u01/app/oracle/gc_inst/em/EMGC_OMS1/sysman/log
OMS is not configured with SLB or virtual hostname
Agent Upload is locked.
OMS Console is locked.
Active CA ID: 1
Console URL: https://orae12.us.oracle.com:7802/em
Upload URL: https://orae12.us.oracle.com:4903/empbs/upload

WLS Domain Information
Domain Name            : GCDomain
Admin Server Host      : orae12.us.oracle.com
Admin Server HTTPS Port: 7102
Admin Server is RUNNING

Oracle Management Server Information
Managed Server Instance Name: EMGC_OMS1
Oracle Management Server Instance Host: orae12.us.oracle.com
WebTier is Up
Oracle Management Server is Up

BI Publisher is not configured to run on this host.

2.OMS是正常启动的状态,login进去,执行sync操作

[oracle@orae12 bin]$ ./emcli login -username=sysman -password=Welcome123
Login successful
[oracle@orae12 bin]$ ./emcli sync
Synchronized successfully

3.确认agent可以支持的平台和版本

[oracle@orae12 bin]$ ./emcli get_supported_platforms
-----------------------------------------------
Version = 12.1.0.4.0
 Platform = Linux x86-64
-----------------------------------------------
Platforms list displayed successfully.

4.先通过命令把agent软件生成,然后保存到oms主机上。这里要创建一个空目录存放软件。

[oracle@orae12 bin]$ ./emcli get_agentimage -destination=/home/oracle/agentsoft -platform="Linux x86-64" -version="12.1.0.4.0"
 === Partition Detail ===
Space free : 28 GB
Space required : 1 GB
Check the logs at /u01/app/oracle/gc_inst/em/EMGC_OMS1/sysman/emcli/setup/.emcli/get_agentimage_2018-05-26_20-41-16-PM.log
Downloading /home/oracle/agentsoft/12.1.0.4.0_AgentCore_226.zip
File saved as /home/oracle/agentsoft/12.1.0.4.0_AgentCore_226.zip
Downloading /home/oracle/agentsoft/12.1.0.4.0_PluginsOneoffs_226.zip
File saved as /home/oracle/agentsoft/12.1.0.4.0_PluginsOneoffs_226.zip
Downloading /home/oracle/agentsoft/unzip
File saved as /home/oracle/agentsoft/unzip
Agent Image Download completed successfully.

5.将AgentImage复制到需要安装agent的目标服务器上。在agent目标服务器上解压该文件,然后编辑agent.rsp响应文件。

[oracle@orae12 agentsoft]$ ls -lrt
total 249752
-rw-r--r-- 1 oracle oinstall 255744050 May 26 20:42 12.1.0.4.0_AgentCore_226.zip
[oracle@orae12 agentsoft]$ scp 12.1.0.4.0_AgentCore_226.zip  oracle@host01:/home/oracle
oracle@host01's password: 
12.1.0.4.0_AgentCore_226.zip 
###########agent主机
[oracle@host01 ~]$unzip 12.1.0.4.0_AgentCore_226.zip 
[oracle@host01 ~]$vi agent.rsp 
OMS_HOST=orae12.us.oracle.com
EM_UPLOAD_PORT=4903
AGENT_REGISTRATION_PASSWORD=oracle123
AGENT_PORT=3872
ORACLE_HOSTNAME=host01.us.oracle.com

6.为了能顺利的运行,需要打开OMS服务端,增加一个AGENT_REGISTRATION_PASSWORD和响应文件保持一致。


7.运行命令前,先设置两个环境变量。因为12.1.0.4.0可能会遇到EM 12c Agent Install Failed on OEL / RHEL 6 With “SEVERE: emctl secure agent command has failed” Reported in agentDeploy*.log (Doc ID 1942623.1)这个问题

export MALLOC_CHECK_=0 
export MALLOC_PERTURB_=0

8.在客户端主机上运行agentDeploy.sh脚本进行安装

[oracle@host01 ~]$ ./agentDeploy.sh AGENT_BASE_DIR=/u01/app/oracle/agent12c RESPONSE_FILE=/home/oracle/agent.rsp 
  
Validating the OMS_HOST & EM_UPLOAD_PORT
Executing command : /u01/app/oracle/agent12c/core/12.1.0.4.0/jdk/bin/java -classpath /u01/app/oracle/agent12c/core/12.1.0.4.0/jlib/agentInstaller.jar:/u01/app/oracle/agent12c/core/12.1.0.4.0/oui/jlib/OraInstaller.jar oracle.sysman.agent.installer.AgentInstaller /u01/app/oracle/agent12c/core/12.1.0.4.0 /home/oracle /u01/app/oracle/agent12c -prereq

Validating oms host & port with url: http://orae12.us.oracle.com:4903/empbs/genwallet
Validating oms host & port with url: https://orae12.us.oracle.com:4903/empbs/genwallet
Return status:3-oms https port is passed
Unzipping the agentcoreimage.zip to /u01/app/oracle/agent12c ....
12.1.0.4.0_PluginsOneoffs_226.zip
Executing command : /home/oracle/unzip -o /home/oracle/12.1.0.4.0_PluginsOneoffs_226.zip -d /u01/app/oracle/agent12c
Executing command : /u01/app/oracle/agent12c/core/12.1.0.4.0/jdk/bin/java -classpath /u01/app/oracle/agent12c/core/12.1.0.4.0/oui/jlib/OraInstaller.jar:/u01/app/oracle/agent12c/core/12.1.0.4.0/oui/jlib/xmlparserv2.jar:/u01/app/oracle/agent12c/core/12.1.0.4.0/oui/jlib/srvm.jar:/u01/app/oracle/agent12c/core/12.1.0.4.0/oui/jlib/emCfg.jar:/u01/app/oracle/agent12c/core/12.1.0.4.0/jlib/agentInstaller.jar:/u01/app/oracle/agent12c/core/12.1.0.4.0/oui/jlib/share.jar oracle.sysman.agent.installer.AgentInstaller /u01/app/oracle/agent12c/core/12.1.0.4.0 /home/oracle /u01/app/oracle/agent12c /u01/app/oracle/agent12c/agent_inst AGENT_BASE_DIR=/u01/app/oracle/agent12c


Executing agent install prereqs...
Executing command: /u01/app/oracle/agent12c/core/12.1.0.4.0/oui/bin/runInstaller -debug -ignoreSysPrereqs   -prereqchecker -silent -ignoreSysPrereqs -waitForCompletion  -prereqlogloc /u01/app/oracle/agent12c/core/12.1.0.4.0/cfgtoollogs/agentDeploy -entryPoint oracle.sysman.top.agent_Complete -detailedExitCodes PREREQ_CONFIG_LOCATION=/u01/app/oracle/agent12c/core/12.1.0.4.0/prereqs  -J-DORACLE_HOSTNAME=host01.us.oracle.com -J-DAGENT_PORT=3872 -J-DAGENT_BASE_DIR=/u01/app/oracle/agent12c

Agent install prereqs completed successfully

Cloning the agent home...
Executing command: /u01/app/oracle/agent12c/core/12.1.0.4.0/oui/bin/runInstaller -debug -ignoreSysPrereqs   -clone -forceClone -silent -waitForCompletion -nowait ORACLE_HOME=/u01/app/oracle/agent12c/core/12.1.0.4.0 -responseFile /home/oracle/agent.rsp  AGENT_BASE_DIR=/u01/app/oracle/agent12c AGENT_BASE_DIR=/u01/app/oracle/agent12c RESPONSE_FILE=/home/oracle/agent.rsp -noconfig  ORACLE_HOME_NAME=agent12c1 -force b_noUpgrade=true

Cloning of agent home completed successfully

Attaching sbin home...
Executing command: /u01/app/oracle/agent12c/core/12.1.0.4.0/oui/bin/runInstaller -debug -ignoreSysPrereqs   -attachHome -waitForCompletion -nowait ORACLE_HOME=/u01/app/oracle/agent12c/sbin ORACLE_HOME_NAME=sbin12c1 -force

Attach home for sbin home completed successfully.

Updating home dependencies...
Executing command: /u01/app/oracle/agent12c/core/12.1.0.4.0/oui/bin/runInstaller -debug -ignoreSysPrereqs   -updateHomeDeps -waitForCompletion HOME_DEPENDENCY_LIST={/u01/app/oracle/agent12c/sbin:/u01/app/oracle/agent12c/core/12.1.0.4.0} -invPtrLoc /u01/app/oracle/agent12c/core/12.1.0.4.0/oraInst.loc -force

Update home dependency completed successfully.
Executing command: /u01/app/oracle/agent12c/core/12.1.0.4.0/oui/bin/runConfig.sh ORACLE_HOME=/u01/app/oracle/agent12c/core/12.1.0.4.0 RESPONSE_FILE=/u01/app/oracle/agent12c/core/12.1.0.4.0/agent.rsp ACTION=configure MODE=perform COMPONENT_XML={oracle.sysman.top.agent.11_1_0_1_0.xml} RERUN=true
Agent Configuration completed successfully

The following configuration scripts need to be executed as the "root" user.
#!/bin/sh
#Root script to run
 /u01/app/oracle/agent12c/core/12.1.0.4.0/root.sh
To execute the configuration scripts:
1. Open a terminal window
2. Log in as "root"
3. Run the scripts
Agent Deployment Successful.
Agent deployment log location: /u01/app/oracle/agent12c/core/12.1.0.4.0/cfgtoollogs/agentDeploy/agentDeploy_2018-05-26_23-44-01-PM.log
Agent deployment completed successfully.

9.切换到root,运行root.sh脚本

[oracle@host01 ~]$ su - root
Password: 
[root@host01 ~]# /u01/app/oracle/agent12c/core/12.1.0.4.0/root.sh
Finished product-specific root actions.
/etc exist

Creating /etc/oragchomelist file...

10.再次切换到Oracle,查看agent是否运行正常

[oracle@host01 bin]$ /u01/app/oracle/agent12c/core/12.1.0.4.0/bin/emctl status agent
Oracle Enterprise Manager Cloud Control 12c Release 4  
Copyright (c) 1996, 2014 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
Agent Version          : 12.1.0.4.0
OMS Version            : 12.1.0.4.0
Protocol Version       : 12.1.0.1.0
Agent Home             : /u01/app/oracle/agent12c/agent_inst
Agent Log Directory    : /u01/app/oracle/agent12c/agent_inst/sysman/log
Agent Binaries         : /u01/app/oracle/agent12c/core/12.1.0.4.0
Agent Process ID       : 20506
Parent Process ID      : 20464
Agent URL              : https://host01.us.oracle.com:3872/emd/main/
Local Agent URL in NAT : https://host01.us.oracle.com:3872/emd/main/
Repository URL         : https://orae12.us.oracle.com:4903/empbs/upload
Started at             : 2018-05-26 23:46:12
Started by user        : oracle
Operating System       : Linux version 3.8.13-16.2.1.el6uek.x86_64 (amd64)
Last Reload            : (none)
Last successful upload                       : 2018-05-26 23:47:47
Last attempted upload                        : 2018-05-26 23:47:47
Total Megabytes of XML files uploaded so far : 0.39
Number of XML files pending upload           : 0
Size of XML files pending upload(MB)         : 0
Available disk space on upload filesystem    : 44.18%
Collection Status                            : Collections enabled
Heartbeat Status                             : Ok
Last attempted heartbeat to OMS              : 2018-05-26 23:52:21
Last successful heartbeat to OMS             : 2018-05-26 23:52:21
Next scheduled heartbeat to OMS              : 2018-05-26 23:53:21

至此整个安装过程完毕。agent能够正常的upload数据了。

分享到: 更多

Post a Comment

Your email is never published nor shared. Required fields are marked *