使用oracle10g GridControl在部署agent时候可以采用下载的方式迅速安装。 将“种子”文件从OMS主机上scp到所有需要部署安装的服务器上,然后在服务器执行该种子文件下载agent软件并安装。
1. 在OMS上查找种子文件
$ sudo find /u01/app/oracle -name agentDownload.linux
/u01/app/oracle/product/11.1.0/oms10g/sysman/agent_download/10.2.0.5.0/linux/agentDownload.linux
2. 复制种子文件到需要部署agent的服务器enmoedu1的/home/oracle目录下
$ scp /u01/app/oracle/product/11.1.0/oms10g/sysman/agent_download/10.2.0.1.0/linux/agentDownload.linux enmoedu1:~
3. 在enmoedu1上为该种子文件赋予执行权限
$ chmod +x agentDownload
4. 现在并安装agent
enmoedu1*PROD1 ~ $ ./agentDownload.linux -b /home/oracle -m enmoedu2 -r 4889
..参数-b: 为agent选择安装目录
..参数-r:OMS的端口默认4889
..参数-m:OMS的域名
.....需要输入密码的话请注意,这里需要OMS端sysman的密码
.....省略部分输出
End of install phases.(Monday, April 27, 2015 9:32:07 AM EDT)
WARNING:
The following configuration scripts need to be executed as the "root" user.
#!/bin/sh
#Root script to run
/home/oracle/agent10g/root.sh
To execute the configuration scripts:
1. Open a terminal window
2. Log in as "root"
3. Run the scripts
Starting to execute configuration assistants
使用root用户执行安装结束后所需的脚本呢
$ su -
Password:
[root@enmoedu1 ~]# /home/oracle/agent10g/root.sh
5. 查看agent状态,其中注意AgentURL中的端口后3872,这是我们卸载时需要的信息。
enmoedu1*PROD1 ~ $ /home/oracle/agent10g/bin/emctl status agent
Oracle Enterprise Manager 10g Release 10.2.0.1.0.
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
---------------------------------------------------------------
Agent Version : 10.2.0.1.0
OMS Version : 10.2.0.5.0
Protocol Version : 10.2.0.0.0
Agent Home : /home/oracle/agent10g
Agent binaries : /home/oracle/agent10g
Agent Process ID : 23122
Parent Process ID : 23098
Started at : 2015-04-27 09:32:38
Started by user : oracle
Last Reload : 2015-04-27 09:32:38
Last successful upload : 2015-04-27 09:34:23
Total Megabytes of XML files uploaded so far : 5.61
Number of XML files pending upload : 0
Size of XML files pending upload(MB) : 0.00
Available disk space on upload filesystem : 52.62%
Last successful heartbeat to OMS : 2015-04-27 09:33:40
---------------------------------------------------------------
Agent is Running and Ready
此时agent已经安装成功并处于运行状态。在GC中可以检测到新添加的agent节点
如果期间密码输入错误,安装完成后在GC的监控端看不到该主机的信息。可以使用下面的方法来重新输入正确的密码
1. secure
$ /home/oracle/agent10g/bin/emctl secure agent
Enter Agent Registration password : <==输入正确的密码
2. upload
$ /home/oracle/agent10g/bin/emctl upload agent
安装步骤到此结束,下面开始卸载agent
1. 停止agent
$ ./emctl stop agent
2. 删除agent软件
$ rm -rf /home/oracle/agent10g/
3. 清除inventory中红色字体的agent信息
$ vi /u01/app/oraInventory/ContentsXML/inventory.xml
10.2.0.5.0
2.1.0.6.0
4. 清理OMS资料库中的注册信息,其中3872为./emctl status agent中Agent URL的信息
SQL> exec mgmt_admin.cleanup_agent('enmoedu1.us.oracle.com:3872');
PL/SQL procedure successfully completed.
如果前面的agent安装没有成功,调用该功能会报错。
全文完