Search in sources :

Example 1 with SecurityException

use of org.apache.bookkeeper.tls.SecurityException in project bookkeeper by apache.

the class LocalBookKeeper method main.

public static void main(String[] args) throws Exception, SecurityException {
    try {
        if (args.length < 1) {
            usage();
            System.exit(-1);
        }
        int numBookies = Integer.parseInt(args[0]);
        ServerConfiguration conf = new ServerConfiguration();
        conf.setAllowLoopback(true);
        if (args.length >= 2) {
            String confFile = args[1];
            try {
                conf.loadConf(new File(confFile).toURI().toURL());
                LOG.info("Using configuration file " + confFile);
            } catch (Exception e) {
                // load conf failed
                LOG.warn("Error loading configuration file " + confFile, e);
            }
        }
        String zkDataDir = null;
        if (args.length >= 3) {
            zkDataDir = args[2];
        }
        String localBookiesConfigDirName = defaultLocalBookiesConfigDir;
        if (args.length >= 4) {
            localBookiesConfigDirName = args[3];
        }
        startLocalBookiesInternal(conf, zooKeeperDefaultHost, zooKeeperDefaultPort, numBookies, true, bookieDefaultInitialPort, false, "test", zkDataDir, localBookiesConfigDirName);
    } catch (Exception e) {
        LOG.error("Exiting LocalBookKeeper because of exception in main method", e);
        e.printStackTrace();
        /*
             * This is needed because, some non-daemon thread (probably in ZK or
             * some other dependent service) is preventing the JVM from exiting, though
             * there is exception in main thread.
             */
        System.exit(-1);
    }
}
Also used : ServerConfiguration(org.apache.bookkeeper.conf.ServerConfiguration) File(java.io.File) CompatibilityException(org.apache.bookkeeper.replication.ReplicationException.CompatibilityException) SecurityException(org.apache.bookkeeper.tls.SecurityException) BookieException(org.apache.bookkeeper.bookie.BookieException) KeeperException(org.apache.zookeeper.KeeperException) IOException(java.io.IOException) BKException(org.apache.bookkeeper.client.BKException) UnavailableException(org.apache.bookkeeper.replication.ReplicationException.UnavailableException)

Aggregations

File (java.io.File)1 IOException (java.io.IOException)1 BookieException (org.apache.bookkeeper.bookie.BookieException)1 BKException (org.apache.bookkeeper.client.BKException)1 ServerConfiguration (org.apache.bookkeeper.conf.ServerConfiguration)1 CompatibilityException (org.apache.bookkeeper.replication.ReplicationException.CompatibilityException)1 UnavailableException (org.apache.bookkeeper.replication.ReplicationException.UnavailableException)1 SecurityException (org.apache.bookkeeper.tls.SecurityException)1 KeeperException (org.apache.zookeeper.KeeperException)1