Support Questions

Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

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

Champion

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

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

Champion

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

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

it will be a 2 node cluster.

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

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

 

Thanks a lot!

 

Regards,

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

 

 

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,

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

Champion

@mbigelow  it come be a dumb question please bear with me . 

is it mandatory to use  fully qualified domain name ? because we dont not mention them in any of the hadoop configuration files. when it comes to networking not really my area. could you clarify 

Champion
@csguna no it isn't a requirement. They just all need to resolved the same on all hosts. For me it is about keeping it within enterprise standards and like I said I usually use DNS, which usually contains multiple zones. As a user of it, it find it cleaner to have and . use the FQDN versus just the hostname when it comes to the URLs (although alias can be used as well).

Thanks,

 

Just a question, file /etc/sysconfig/network does not exist, should I create from scratch?

Champion

which operating system are you using ?

if you are using ubuntu

it should be

 

/etc/network/,

 /etc/network/interfaces

if you are using Centos do an ls command - below directory

/etc/sysconfig/

you should see one as network .

I am using Ubuntu 14.04. I have a a folder with name /etc/network but no file inside. Should I directly create it? How should I name it?

 

Thanks a lot,

 

Kind regards,

Champion

if you want to change the hostname then do either one of the following 

sudo nano /etc/hostname

or

sudo vi  /etc/hostname

then restart the machine 

 

to check your hostname after restart - open the terminal and type 

hostname

 

To configure IP address do the following 

 

sudo nano /etc/hosts

I have already done this and after checked those file, I can see that the host has changed.

 

However, I can´t still access to cloudera manager web...is there something else I should do?

 

Thanks a lot,

 

Kind regards,

Champion

are you using vm ?

what error are u getting when you try to hit cloduera manager ? 

Champion
Ok, the hosts file on the cluster nodes doesn't impact the CM UI. Check the CM logs for any errors (/var/log/cloudera-scm-server/).

Get the IP address from the CM host and use that in the URL (http://<cm_ip>:7180). You can also verify that CM is runnning (ps -ef | grep cloudera-scm-server) and that it is listening on the right port (sudo netstat -alpn | grep :7180). You can also try access it from the CM host itself (curl http://localhost:7180).

That will help to see if it is working without messing with name resolution.

Champion

@mbigelowThanks for the information , will follow the same and adher the  standards.

Champion
Oh, if you are searching within CM for hosts to install the agent on, include all IPs for each hosts, which would be the ones you entered into the hosts for all hosts.
Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.