Class ChaosMonkey

java.lang.Object
org.apache.hadoop.hbase.chaos.monkies.ChaosMonkey
All Implemented Interfaces:
org.apache.hadoop.hbase.Stoppable
Direct Known Subclasses:
CalmChaosMonkey, PolicyBasedChaosMonkey

public abstract class ChaosMonkey extends Object implements org.apache.hadoop.hbase.Stoppable
A utility to injects faults in a running cluster.

ChaosMonkey defines Action's and Policy's. Actions are sequences of events, like - Select a random server to kill - Sleep for 5 sec - Start the server on the same host Actions can also be complex events, like rolling restart of all of the servers.

Policies on the other hand are responsible for executing the actions based on a strategy. The default policy is to execute a random action every minute based on predefined action weights. ChaosMonkey executes predefined named policies until it is stopped. More than one policy can be active at any time.

Chaos monkey can be run from the command line, or can be invoked from integration tests. See IntegrationTestIngest or other integration tests that use chaos monkey for code examples.

ChaosMonkey class is indeed inspired by the Netflix's same-named tool: http://techblog.netflix.com/2012/07/chaos-monkey-released-into-wild.html

  • Constructor Details

  • Method Details

    • start

      public abstract void start() throws Exception
      Throws:
      Exception
    • stop

      public abstract void stop(String why)
      Specified by:
      stop in interface org.apache.hadoop.hbase.Stoppable
    • isStopped

      public abstract boolean isStopped()
      Specified by:
      isStopped in interface org.apache.hadoop.hbase.Stoppable
    • waitForStop

      public abstract void waitForStop() throws InterruptedException
      Throws:
      InterruptedException
    • isDestructive

      public abstract boolean isDestructive()
      Returns whether the CM does destructive actions (killing servers) so that a cluster restore is needed after CM is stopped. Otherwise cluster will be left as it is