Skip to content

How to delete a cluster in HortonWorks (for testing purposes)

by on April 23, 2017

Background

During my testing of creating clusters using blueprints, i want just to recreate the cluster – not reinstall all packages.

Unlike the other vendor we’re using it is impossible to delete a cluster in HortonWorks.

It is possible to remove components and hosts, but you’ll end up with a single component (usually zookeeper) on a single host and this last component cannot be deleted.

So the steps should be:

Shutting down and cleaning cluster

  • Stop cluster
  • Remove all components in the right order of dependency (zookeeper will be last)
  • Remove all hosts till one is left
  • Stop ambari-agents on all hosts
  • Stop ambari-server
  • Stop PostgreSQL

Removing and recreating the cluster

  • Cleanup the PostgreSQL data dir – /var/lib/pgsql/data
  • Initialise DB using “postgresql-setup initdb”
  • setup ambari if required, e.g.
    “ambari-server setup –jdbc-db=postgres –jdbc-driver=/path/to/postgresql-jdbc.jar”
  • initialize ambari-server:
    “ambari-server setup -j /path/to/java/jdk/ -s”
  • start ambari-server and agents

And voila – empty ambari, ready for playing with blueprints.

TODO

  • Remove all components using REST APIs
  • Automate process with a single script
Advertisements
Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: