Created on 08-19-2019 11:06 PM - last edited on 08-20-2019 03:15 AM by VidyaSargur
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
Created 08-20-2019 01:57 AM
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
.
Created 08-20-2019 12:25 AM
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.
Created 08-20-2019 01:41 AM
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
Created on 08-20-2019 01:44 AM - edited 08-20-2019 01:44 AM
Use below cmds, PID means pid of the process.
kill12998
kill 23758
Restart ambari agent
Created 08-20-2019 01:48 AM
Still same 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:43 /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
Created 08-20-2019 01:50 AM
kill the process which is using port 8670
netstat -tulpn | grep 8670
kill -9 <process pid>
Created 08-20-2019 01:54 AM
still same error. can you tell me your contact in private messages(email or phone)
Created 08-20-2019 01:57 AM
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
.
Created 08-20-2019 02:06 AM
can you tell me solution for this
ambari-server restart
Using python /usr/bin/python
Restarting ambari-server
Ambari Server is not running
Ambari Server running with administrator privileges.
Organizing resource files at /var/lib/ambari-server/resources...
Ambari database consistency check started...
Server PID at: /var/run/ambari-server/ambari-server.pid
Server out at: /var/log/ambari-server/ambari-server.out
Server log at: /var/log/ambari-server/ambari-server.log
Waiting for server start..........................................ERROR: Exiting with exit code -1.
REASON: Ambari Server java process has stopped. Please check the logs for more information.
Created 08-20-2019 03:25 AM
Hi,
We don't share personal information like contacts, As you are facing Ambari Server issue and Agents issue is resolved, Please open a new question for Ambari Server, Also, check the Ambari Server logs you see some exceptions, attach those exceptions.