Forum Stats

  • 3,750,413 Users
  • 2,250,175 Discussions
  • 7,866,972 Comments

Discussions

Always never discovering managed target with HOST when using "agentDeloy.sh" to deploy the agent?

Quanwen Zhao
Quanwen Zhao Member Posts: 580 Blue Ribbon

Hello every Oracle EM experts and friends 😀,

Anybody else once encoutered the pretty weird issue about *Always never discovering managed target with HOST when using "agentDeloy.sh" to deploy the agent on EMCC 12.5 or 13.5 (latest version)?

Perhap you're wondering why I use the script rather than GUI because my server is MySQL Database (yes, deploying the agent to the mysql user by GUI that isn't any problem on EMCC 12.5 or 13.5).

The following is my entire operation steps.

[[email protected] ~]$ /home/oracle/oracle/product/middleware/oms/bin/emcli login -username=sysman -password=Test123

Login successful

[[email protected] ~]$ /home/oracle/oracle/product/middleware/oms/bin/emcli sync

Synchronized successfully


--列出agent版本

[[email protected] ~]$ /home/oracle/oracle/product/middleware/oms/bin/emcli get_supported_platforms

-----------------------------------------------

Version = 12.1.0.5.0

 Platform = Linux x86-64

-----------------------------------------------

Platforms list displayed successfully.


--获取agent,并且传送到agent服务器

[[email protected] ~]$ /home/oracle/oracle/product/middleware/oms/bin/emcli get_agentimage -destination=/home/oracle/agent -platform="Linux x86-64" -version=12.1.0.5.0

 === Partition Detail ===

Space free : 573 GB

Space required : 1 GB

Check the logs at /home/oracle/.emcli/get_agentimage_2016-09-02_10-10-57-AM.log

Downloading /home/oracle/agent/12.1.0.5.0_AgentCore_226.zip

File saved as /home/oracle/agent/12.1.0.5.0_AgentCore_226.zip

Downloading /home/oracle/agent/12.1.0.5.0_PluginsOneoffs_226.zip

File saved as /home/oracle/agent/12.1.0.5.0_PluginsOneoffs_226.zip

Downloading /home/oracle/agent/unzip

File saved as /home/oracle/agent/unzip

Agent Image Download completed successfully.


[[email protected] agent]$ scp 12.1.0.5.0_AgentCore_226.zip [email protected]:/var/lib/mysql/mysqlagent/

[email protected]'s password: 

12.1.0.5.0_AgentCore_226.zip                    100% 245MB 40.9MB/s  00:06


--agent端解压

[[email protected] mysqlagent]$unzip 12.1.0.5.0_AgentCore_226.zip 

Archive: 12.1.0.5.0_AgentCore_226.zip

 inflating: unzip          

 inflating: agentDeploy.sh      

 inflating: agentimage.properties  

 inflating: agent.rsp        

 extracting: agentcoreimage.zip    

 extracting: 12.1.0.5.0_PluginsOneoffs_226.zip

 

--安装agentd

[[email protected] mysqlagent]$./agentDeploy.sh AGENT_BASE_DIR=/mysqlagent OMS_HOST=emdb.example.com EM_UPLOAD_PORT=3872 AGENT_REGISTRATION_PASSWORD=mysql -forceConfigure

 

Validating the OMS_HOST & EM_UPLOAD_PORT

Executing command : /mysqlagent/core/12.1.0.5.0/jdk/bin/java -classpath /mysqlagent/core/12.1.0.5.0/jlib/agentInstaller.jar:/mysqlagent/core/12.1.0.5.0/oui/jlib/OraInstaller.jar oracle.sysman.agent.installer.AgentInstaller /mysqlagent/core/12.1.0.5.0 /var/lib/mysql/mysqlagent /mysqlagent AGENT_BASE_DIR=/mysqlagent OMS_HOST=emdb.example.com EM_UPLOAD_PORT=3872 AGENT_REGISTRATION_PASSWORD=mysql -forceConfigure -prereq


正在使用 url 验证 oms 主机和端口: http://emdb.example.com:3872/empbs/genwallet

正在使用 url 验证 oms 主机和端口: https://emdb.example.com:3872/empbs/genwallet

Return status:1-oms port passed is not valid

警告: 在 OMS 不可用的情况下强制配置代理时, 会将代理配置为使用 HTTP (非安全) 通信。要在代理和 OMS 之间正确建立安全 HTTPS 通信, 您必须在 OMS 可用后保护代理。

Unzipping the agentcoreimage.zip to /mysqlagent ....

12.1.0.5.0_PluginsOneoffs_226.zip

Executing command : /var/lib/mysql/mysqlagent/unzip -o /var/lib/mysql/mysqlagent/12.1.0.5.0_PluginsOneoffs_226.zip -d /mysqlagent

Successfully unzipped /var/lib/mysql/mysqlagent/12.1.0.5.0_PluginsOneoffs_226.zip to /mysqlagent !

Executing command : /mysqlagent/core/12.1.0.5.0/jdk/bin/java -classpath /mysqlagent/core/12.1.0.5.0/oui/jlib/OraInstaller.jar:/mysqlagent/core/12.1.0.5.0/oui/jlib/xmlparserv2.jar:/mysqlagent/core/12.1.0.5.0/oui/jlib/srvm.jar:/mysqlagent/core/12.1.0.5.0/oui/jlib/emCfg.jar:/mysqlagent/core/12.1.0.5.0/jlib/agentInstaller.jar:/mysqlagent/core/12.1.0.5.0/oui/jlib/share.jar oracle.sysman.agent.installer.AgentInstaller /mysqlagent/core/12.1.0.5.0 /var/lib/mysql/mysqlagent /mysqlagent /mysqlagent/agent_inst AGENT_BASE_DIR=/mysqlagent



正在执行代理安装先决条件...

正在执行命令: /mysqlagent/core/12.1.0.5.0/oui/bin/runInstaller -debug -ignoreSysPrereqs  -prereqchecker -silent -ignoreSysPrereqs -waitForCompletion -prereqlogloc /mysqlagent/core/12.1.0.5.0/cfgtoollogs/agentDeploy -entryPoint oracle.sysman.top.agent_Complete -detailedExitCodes PREREQ_CONFIG_LOCATION=/mysqlagent/core/12.1.0.5.0/prereqs -J-DAGENT_BASE_DIR=/mysqlagent

代理安装先决条件已成功完成


正在克隆代理主目录...

正在执行命令: /mysqlagent/core/12.1.0.5.0/oui/bin/runInstaller -debug -ignoreSysPrereqs  -clone -forceClone -silent -waitForCompletion -nowait ORACLE_HOME=/mysqlagent/core/12.1.0.5.0  AGENT_BASE_DIR=/mysqlagent AGENT_BASE_DIR=/mysqlagent OMS_HOST=emdb.example.com EM_UPLOAD_PORT=3872 AGENT_REGISTRATION_PASSWORD=mysql -noconfig ORACLE_HOME_NAME=agent12c2 -force b_forceConfigure=true b_noUpgrade=true AGENT_PORT=-1 EMCTLCFG_MODE=NONE

代理主目录克隆已成功完成


正在附加 sbin 主目录...

正在执行命令: /mysqlagent/core/12.1.0.5.0/oui/bin/runInstaller -debug -ignoreSysPrereqs  -attachHome -waitForCompletion -nowait ORACLE_HOME=/mysqlagent/sbin ORACLE_HOME_NAME=sbin12c2 -force

附加 sbin 主目录的主目录已成功完成。


Updating home dependencies...

正在执行命令: /mysqlagent/core/12.1.0.5.0/oui/bin/runInstaller -debug -ignoreSysPrereqs  -updateHomeDeps -waitForCompletion HOME_DEPENDENCY_LIST={/mysqlagent/sbin:/mysqlagent/core/12.1.0.5.0} -invPtrLoc /mysqlagent/core/12.1.0.5.0/oraInst.loc -force

更新主目录相关性已成功完成。

正在执行命令: /mysqlagent/core/12.1.0.5.0/oui/bin/runConfig.sh ORACLE_HOME=/mysqlagent/core/12.1.0.5.0 RESPONSE_FILE=/mysqlagent/core/12.1.0.5.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


以下配置脚本需要以 "root" 用户身份执行。

#!/bin/sh

#要运行的 Root 脚本

 /mysqlagent/core/12.1.0.5.0/root.sh

/var/lib/mysql/oraInventory/orainstRoot.sh

要执行配置脚本, 请执行以下操作:

1. 打开一个终端窗口

2. 以 "root" 身份登录

3. 运行脚本

代理部署成功。

Agent deployment log location: /mysqlagent/core/12.1.0.5.0/cfgtoollogs/agentDeploy/agentDeploy_2016-09-02_10-49-06-AM.log

Agent deployment completed successfully.


--重新打开一个窗口,以root用户执行上面提示的2个sh脚本

[[email protected] ~]# /mysqlagent/core/12.1.0.5.0/root.sh

Finished product-specific root actions.

/etc exist


Creating /etc/oragchomelist file...


[[email protected] ~]# /var/lib/mysql/oraInventory/orainstRoot.sh

更改权限/var/lib/mysql/oraInventory

添加组的读取和写入权限,删除全局的读取, 写入和执行权限.

更改组名/var/lib/mysql/oraInventory 到 mysql.

脚本的执行已完成


[[email protected] ~]$ emctl status agent

/mysqlagent/core/12.1.0.5.0/bin/emctl: line 450: ulimit: open files: cannot modify limit: 不允许的操作

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      : (unknown)

Protocol Version    : 12.1.0.1.0

Agent Home       : /mysqlagent/agent_inst

Agent Log Directory  : /mysqlagent/agent_inst/sysman/log

Agent Binaries     : /mysqlagent/core/12.1.0.5.0

Agent Process ID    : 13952

Parent Process ID   : 13851

Agent URL              : http://testdb.example.com:3872/emd/main/

Local Agent URL in NAT : http://testdb.example.com:3872/emd/main/

Repository URL         : https://emdb.example.com:3872/empbs/upload/

Started at       : 2021-09-10 22:02:37

Started by user    : mysql

Operating System    : Linux version 2.6.18-164.el5 (amd64)

Last Reload      : (none)

Last successful upload            : (none)

Last attempted upload            : (none)

Total Megabytes of XML files uploaded so far : 0

Number of XML files pending upload      : 1

Size of XML files pending upload(MB)     : 0

Available disk space on upload filesystem  : 86.84%

Collection Status              : Collections enabled

Heartbeat Status               : OMS is unreachable

Last attempted heartbeat to OMS       : 2021-09-10 22:02:50

Last successful heartbeat to OMS       : (none)

Next scheduled heartbeat to OMS       : 2021-09-10 22:03:20


---------------------------------------------------------------

Agent is Running and Ready


As you can see from the "emctl status agent" with the highlighting bold font, why?


But the another issue when on EMCC 13.5, the last step with "agentDeploy.sh ......" reported the problem as below.

......

** Agent Port Check completed successfully.**

Validated the agent port :- ----3872

shared agent value is :false

chain install is :false

Agent Configuration completed successfully

The following configuration scripts need to be executed as the "root" user. Root script to run : /mysqlagent/agent/agent_13.5.0.0.0/root.sh

/mysqlagent/agent/agent_13.5.0.0.0/cfgtoollogs/agentDeploy/agentDeploy_2021-09-11_15-05-18-PM.log

Waiting for agent targets to get promoted...

Waiting for agent targets to get promoted...

Waiting for agent targets to get promoted...

Waiting for agent targets to get promoted...

Waiting for agent targets to get promoted...

Waiting for agent targets to get promoted...

Waiting for agent targets to get promoted...

Promoting agent and its related targets to Management Service failed probably due to target type meta version present on the agent is not present on the OMS.Make sure that the plug-in version deployed on agents is the same as that of the version on the OMS. Also, the agent should be on the same bundle patch version as that of the OMS.For more details, check <AGENT_INST>/sysman/log/gcagent.log on agent and emoms_pbs.log on the OMS.

Fix the cause of the error and retry the operation (or) manually run the following commands on the remote host

/mysqlagent/agent/agent_inst/bin/emctl start agent

/mysqlagent/agent/agent_inst/bin/emctl config agent addinternaltargets



[[email protected] bin]$ ./emctl status agent

Oracle Enterprise Manager Cloud Control 13c Release 5  

Copyright (c) 1996, 2021 Oracle Corporation. All rights reserved.

---------------------------------------------------------------

Agent Version     : 13.5.0.0.0

OMS Version      : (unknown)

Protocol Version    : 12.1.0.1.0

Agent Home       : /mysqlagent/agent/agent_inst

Agent Log Directory  : /mysqlagent/agent/agent_inst/sysman/log

Agent Binaries     : /mysqlagent/agent/agent_13.5.0.0.0

Core JAR Location   : /mysqlagent/agent/agent_13.5.0.0.0/jlib

Agent Process ID    : 3375

Parent Process ID   : 3332

Agent URL              : https://testdb.example.com:3872/emd/main/

Local Agent URL in NAT : https://testdb.example.com:3872/emd/main/

Repository URL         : https://example:4903/empbs/upload

Started at       : 2021-09-11 15:48:08

Started by user    : mysql

Operating System    : Linux version 3.10.0-957.el7.x86_64 (amd64)

Number of Targets   : 3

Last Reload      : (none)

Last successful upload            : (none)

Last attempted upload            : (none)

Total Megabytes of XML files uploaded so far : 0

Number of XML files pending upload      : 1

Size of XML files pending upload(MB)     : 0

Available disk space on upload filesystem  : 86.84%

Collection Status              : Collections enabled

Heartbeat Status               : OMS is unreachable

Last attempted heartbeat to OMS       : 2021-09-11 15:49:14

Last successful heartbeat to OMS       : (none)

Next scheduled heartbeat to OMS       : 2021-09-11 15:50:14


---------------------------------------------------------------

Agent is Running and Ready

Could you help me? Thanks beforehand! 😉


Best Regards

Quanwen Zhao

Tagged: