Class ChaosMonkey
- All Implemented Interfaces:
org.apache.hadoop.hbase.Stoppable
- Direct Known Subclasses:
CalmChaosMonkey
,PolicyBasedChaosMonkey
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract boolean
Returns whether the CM does destructive actions (killing servers) so that a cluster restore is needed after CM is stopped.abstract boolean
abstract void
start()
abstract void
abstract void
-
Constructor Details
-
ChaosMonkey
public ChaosMonkey()
-
-
Method Details
-
start
- Throws:
Exception
-
stop
- Specified by:
stop
in interfaceorg.apache.hadoop.hbase.Stoppable
-
isStopped
- Specified by:
isStopped
in interfaceorg.apache.hadoop.hbase.Stoppable
-
waitForStop
- Throws:
InterruptedException
-
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
-