Complete the following instructions to configure automatic fail over:
Install and configure vSphere Monitoring Agent
The NameNode’s monitoring agent monitors the NameNode daemon and notifies the vSphere if the NameNode daemon fails or becomes unstable. As soon as the vSphere receives the notification, it triggers HA solution to restart NameNode VM on either the same or a different ESXi host.
Follow the steps listed below to install and configure the monitoring agent:
On the NameNode VM, download the HDP HA kit for VMware.
Download the Hortonworks Data Platform High Availability Kit for VMware:
For RHEL/CentOS 5.x:
wget http://public-repo-1.hortonworks.com/HDP/vmw_artifacts/1.2.1/centos5/hdp-ha-vmw-1.1.0.23.tar.gz
wget http://public-repo-1.hortonworks.com/HDP/centos5/1.x/updates/1.2.1/hamonitor_vsphere/hmonitor-vsphere-namenode-daemon-1.1.0.23-1.el5.x86_64.rpm
For RHEL/CentOS 6.x:
wget http://public-repo-1.hortonworks.com/HDP/vmw_artifacts/1.2.1/centos6/hdp-ha-vmw-1.1.0.23.tar.gz
wget http://public-repo-1.hortonworks.com/HDP/centos5/1.x/updates/1.2.1/hamonitor_vsphere/hmonitor-vsphere-namenode-daemon-1.1.0.23-1.el6.x86_64.rpm
Install the NameNode monitoring functionality:
yum install hmonitor
rpm -ivh hmonitor-vsphere-monitoring-1.1.0.2*
yum install hmonitor-vsphere-namenode-daemon
Configure the monitoring agent to point to the NameNode configurations.
Edit the
/usr/lib/hadoop/monitor/vm-namenode.xml
file and provide the FQDN for your NameNode VM here:<property> <name>service.monitor.portprobe.host</name> <value>$NameNode_FQDN</value> <description> Port to probe via a telnet operation.</description> </property>
Provide the HDFS port number.
<property> <name>service.monitor.portprobe.port</name> <value>$HDFS_filesystem_port</value> <description> Port to probe via a telnet operation.</description> </property>
Provide the FQDN and port information for the HDFS filesystem.
<property> <name>service.monitor.webprobe.url</name> <value>$http://NameNode_FQDN:NameNode_web_ui_port/</value> <description> URL to get.</description> </property>
Configure the NameNode to start automatically on OS boot
The monitoring agent requires that the NameNode process should start automatically once the virtual machine is bootstrapped.
To configure this, use the following command:
yum install hadoop-namenode