hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charles Thayer <tha...@yahoo-inc.com>
Subject HBase 0.89.20100726 with unmanaged zookeeper fails to start
Date Mon, 11 Oct 2010 19:32:50 GMT
We're using a pre-existing zookeeper cluster (HBASE_MANAGES_ZK=false),
and trying to port some code from 0.20 to 0.89, but hbase fails
to start with

    Couldnt start ZK at requested address of 2181 [..blah..] 2182
    (from ./src/main/java/org/apache/hadoop/hbase/master/HMaster.java)

Because port 2181 is already running our separate zk instance.

I commented out (and used if(false)) to work around the issue
and now "hbase shell" appears to work (see below).

Is anyone else seeing this problem? or does anyone know if it's repaired
in trunk or being worked on, before I file a ticket?

Thanks,
/charles

PS. Around line HMaster.java:1291  (0.89.20100726)

        if (cmd.getArgList().contains("start")) {
          try {
            // Print out vm stats before starting up.
            RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();
            if (runtime != null) {
              LOG.info("vmName=" + runtime.getVmName() + ", vmVendor=" +
                runtime.getVmVendor() + ", vmVersion=" + runtime.getVmVersion());
              LOG.info("vmInputArguments=" + runtime.getInputArguments());
            }
            // If 'local', defer to LocalHBaseCluster instance.  Starts master
            // and regionserver both in the one JVM.
            if (LocalHBaseCluster.isLocal(conf)) {
if (false) {
              final MiniZooKeeperCluster zooKeeperCluster =
                new MiniZooKeeperCluster();
              File zkDataPath = new
File(conf.get("hbase.zookeeper.property.dataDir"));
              int zkClientPort =
conf.getInt("hbase.zookeeper.property.clientPort", 0);
              if (zkClientPort == 0) {
                throw new IOException("No config value for
hbase.zookeeper.property.clientPort");
              }

zooKeeperCluster.setTickTime(conf.getInt("hbase.zookeeper.property.tickTime",
3000));
              zooKeeperCluster.setClientPort(zkClientPort);
              int clientPort = zooKeeperCluster.startup(zkDataPath);
              if (clientPort != zkClientPort) {
                String errorMsg = "Couldnt start ZK at requested address of " +
                    zkClientPort + ", instead got: " + clientPort + ". Aborting.
Why? " +
                    "Because clients (eg shell) wont be able to find this ZK
quorum";
                System.err.println(errorMsg);
                throw new IOException(errorMsg);
              }
              conf.set("hbase.zookeeper.property.clientPort",
                Integer.toString(clientPort));
}
              // Need to have the zk cluster shutdown when master is shutdown.
              // Run a subclass that does the zk cluster shutdown on its way out.
              LocalHBaseCluster cluster = new LocalHBaseCluster(conf, 1,
                LocalHMaster.class, HRegionServer.class);
//            ((LocalHMaster)cluster.getMaster()).setZKCluster(zooKeeperCluster);
              cluster.startup();
            } else {
              HMaster master = constructMaster(masterClass, conf);
              if (master.shutdownRequested.get()) {
                LOG.info("Won't bring the Master up as a shutdown is requested");
                return;
              }
              master.start();
            }
          } catch (Throwable t) {
            LOG.error("Failed to start master", t);
            System.exit(-1);
          }


Mime
View raw message