Thursday, 9 February 2017

How to change EM Agent Port ?

EM Agent uses a specific port to receive requests. This port is defined during installation. We faced an issue while installing OID and ODS, both have EMAGENT component:

Processes in Instance: oid1
---------------------------------+--------------------+---------+----------+------------+----------+-----------+------
ias-component                    | process-type       |     pid | status   |        uid |  memused |    uptime | ports
---------------------------------+--------------------+---------+----------+------------+----------+-----------+------
oid1                             | oidldapd           |   31821 | Alive    | 1389237283 |  1472620 |  21:24:59 | N/A
oid1                             | oidldapd           |   31790 | Alive    | 1389237282 |   415084 |  21:25:00 | N/A
oid1                             | oidmon             |   31754 | Alive    | 1389237281 |   559676 |  21:25:00 | LDAPS:4040,LDAP:4041
EMAGENT                          | EMAGENT            |   31755 | Alive    | 1389237280 |   106148 |  21:25:00 | N/A



Processes in Instance: ods1
---------------------------------+--------------------+---------+----------+------------+----------+-----------+------
ias-component                    | process-type       |     pid | status   |        uid |  memused |    uptime | ports
---------------------------------+--------------------+---------+----------+------------+----------+-----------+------
EMAGENT                          | EMAGENT            |   30455 | Down    |  436375769 |   106148 |   | N/A


If by mistake you give same port to EMAGENT during installation of OID and ODS then it will give you an exception of "Address already in use or bind exception" while starting the component. EMAGENT can be seen as down in one of the instance.

Solution

You have to change EMAGENT port for one of the component.

Steps

1. Stop the EMAgent.
$ $AGENT_HOME/bin/emctl stop agent

In our case $AGENT_HOME=/home/ajNode1/instances/ods1/EMAGENT/EMAGENT

2. Modify the $AGENT_HOME/sysman/config/emd.properties file in the EMAgent home directory:
    For example:
    EMD_URL=http://ajmachine1:5011/emd/main

    Modify the in the EMD_URL property so the EMAgent uses a new unused port on the target host.
    EMD_URL=http://ajmachine1:5015/emd/main

3. Start the EMAgent.
$ $AGENT_HOME/bin/emctl start agent

No comments:

Post a Comment