Skip to main content
Manoj690
Silver ⭐️⭐️⭐️
Aug 20, 2019 6:06 AM UTC
Solved

ambari agent not running

Hi

 

By mistake i deleted one file in ambari agent that is

rm -f /run/ambari-agent/ambari-agent.pid

 

after that its showing this error

 

ambari-agent restart
Restarting ambari-agent
Verifying Python version compatibility...
Using python /usr/bin/python
ambari-agent is not running. No PID found at /run/ambari-agent/ambari-agent.pid
Verifying Python version compatibility...
Using python /usr/bin/python
Checking for previously running Ambari Agent...
Checking ambari-common dir...
Starting ambari-agent
Verifying ambari-agent process status...
ERROR: ambari-agent start failed. For more details, see /var/log/ambari-agent/ambari-agent.out:
====================
No handlers could be found for logger "root"
Failed to start ping port listener of: Could not open port 8670 because port already used by another process:
UID PID PPID C STIME TTY TIME CMD
root 23758 23754 0 Aug19 pts/4 00:00:17 /usr/bin/python /usr/lib/ambari-
====================
Agent out at: /var/log/ambari-agent/ambari-agent.out
Agent log at: /var/log/ambari-agent/ambari-agent.log

 

 

 

jsensharma
Platinum ⭐️⭐️
Aug 20, 2019 8:57 AM UTC

@Manoj690 

Can you please try this:

Try changing the "ping_port" of ambari agent in the following file: (default port is 8670 may be try changing it to 8671 or something unused)

# grep '8670' /etc/ambari-agent/conf/ambari-agent.ini
ping_port=8670


After changing the port please try this:

# netstat -tnlpa | grep 8670
# kill -9 $PID_from_above_command
# rm -f /var/run/ambari-agent/ambari-agent.pid
# ambari-agent start

 

.

9 replies

pbhagade
Gold ⭐️
Gold ⭐️
Aug 20, 2019 7:25 AM UTC

Hi @Manoj690 ,

 

Try to find the ambari agent pid and kill is manually.

Below cmds will usefull

# ps aux | grep main.py | grep -v grep

# kill PID

 

Once the process is killed then you can start the agent.

 

Please accept the answer once issue resolved.

 

Translate
Manoj690
Manoj690Author
Silver ⭐️⭐️⭐️
Aug 20, 2019 8:41 AM UTC

Hi

i tried this

 

ps aux | grep main.py | grep -v grep
root 12998 0.0 0.1 164276 28588 pts/4 T Aug19 0:00 /usr/bin/python /usr/lib/ambari-agent/lib/ambari_agent/main.py stop
root 23758 0.0 0.1 232796 23640 pts/4 Sl Aug19 0:32 /usr/bin/python /usr/lib/ambari-agent/lib/ambari_agent/main.py start


 kill PID
bash: kill: PID: arguments must be process or job IDs

Translate
pbhagade
Gold ⭐️
Gold ⭐️
Aug 20, 2019 8:44 AM UTC

Use below cmds, PID means pid of the process.

kill12998

kill 23758

 

Restart ambari agent

Translate