Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Host file

Host file

Hi gurus,

 

Is there a way to identify which is the address to set in the host file? I am trying with 127.0.0.1 and I am getting errors, all the time. I would like to set an address and be able to configure the node in cloudera manager.

 

Thanks a lot,

 

Regards,

22 REPLIES 22

Re: Host file

Champion

were you able to fix it ? if not i can help you  that

Re: Host file

No, i could not.

 

I don´t know which is the address that I have to set in the host file.

 

If you could help me it would be great.

 

Thanks,

 

Regards

Re: Host file

Champion

Gotcha . its just matter of two files that you need to tweak.

are you plaining to perform single node or multi node cluster ? 

Re: Host file

it will be a 2 node cluster.

Re: Host file

Champion

I assume you are using vm . 

so edit the file accordingly , to perform the SSH configuration follow the link 

 

On both the nodes . 

 

/etc/hosts

192.168.200.201    master
192.168.200.202    slave

On the master node

/etc/sysconfig/network

master

on the slave node

 

/etc/sysconfig/network

slave

Below is the best link to walk through the rest of the configuration ,mate 

 

https://www.tutorialspoint.com/hadoop/hadoop_multi_node_cluster.htm

Re: Host file

thanks. what if i am using a single node cluster?

 

Thanks a lot!

 

Regards,

Re: Host file

Champion

if you are plaining for Single node cluster ,

then just the hostname would be of your choice . 

 

/etc/hosts
192.168.200.201   Hello
/etc/sysconfig/network

Hello

You have to configure Yum repository , MR2 yarn setup - the below is good link from Cloudera for Single node cluster setup . 

 

https://www.cloudera.com/documentation/enterprise/5-4-x/topics/cdh_qs_yarn_pseudo.html

 

 

Highlighted

Re: Host file

Great, i will try it. Then with this information, which is the IP that I should look for specifying the hosts? Is this the same that I specified in the hosts file?

 

Thanks a lot,

 

Regards,

Re: Host file

Champion

@mercedes012345 The hosts file is a mapping between IPs and hostnames. Each lines corresponds to a single entry. The first column if for the IP address, the second column is for the fully qualified domain name, and the last column is for the hostname (columns can be separated by spaces or tabs).

 

You can have as many entires as needed. I honestly haven't done an install that didn't use DNS first, but unless my memory is failing all hosts need to be resolve each other. So if you are only using hosts files for name resolution you need to include all hosts in the cluster.

 

@csguna provided some examples. I would flesh it out by include all three columns

 

/etc/host
192.168.1.1  master.example.com  master
192.168.1.2  worker.example.com  worker

The hostname in the network file should be in the format of HOSTNAME=master.example.com