Skip to content

Commit 2ca012f

Browse files
authored
HBASE-27663 ChaosMonkey documentation enhancements (#5172)
Signed-off-by: Duo Zhang <[email protected]>
1 parent d8447d9 commit 2ca012f

File tree

1 file changed

+59
-1
lines changed

1 file changed

+59
-1
lines changed

src/main/asciidoc/_chapters/developer.adoc

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1759,7 +1759,7 @@ following example runs ChaosMonkey with the default configuration:
17591759

17601760
[source,bash]
17611761
----
1762-
$ bin/hbase org.apache.hadoop.hbase.util.ChaosMonkey
1762+
$ bin/hbase org.apache.hadoop.hbase.chaos.util.ChaosMonkeyRunner
17631763
17641764
12/11/19 23:21:57 INFO util.ChaosMonkey: Using ChaosMonkey Policy: class org.apache.hadoop.hbase.util.ChaosMonkey$PeriodicRandomActionPolicy, period:60000
17651765
12/11/19 23:21:57 INFO util.ChaosMonkey: Sleeping for 26953 to add jitter
@@ -1801,6 +1801,64 @@ $ bin/hbase org.apache.hadoop.hbase.util.ChaosMonkey
18011801
The output indicates that ChaosMonkey started the default `PeriodicRandomActionPolicy`
18021802
policy, which is configured with all the available actions. It chose to run `RestartActiveMaster` and `RestartRandomRs` actions.
18031803

1804+
==== ChaosMonkey without SSH
1805+
1806+
Chaos monkey can be run without SSH using the Chaos service and ZNode cluster manager. HBase ships
1807+
with many cluster managers, available in the `hbase-it/src/test/java/org/apache/hadoop/hbase/` directory.
1808+
1809+
Set the following property in hbase configuration to switch to `ZNodeClusterManager`:
1810+
`hbase.it.clustermanager.class=org.apache.hadoop.hbase.ZNodeClusterManager`
1811+
1812+
Start chaos agent on all hosts where you want to test chaos scenarios.
1813+
1814+
[source,bash]
1815+
----
1816+
$ bin/hbase org.apache.hadoop.hbase.chaos.ChaosService -c start
1817+
1818+
Start chaos monkey runner from any one host, preferrably an edgenode.
1819+
An example log while running chaos monkey with default policy PeriodicRandomActionPolicy is shown below.
1820+
Command Options:
1821+
-c <arg> Name of extra configurations file to find on CLASSPATH
1822+
-m,--monkey <arg> Which chaos monkey to run
1823+
-monkeyProps <arg> The properties file for specifying chaos monkey properties.
1824+
-tableName <arg> Table name in the test to run chaos monkey against
1825+
-familyName <arg> Family name in the test to run chaos monkey against
1826+
1827+
[source,bash]
1828+
----
1829+
$ bin/hbase org.apache.hadoop.hbase.chaos.util.ChaosMonkeyRunner
1830+
1831+
INFO [main] hbase.HBaseCommonTestingUtility: Instantiating org.apache.hadoop.hbase.ZNodeClusterManager
1832+
INFO [ReadOnlyZKClient-host1.example.com:2181,host2.example.com:2181,host3.example.com:2181@0x003d43fe] zookeeper.ZooKeeper: Initiating client connection, connectString=host1.example.com:2181,host2.example.com:2181,host3.example.com:2181 sessionTimeout=90000 watcher=org.apache.hadoop.hbase.zookeeper.ReadOnlyZKClient$$Lambda$19/2106254492@1a39cf8
1833+
INFO [ReadOnlyZKClient-host1.example.com:2181,host2.example.com:2181,host3.example.com:2181@0x003d43fe] zookeeper.ClientCnxnSocket: jute.maxbuffer value is 4194304 Bytes
1834+
INFO [ReadOnlyZKClient-host1.example.com:2181,host2.example.com:2181,host3.example.com:2181@0x003d43fe] zookeeper.ClientCnxn: zookeeper.request.timeout value is 0. feature enabled=
1835+
INFO [ReadOnlyZKClient-host1.example.com:2181,host2.example.com:2181,host3.example.com:2181@0x003d43fe-SendThread(host2.example.com:2181)] zookeeper.ClientCnxn: Opening socket connection to server host2.example.com/10.20.30.40:2181. Will not attempt to authenticate using SASL (unknown error)
1836+
INFO [ReadOnlyZKClient-host1.example.com:2181,host2.example.com:2181,host3.example.com:2181@0x003d43fe-SendThread(host2.example.com:2181)] zookeeper.ClientCnxn: Socket connection established, initiating session, client: /10.20.30.40:35164, server: host2.example.com/10.20.30.40:2181
1837+
INFO [ReadOnlyZKClient-host1.example.com:2181,host2.example.com:2181,host3.example.com:2181@0x003d43fe-SendThread(host2.example.com:2181)] zookeeper.ClientCnxn: Session establishment complete on server host2.example.com/10.20.30.40:2181, sessionid = 0x101de9204670877, negotiated timeout = 60000
1838+
INFO [main] policies.Policy: Using ChaosMonkey Policy class org.apache.hadoop.hbase.chaos.policies.PeriodicRandomActionPolicy, period=60000 ms
1839+
[ChaosMonkey-2] policies.Policy: Sleeping for 93741 ms to add jitter
1840+
INFO [ChaosMonkey-0] policies.Policy: Sleeping for 9752 ms to add jitter
1841+
INFO [ChaosMonkey-1] policies.Policy: Sleeping for 65562 ms to add jitter
1842+
INFO [ChaosMonkey-3] policies.Policy: Sleeping for 38777 ms to add jitter
1843+
INFO [ChaosMonkey-0] actions.CompactRandomRegionOfTableAction: Performing action: Compact random region of table usertable, major=false
1844+
INFO [ChaosMonkey-0] policies.Policy: Sleeping for 59532 ms
1845+
INFO [ChaosMonkey-3] client.ConnectionImplementation: Getting master connection state from TTL Cache
1846+
INFO [ChaosMonkey-3] client.ConnectionImplementation: Getting master state using rpc call
1847+
INFO [ChaosMonkey-3] actions.DumpClusterStatusAction: Cluster status
1848+
Master: host1.example.com,16000,1678339058222
1849+
Number of backup masters: 0
1850+
Number of live region servers: 3
1851+
host1.example.com,16020,1678794551244
1852+
host2.example.com,16020,1678341258970
1853+
host3.example.com,16020,1678347834336
1854+
Number of dead region servers: 0
1855+
Number of unknown region servers: 0
1856+
Average load: 123.6666666666666
1857+
Number of requests: 118645157
1858+
Number of regions: 2654
1859+
Number of regions in transition: 0
1860+
INFO [ChaosMonkey-3] policies.Policy: Sleeping for 89614 ms
1861+
18041862
==== Available Policies
18051863
HBase ships with several ChaosMonkey policies, available in the
18061864
`hbase/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/policies/` directory.

0 commit comments

Comments
 (0)