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

Can Ambari server and agent run on same host ?

Explorer

Hello,

I am a newbie to horton and ambari. I am trying to make a 2 node hadoop cluster with physical server.

I am thinking of using Ambari to do provisioning. However since i only have 2 nodes, can i use Ambari server and ambari-agent on same node?

Right now if i do that, ambari-agent fails to startup and gives java unknown host exception . when i used FQDN

Thanks

1 ACCEPTED SOLUTION

Yes thats possible and necessary if you want to add services to your Ambari-server node.

How does your Ambari Agent configuration look like?

Make sure you have prepared the environment according to http://docs.hortonworks.com/HDPDocuments/Ambari-2.1.2.1/bk_Installing_HDP_AMB/content/_prepare_the_e..., especially DNS settings.

View solution in original post

33 REPLIES 33

Explorer

@Artem,

This is output of /etc/hosts on second node

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4

::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

10.10.8.152 krplhadoop2.kaimrc

10.10.8.151 krplhadoop.kaimrc

Mentor

Also agent.ini and hostname output @Majid Ali Syed Amjad Ali Sayed

Mentor

@Majid Ali Syed Amjad Ali Sayed can you modify your /etc/hosts on both nodes like this

10.10.8.152 krplhadoop2.kaimrc krplhadoop2

10.10.8.151 krplhadoop.kaimrc krplhadoop

then restart ambari-server and agents

also provide a screenshot and error after this modification.

Explorer

@Artem Ervits

I made the changes you suggested, no luck.

There is no error. The installation gets stuck at step number 8. The following screen shot shows where it gets stuck and then after sometime it goes to same place.

The packages are not being deployed

ambari-freezee.gif

Explorer

@Artem

On node 2 :

hostname -f

krplhadoop2.kaimrc

The server contents of ambari-agent .ini is as follows

[server] hostname=10.10.8.151

url_port=8440

secured_url_port=8441

Mentor

Please change ip to fqdn of ambari server @Majid Ali Syed Amjad Ali Sayed in ini file

Explorer

@Artem

Ok, changed now i restart agent on second node and also restart server ?

Mentor

You can but if you look in ambari-server logs and see agent registered its fine too. Let me know how it goes @Majid Ali Syed Amjad Ali Sayed

Explorer

Unfortunately, it gets stuck at same place. I even restarted agents and servers .@Artem

Mentor
@Majid Ali Syed Amjad Ali Sayed

I noticed on the screenshot you attached that started manually the agent on krplhadoop02 (see attached file)krplhadoop-ambari-agent.jpg

The agent will be installed by the during the Ambari server installation ! Please clean up that host and relaunch the Ambari install

My biggest worry was the passwordless login configuration between the servers in the cluster ,so I had this procedure for you

The assumption here is that you are running the Ambari installation as root

1.Delete the directory .ssh in roots home directory on krplhadoop.kaimrc

[root@krplhadoop.kaimrc]#ssh-keygen

Accept the defaults

[root@krplhadoop.kaimrc]# ls authorized_keys id_rsa id_rsa.pub known_hosts

The first one contains the private key, the second one contains the public key for user root.

2. Now run the command

[root@krplhadoop.kaimrc]#cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys

this will add the contents of the root’s file id_rsa.pub to a file authorized_keys.

Therefore, if a user will connect to this machine by SSH and will specify the correct private key, this machine will look up into authorized_keys and will know that this is root.

3. Copy this file authorized_keys as root to krplhadoop2.kaimrc in /root/.ssh directory Also check the permissions on the .ssh directory, id.rsa,authorized_keys and id_rsa.pub keys

4. Configure Database for ambari assuming you are using MySQL and don't forget to yum install mysql-connector-java and the appropriate permissions 644

5. Pre-load the Ambari database schema into your MySQL database then and pre-load the Ambari database schema into your MySQL database

6. [root@krplhadoop.kaimrc]# yum install ambari-server

7. [root@krplhadoop.kaimrc]#ambari-server setup /* output Ambari Server 'setup' completed successfully.*/

8. [root@krplhadoop.kaimrc]# Start the server #ambari-server start

Mentor

@Majid Ali Syed Amjad Ali Sayed

Are you still stuck ? If you could you attach your ambari log here.

@Majid Ali Syed Amjad Ali Sayed

I have 2 node cluster running in my environment.

If you have not fixed this then do this "Assuming that you are just doing this in your lab"

[root@phdns01 ~]# ambari-server reset

Using python /usr/bin/python2

Resetting ambari-server

**** WARNING **** You are about to reset and clear the Ambari Server database. This will remove all cluster host and configuration information from the database. You will be required to re-configure the Ambari server and re-run the cluster wizard.

Are you SURE you want to perform the reset [yes/no] (no)? yes

Confirm server reset [yes/no](no)? yes

Resetting the Server database...

Connecting to local database...done.

WARNING: Non critical error in DDL, use --verbose for more information

Ambari Server 'reset' completed with warnings.

Once it's done then you can try to reinstall the cluster.

Your /etc/hosts looks fine.

Explorer

you should install ambari-server and ambari-agent on the first node wich you want to install hdfs service for example .

the other nodes install ambari-agent only .

dont forget to change (ambari-agent.ini ) hostname

and the hosts file with (ip and hostname of all machines.

; ;