package moniter;
import java.io.IOException;
public class hbasemoniter_new {
public final static String url = "tcp://dsdfsd/sdfs";
// public static String config = null;
// public static String service_name = null;
public static String config = "C:\\Users\\dgffg.xml";
public static String service_name = "drgrei";
public static void main(String[] args) throws Exception {
if (config == null || config.equals("") || service_name == null
|| service_name.equals("")) {
return;
}
asdnit.init(config);
get("test", "04213fr21r312123fe50");
}
public static void get(String tablename, String rowkey) throws IOException {
IHbaseApi service = null;
service = tableaaa.create(IHbaseApi.class, url);
String table = tablename;
String rowk = rowkey;
int retry = 10;
for (int i = 0; i < retry; i++) {
try {
service.tableaa(table, rowk);
} catch (Exception e) {
System.out.println("Moniter:false");
System.exit(1);
}
}
System.out.println("Moniter:true");
System.exit(0);
}
}
简单的hbase监控程序,用于监测hbase集群是否正常运行--66
最新推荐文章于 2021-05-13 18:16:24 发布