3
votes

I'm trying to construct hadoop cluster which consists of 1 namenode, 1 secondary namenode, and 3 datanodes in ec2.

So I wrote the address of secondary namenode to the masters file and executed start-dfs.sh .

:~/hadoop/etc/hadoop$ cat masters

ec2-54-187-222-213.us-west-2.compute.amazonaws.com

But, the secondary namenode didn't start at the address which was written in the masters file. It just started at the node where the stat-dfs.sh script was executed.

:~/hadoop/etc/hadoop$ start-dfs.sh

...

Starting secondary namenodes [0.0.0.0]

0.0.0.0: starting secondarynamenode, logging to /home/ubuntu/hadoop/logs/hadoop-ubuntu-secondarynamenode-ip-172-31-26-190.out

I don't figure why secondary namenode started at [0.0.0.0]. It should start at ec2-54-187-222-213.us-west-2.compute.amazonaws.com. Are there anyone who know this reason?

============================================================

Oh I solved this problem. I added

<property>
<name>dfs.namenode.secondary.http-address</name>
<value>ec2-54-187-222-213.us-west-2.compute.amazonaws.com:50090</value>
</property>

to hdfs-site.xml file and it works! The masters file is useless.

1

1 Answers

-1
votes

It is okay, as long as the node roles are configured correctly in hadoop configuration. You can use dfsadmin to check the IP address of the secondary namenode. If it is 172.31.26.190 then it means fine. The secondary namenode serves at 0.0.0.0 means it accepts any incoming connections from localhost or from any nodes within the network.