Ambari

Overview

  • Ambari (ambari.apache.org) is used to setup Hadoop / Spark etc environment

Upgrading Ambari

  • This will only affect Ambari (all Hadoop / Spark components keep running in old version)

  • Read the release notes!

  • Get the newest Repo from ambari.apache.org

wget -nv http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.2.0.0/ambari.repo -O /etc/yum.repos.d/ambari.repo
  • Make sure you have a backup of the postgres db on the management node

su - postgres
pg_dumpall > ambari.sql
  • Stop Ambari on management node

ambari-server stop
  • Stop Ambari on all compute nodes

ambari-agent stop
  • Upgrade Ambari on management node

yum upgrade ambari-server
  • And on all compute nodes

yum upgrade ambari-agent
  • Afterwards run this on management node

ambari-server upgrade
ambari-server start
  • And start Ambari on all compute nodes

ambari-agent start

Upgrading HDP (Hadoop Stack)

  • Run the following commands on the master node

  • Set HDFS into maintenance mode and flush namespace cache

su - hdfs -c "hdfs dfsadmin -safemode enter"
su - hdfs -c "hdfs dfsadmin -saveNamespace"
  • Check HDFS for errors

su - hdfs -c "hdfs fsck / -files -blocks -locations"
su - hdfs -c "hdfs dfsadmin -safemode leave"

Remove a service from ambari using the REST API

curl -u admin:"$PASSWORD" -H "X-Requested-By: ambari" http://127.0.0.1:8080/api/v1/clusters/<cluster_name>/hosts/<hostname>/host_components
curl -u admin:"$PASSWORD" -H "X-Requested-By: ambari" -X DELETE http://127.0.0.1:8080/api/v1/clusters/<cluster_name>/hosts/<hostname>/host_components/<service_name>

Reinstall an ambari client

  • Install ambari-agent, set server hostname to ambari master in /etc/ambari-agent/conf/ambari-agent.ini and start the agent

ambari-agent start
  • Now you can delete most of the services from the host in the ambari webinterface and afterwards install it again

  • If you cannot delete a service use the REST API (see above)