Prepare the Environment

To deploy your Hadoop instance, you need to prepare your deployment environment:

  • Setup Password-less SSH

  • Setup Service User Accounts

  • Enable NTP

  • Check DNS

  • Configure iptables

  • Disable SELinux and Check umask value

Set Up Password-less SSH

To have Ambari Server automatically install Ambari Agents on all cluster hosts, you must set up password-less SSH connections between the Ambari Server host and all other hosts in the cluster. The Ambari Server host uses SSH public key authentication to remotely access and install the Ambari Agent.

  • Generate public and private SSH keys on the Ambari Server host.

ssh-keygen
  • Copy the SSH Public Key (idrsa.pub) to the root account on your target hosts

 .ssh/idrsa 
 .ssh/idrsa.pub
  • Add the SSH Public Key to the authorizedkeys file on your target hosts.

 cat idrsa.pub >> authorizedkeys
  • Depending on your version of SSH, you may need to set permissions on the .ssh directory (to 700) and the authorizedkeys file in that directory (to 600) on the target hosts.

chmod 700 ~/.ssh 
chmod 600 ~/.ssh/authorizedkeys
  • From the Ambari Server, make sure you can connect to each host in the cluster using SSH, without having to enter a password.

ssh root@<remote.target.host>

where <remote.target.host> has the value of each host name in your cluster.

  • If the following warning message displays during your first connection:

Are you sure you want to continue connecting (yes/no)? Enter Yes.

  • Retain a copy of the SSH Private Key on the machine from which you will run the web-based Ambari Install Wizard.

Set Up Service User Accounts

Each Hadoop service requires a service user account. The Ambari Install wizard creates new and preserves any existing service user accounts. It uses these accounts when configuring Hadoop services. Service user account creation applies to service user accounts on the local operating system and to LDAP/AD accounts.

Enable NTP on the Cluster and on the Browser Host

The clocks of all the nodes in your cluster and the machine that runs the browser through which you access the Ambari Web interface must be able to synchronize with each other.

Check DNS

All hosts in your system must be configured for both forward and reverse DNS. Hadoop relies heavily on DNS, and as such performs many DNS lookups during normal operation.

Edit the Host File

Using a text editor, open the hosts file on every host in your cluster. For example:

vi /etc/hosts

Add a line for each host in your cluster. The line should consist of the IP address and the FQDN. For example:

1.2.3.4 <fully.qualified.domain.name>

Set the Hostname

Confirm that the hostname is set by running the following command:

hostname -f

This should return the <fully.qualified.domain.name> you just set. Use the “hostname” command to set the hostname on each host in your cluster. For example:

hostname <fully.qualified.domain.name>

Edit the Network Configuration File

Using a text editor, open the network configuration file on every host and set the desired network configuration for each host. For example:

vi /etc/sysconfig/network

Modify the HOSTNAME property to set the fully qualified domain name.

NETWORKING=yes 
HOSTNAME=<fully.qualified.domain.name>

Configuring iptables

For Ambari to communicate during setup with the hosts it deploys to and manages, certain ports must be open and available. The easiest way to do this is to temporarily disable iptables, as follows:

RHEL/CentOS

chkconfig iptables off 
/etc/init.d/iptables stop

RHEL/CentOS

systemctl disable firewalld 
service firewalld stop

Ambari checks whether iptables is running during the Ambari Server setup process. If iptables is running, a warning displays, reminding you to check that required ports are open and available. The Host Confirm step in the Cluster Install Wizard also issues a warning for each host that has iptables running.

Disable SELinux and check the umask value

You must disable SELinux for the Ambari setup to function. UMASK (User Mask or User file creation MASK) sets the default permissions or base permissions granted when a new file or folder is created on a Linux machine.

Most Linux distros set 022 as the default umask value. A umask value of 022 grants read, write, execute permissions of 755 for new files or folders. A umask value of 027 grants read, write, execute permissions of 750 for new files or folders.

Ambari supports a umask value of 022 or 027. For example, to set the umask value to 022, run the following command as root on all hosts, vi /etc/profile then, append the following line: umask 022

Last updated