|
@@ -605,32 +605,30 @@ public class Main {
|
|
|
private static void agentsStart() {
|
|
|
// TODO Auto-generated method stub
|
|
|
try {
|
|
|
- // String resource = "/hbase-site.xml";
|
|
|
- // Configuration configuration = new Configuration();
|
|
|
- // configuration.addResource(new
|
|
|
- // FileInputStream(System.getProperty("user.dir") + resource));
|
|
|
+ String resource = "/hbase-site.xml";
|
|
|
+ Configuration configuration = new Configuration();
|
|
|
+ configuration.addResource(new FileInputStream(System.getProperty("user.dir") + resource));
|
|
|
// int zookeeper_sessionTimeout = 300000;
|
|
|
|
|
|
- List<String> qrlist = new ArrayList<String>();
|
|
|
+ // List<String> qrlist = new ArrayList<String>();
|
|
|
// qrlist.add("zookeeper1:2181,zookeeper2:2181,zookeeper3:2181");
|
|
|
- qrlist.add("zookeeper1,zookeeper2,zookeeper3");
|
|
|
- qrlist.add("zookeeper1.saga");
|
|
|
- // qrlist.add("zookeeper1");
|
|
|
+ // qrlist.add("zookeeper1,zookeeper2,zookeeper3");
|
|
|
+ // qrlist.add("zookeeper1.saga");
|
|
|
+ // qrlist.add("zookeeper");
|
|
|
|
|
|
- for (String qr : qrlist) {
|
|
|
- try {
|
|
|
- Configuration configuration = new Configuration();
|
|
|
- configuration.set("hbase.cluster.distributed", "true");
|
|
|
- configuration.set("hbase.zookeeper.quorum", qr);
|
|
|
- ZillionAgent agent = new ZillionAgent(configuration);
|
|
|
- agent.setFull_name(qr);
|
|
|
- agent.Start();
|
|
|
- Constant.agents.add(agent);
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- LogUtil.error("Main.init.agentsStart: " + e.toString());
|
|
|
- }
|
|
|
+ // for (String qr : qrlist) {
|
|
|
+ try {
|
|
|
+ // Configuration configuration = new Configuration();
|
|
|
+ // configuration.set("hbase.cluster.distributed", "true");
|
|
|
+ // configuration.set("hbase.zookeeper.quorum", qr);
|
|
|
+ ZillionAgent agent = new ZillionAgent(configuration);
|
|
|
+ agent.Start();
|
|
|
+ Constant.agents.add(agent);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ LogUtil.error("Main.init.agentsStart: " + e.toString());
|
|
|
}
|
|
|
+ // }
|
|
|
// Constant.agents.add(new ZillionAgent(configuration,
|
|
|
// "zookeeper1:2181,zookeeper2:2181,zookeeper3:2181",
|
|
|
// zookeeper_sessionTimeout));
|