【GC】重新配置Agent以應對 OMS伺服器的變化

secooler發表於2010-07-12
在《【GC】OEL4.8解除安裝重新部署安裝Grid Control OMS》(http://space.itpub.net/519536/viewspace-667808)文中提到,如果GC OMS發生了變化,OMS無法自動發現原有的Agent,需要對Agent做相應的調整才能重新加入到GC OMS的管理列表中。整理了一個簡單的步驟,供參考。

1.確保Agent處於停滯狀態
[oracle@ocmdb1 ~]$ $AGENT_HOME/bin/emctl status agent
Oracle Enterprise Manager 10g Release 10.2.0.1.0.
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
Agent is Not Running

若果仍然是執行狀態,使用“$AGENT_HOME/bin/emctl stop agent”命令停掉Agent。

2.調整emd.properties引數檔案
如果更換了GC OMS需要調整這個引數檔案中的REPOSITORY_URL引數。
[oracle@ocmdb1 ~]$ vi $AGENT_HOME/sysman/config/emd.properties
……
REPOSITORY_URL=
……

REPOSITORY_URL引數可以在GC OMS所在主機中獲得
[oracle@ocmdb2 ~]$ $AGENT_HOME/bin/emctl status agent | grep Repository
Repository URL    :

[oracle@ocmdb2 ~]$ $AGENT_HOME/bin/emctl status agent | grep Repository
Repository URL    :

此處因我是在原OMS伺服器上重新安裝,故該檔案不需要修改。

3.清除Agent原有資訊
[oracle@ocmdb1 ~]$ rm -rf $AGENT_HOME/sysman/emd/state/*
[oracle@ocmdb1 ~]$ rm -rf $AGENT_HOME/sysman/emd/collection/*
[oracle@ocmdb1 ~]$ rm -rf $AGENT_HOME/sysman/emd/upload/*
[oracle@ocmdb1 ~]$ rm -rf $AGENT_HOME/sysman/log/*
[oracle@ocmdb1 ~]$ rm -f $AGENT_HOME/sysman/emd/lastupld.xml
[oracle@ocmdb1 ~]$ rm -f $AGENT_HOME/sysman/emd/agntstmp.txt
[oracle@ocmdb1 ~]$ rm -f $AGENT_HOME/sysman/emd/blackouts.xml
[oracle@ocmdb1 ~]$ rm -f $AGENT_HOME/sysman/emd/protocol.ini
[oracle@ocmdb1 ~]$ $AGENT_HOME/bin/emctl clearstate agent
Oracle Enterprise Manager 10g Release 10.2.0.1.0.
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
EMD clearstate completed successfully

4.使用emctl的secure選項重新配置Agent
[oracle@ocmdb1 ~]$ $AGENT_HOME/bin/emctl secure agent
Oracle Enterprise Manager 10g Release 10.2.0.1.0.
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
Enter Agent Registration password :  --此處需要輸入密碼,我這裡是oracle1
Agent is already stopped...   Done.
Securing agent...   Started.
Requesting an HTTPS Upload URL from the OMS...   Done.
Requesting an Oracle Wallet and Agent Key from the OMS...   Done.
Check if HTTPS Upload URL is accessible from the agent...   Done.
Configuring Agent for HTTPS in CENTRAL_AGENT mode...   Done.
EMD_URL set in /u01/app/oracle/agent/agent10g/sysman/config/emd.properties
Securing agent...   Successful.

5.啟動Agent
[oracle@ocmdb1 ~]$ $AGENT_HOME/bin/emctl start agent
Oracle Enterprise Manager 10g Release 10.2.0.1.0.
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
Starting agent ......... started.

6.使用emctl的upload選項將Agent上傳到OMS
[oracle@ocmdb1 ~]$ $AGENT_HOME/bin/emctl upload
Oracle Enterprise Manager 10g Release 10.2.0.1.0.
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
EMD upload completed successfully

7.最後確認Agent執行情況
[oracle@ocmdb1 ~]$ $AGENT_HOME/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.1.0
Protocol Version  : 10.2.0.0.0
Agent Home        : /u01/app/oracle/agent/agent10g
Agent binaries    : /u01/app/oracle/agent/agent10g
Agent Process ID  : 27716
Parent Process ID : 27701
Agent URL         :
Repository URL    :
Started at        : 2010-07-12 22:19:14
Started by user   : oracle
Last Reload       : 2010-07-12 22:19:14
Last successful upload                       : 2010-07-12 22:19:51
Total Megabytes of XML files uploaded so far :     7.48
Number of XML files pending upload           :        2
Size of XML files pending upload(MB)         :     0.01
Available disk space on upload filesystem    :    87.52%
Last successful heartbeat to OMS             : 2010-07-12 22:19:21
---------------------------------------------------------------
Agent is Running and Ready

此時,回到Grid Control頁面便可以看到對應的Agent已經新增完成。Agent新增任務完成。

8.小結
透過本文加之如下幾篇文章簡單展示了Oracle Grid Control部署安裝方面的知識。建議大家在部署安裝的過程中一定要注意細節,稍有不慎便有可能遇到問題。如果OMS無法自動識別到資料庫的例項資訊,可以考慮在GC頁面中手工新增。
《【GC】安裝GC之前需要調整的幾個引數》(http://space.itpub.net/519536/viewspace-667627)
《【GC】OEL4.8部署安裝 Grid Control OMS》(http://space.itpub.net/519536/viewspace-667751)
《【GC】使用 agentDownload.linux完成Grid Control Agent的快速部署安裝》(http://space.itpub.net/519536/viewspace-667753)
《【GC】OEL4.8解除安裝重新部署安裝Grid Control OMS》(http://space.itpub.net/519536/viewspace-667808)

Good luck.

secooler
10.07.12

-- The End --

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/519536/viewspace-667854/,如需轉載,請註明出處,否則將追究法律責任。

相關文章