Support Questions

Find answers, ask questions, and share your expertise

Ambari Agent failed to start in manual installation

avatar
Rising Star

I am installing 4 node cluster using ambari. I installed ambari server and ambari agent on master node. In addition to that i have installed ambari agents on 2 slave nodes. Ambari server and ambari agents on master node is running.But i am unable to start ambari-agent on my slave nodes due to the error "Ambari Agent start fails with local variable 'server_url' referenced before assignment". This seems like jira bug but it has already been fixed.

https://issues.apache.org/jira/browse/AMBARI-19246

I am using ambari version 2.4.2

Could anyone please help me in starting agents on slave nodes?

1 ACCEPTED SOLUTION

avatar
Master Mentor

@rahul gulati

Although the workaround is quite simple. Just edit the file "/usr/lib/python2.6/site-packages/ambari_agent/main.py"

Just change the line "server_ip = socket.gethostbyname(server_hostname)" as mentioned in:

https://git1-us-west.apache.org/repos/asf?p=ambari.git;a=commitdiff;h=a43837a35536096224a77356a4049e...

This need to be done on all the ambari-agent hosts and then followed by "ambari-agent restart"

.

NOTE: It should help only if your issue is exactly same as the one mentioned in :

https://issues.apache.org/jira/browse/AMBARI-19246

View solution in original post

10 REPLIES 10

avatar
Master Mentor

@rahul gulati

Are you sure that when you are running the following command on those hosts individually then you are getting the correct FQDN?

  1. hostname -f

- Ambari agent sends registration request to ambari-server every time when agent is restarted. In the registration request it sends the FQDN information of it's own as well. Agent uses the following approach to findout the FQDN using python. So please check if all your hosts are returning correct hostname

  1. python -c "import socket; print socket.getfqdn()"

.

Also in local system it might get using which is not actually FQDN as above. So local agent might behave bit differently then remote.

  1. python -c "import socket; print socket.gethostname()"