Skip to content

Commit 76b50dc

Browse files
macmasterrmacmaster
andauthored
HBASE-29377 ChaosService support for custom ports in zookeeper quorum (#7072) (#7099)
Reviewed-by: Aman Poonia <aman.poonia.29@gmail.com> Reviewed-by: Lokesh Khurana <khuranalokesh07@gmail.com> Signed-off-by: Tak Lon (Stephen) Wu <taklwu@apache.org> Co-authored-by: rmacmaster <rmacmaster@bloomberg.net>
1 parent fca80a4 commit 76b50dc

File tree

2 files changed

+7
-47
lines changed

2 files changed

+7
-47
lines changed

hbase-it/src/main/java/org/apache/hadoop/hbase/chaos/ChaosService.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
*/
1818
package org.apache.hadoop.hbase.chaos;
1919

20+
import java.net.InetAddress;
2021
import java.net.UnknownHostException;
2122
import java.util.Arrays;
2223
import java.util.Collection;
@@ -25,6 +26,7 @@
2526
import org.apache.hadoop.hbase.ChoreService;
2627
import org.apache.hadoop.hbase.HBaseConfiguration;
2728
import org.apache.hadoop.hbase.ScheduledChore;
29+
import org.apache.hadoop.hbase.zookeeper.ZKConfig;
2830
import org.apache.hadoop.util.GenericOptionsParser;
2931
import org.apache.yetus.audience.InterfaceAudience;
3032
import org.slf4j.Logger;
@@ -76,8 +78,11 @@ private static void ChaosServiceStart(Configuration conf, ChaosServiceName servi
7678
case CHAOSAGENT:
7779
ChaosAgent.stopChaosAgent.set(false);
7880
try {
79-
Thread t = new Thread(
80-
new ChaosAgent(conf, ChaosUtils.getZKQuorum(conf), ChaosUtils.getHostName()));
81+
String hostname = InetAddress.getLocalHost().getHostName();
82+
String quorum = ZKConfig.getZKQuorumServersString(conf);
83+
LOG.info("Starting the ChaosAgent with hostname: {}, quorum: {}", hostname, quorum);
84+
85+
Thread t = new Thread(new ChaosAgent(conf, quorum, hostname));
8186
t.start();
8287
t.join();
8388
} catch (InterruptedException | UnknownHostException e) {

hbase-it/src/main/java/org/apache/hadoop/hbase/chaos/ChaosUtils.java

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)