Following steps would help in cleaning up Ambari Metrics System data in a given cluster.

Important Note:

  1. Cleaning up the AMS data would remove all the historical AMS data available
  2. The hbase parameters mentioned above are specific to AMS and they are different from the Cluster Hbase parameters

Step-by-step guide

  1.  Using Ambari
    1. Set AMS to maintenance
    2. Stop AMS from Ambari
    3. Identify the following from the AMS Configs screen
      1. 'Metrics Service operation mode' (embedded or distributed)
      2. hbase.rootdir 
      3. hbase.zookeeper.property.dataDir
  2. AMS data would be stored in 'hbase.rootdir' identified above. Backup and remove the AMS data.
    1. If the Metrics Service operation mode
      1. is 'embedded', then the data is stored in OS files. Use regular OS commands to backup and remove the files in hbase.rootdir
      2. is 'distributed', then the data is stored in HDFS. Use 'hdfs dfs' commands to backup and remove the files in hbase.rootdir
  3. Remove the AMS zookeeper data by backing up and removing the contents of 'hbase.tmp.dir'/zookeeper
  4. Remove any Phoenix spool files from 'hbase.tmp.dir'/phoenix-spool folder
  5. Restart AMS using Ambari