public static void main ( String [ ] args ) throws Exception { int zkPort ; boolean secureZK = false ; String zkKeyStore ; String zkKeyStorePasswd = null ; String zkTrustStore = null ; try { zkPort = Integer . parseInt ( System . getProperty ( PROPERTY_ZK_PORT ) ) ; secureZK = Boolean . parseBoolean ( System . getProperty ( PROPERTY_SECURE_ZK , "false" ) ) ; zkKeyStore = System . getProperty ( PROPERTY_ZK_KEY_STORE ) ; zkKeyStorePasswd = System . getProperty ( PROPERTY_ZK_KEY_STORE_PASSWORD ) ; zkTrustStore = System . getProperty ( PROPERTY_ZK_TRUST_STORE ) ; } catch ( Exception ex ) { System . out . println ( String . format ( "Invalid or missing arguments (via system properties). Expected: %s(int). (%s)" , PROPERTY_ZK_PORT , ex . getMessage ( ) ) ) ; System . exit ( - 1 ) ; return ; } ZooKeeperServiceRunner runner = new ZooKeeperServiceRunner ( zkPort , secureZK , zkKeyStore , zkKeyStorePasswd , zkTrustStore ) ; runner . initialize ( ) ; runner . start ( ) ; Thread . sleep ( Long . MAX_VALUE ) ; }
Main method that can be used to start ZooKeeper out - of - process using BookKeeperServiceRunner . This is used when invoking this class via ProcessStarter .