Support Questions
Find answers, ask questions, and share your expertise

Why do I get this ERROR: ambari-agent start failed. For more details, see /var/log/ambari-agent/ambari-agent.out:

/var/log/ambari-agent/ambari-agent.out:

/var/run/ambari-agent/ambari-agent.pid already exists, exiting

it only appears on 1 datanode

1 ACCEPTED SOLUTION

Super Mentor

@Christian Lunesa

- Are you running ambari agent as a non root user?

- Can you try removing the file "/var/run/ambari-agent/ambari-agent.pid" and then try starting the agent again? Please check the permission on the PID file.

# ls -l /var/run/ambari-agent/ambari-agent.pid
# ls -ld /var/run/ambari-agent

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

- Can you please share following files:

/var/log/ambari-agent/ambari-agent.out
/var/log/ambari-agent/ambari-agent.log

View solution in original post

6 REPLIES 6

Super Mentor

@Christian Lunesa

- Are you running ambari agent as a non root user?

- Can you try removing the file "/var/run/ambari-agent/ambari-agent.pid" and then try starting the agent again? Please check the permission on the PID file.

# ls -l /var/run/ambari-agent/ambari-agent.pid
# ls -ld /var/run/ambari-agent

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

- Can you please share following files:

/var/log/ambari-agent/ambari-agent.out
/var/log/ambari-agent/ambari-agent.log

I'm running it as root user.

[root@datanode4 ~]# ls -ld /var/run/ambari-agent

drwxr-xr-x 2 root root 4096 May 11 15:45 /var/run/ambari-agent

[root@datanode4 ~]# ls -l /var/run/ambari-agent/ambari-agent.pid

-rw-r--r-- 1 root root 5 May 11 15:45 /var/run/ambari-agent/ambari-agent.pid

[root@datanode4 ~]# cat /var/log/ambari-agent/ambari-agent.out

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 19874 10487 57 15:31 ? 00:00:16 /usr/bin/python /usr/lib/python2

Super Mentor

@Christian Lunesa

Looks like some other process is using port 8670 which is used by Agents hence agent is not able toi startup.

Please find which process is using the port 8670 and then kill it then try the start Agent again.

Ambari Agent uses this port 8670 as Ping Port So that port should be free before we attempt to start the agent.

# netstat -tnlpa | grep 8670<br>
# kill -9  $PID_from_above_command 
# ambari-agent start

.

OR you will need to change the "ping_port" of ambari agent in the following file:

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

.

can I just use any port for ping port as long as it is not used by any application?

Netstat show only 1 PID running from 8671

I tried to change the port but the error still appears. I change the port to 8671. .

Failed to start ping port listener of: Could not open port 8671 because port already used by another process:

; ;