public static void main ( String [ ] args ) { Properties properties = new Properties ( ) ; LOG . info ( "Load chronos.cfg configuration from class path" ) ; try { properties . load ( ChronosServer . class . getClassLoader ( ) . getResourceAsStream ( "chronos.cfg" ) ) ; properties . setProperty ( FailoverServer . BASE_ZNODE , "/chronos" + "/" + properties . getProperty ( CLUSTER_NAME ) ) ; } catch ( IOException e ) { LOG . fatal ( "Error to load chronos.cfg configuration, exit immediately" , e ) ; System . exit ( 0 ) ; } ChronosServer chronosServer = null ; LOG . info ( "Init chronos server and connect ZooKeeper" ) ; try { chronosServer = new ChronosServer ( properties ) ; } catch ( Exception e ) { LOG . fatal ( "Exception to init chronos server, exit immediately" , e ) ; System . exit ( 0 ) ; } chronosServer . run ( ) ; }
The main entrance of ChronosServer to start the service .