1) Added validate command: validates a zookeeper/cluster/installer configuration 
2) Added init command: auto-genration of configuration for pseudo-distributed local mode. 
3) Added shutdown hook for ensuring graceful shutdown of NCs when an asterix instance is shut.


git-svn-id: https://asterixdb.googlecode.com/svn/branches/asterix_stabilization_ioc_installer@1294 eaa15691-b419-025a-1212-ee371bd00084
diff --git a/asterix-installer/src/main/resources/conf/asterix.conf b/asterix-installer/src/main/resources/clusters/local/conf/asterix.conf
similarity index 100%
rename from asterix-installer/src/main/resources/conf/asterix.conf
rename to asterix-installer/src/main/resources/clusters/local/conf/asterix.conf
diff --git a/asterix-installer/src/main/resources/clusters/local.xml b/asterix-installer/src/main/resources/clusters/local/local.xml
similarity index 100%
rename from asterix-installer/src/main/resources/clusters/local.xml
rename to asterix-installer/src/main/resources/clusters/local/local.xml
diff --git a/asterix-installer/src/main/resources/conf/log4j.properties b/asterix-installer/src/main/resources/conf/log4j.properties
index b951c14..fedf941 100644
--- a/asterix-installer/src/main/resources/conf/log4j.properties
+++ b/asterix-installer/src/main/resources/conf/log4j.properties
@@ -3,7 +3,7 @@
 log4j.appender.A1=org.apache.log4j.ConsoleAppender
 log4j.appender.A1.layout=org.apache.log4j.PatternLayout
 # Print the date in ISO 8601 format
-log4j.appender.A1.layout.ConversionPattern=%d %-p: %n%m%n
+log4j.appender.A1.layout.ConversionPattern=%-p: %m%n
 
 log4j.logger.edu.uci.ics.asterix.event.management=error
 log4j.logger.org.apache.zookeeper=error
diff --git a/asterix-installer/src/main/resources/zookeeper/zk.init b/asterix-installer/src/main/resources/zookeeper/zk.init
index 9b554b1..937d8b3 100755
--- a/asterix-installer/src/main/resources/zookeeper/zk.init
+++ b/asterix-installer/src/main/resources/zookeeper/zk.init
@@ -1,11 +1,11 @@
 ZK_HOME=$1
 shift 1
-cd $MANAGIX_HOME/.managix/zookeeper
+cd $MANAGIX_HOME/.installer/zookeeper
 tar cf zk.pkg.tar *
 zk_server_id=1
 for zk_host in  $@
 do
-  ssh $zk_host "mkdir $ZK_HOME"
+  ssh $zk_host "mkdir -p $ZK_HOME"
   scp ./zk.pkg.tar $zk_host:$ZK_HOME/
   ssh $zk_host "cd $ZK_HOME && tar xf $ZK_HOME/zk.pkg.tar && chmod +x $ZK_HOME/bin/start_zk.sh"
   ssh $zk_host "$ZK_HOME/bin/start_zk.sh $ZK_HOME $zk_server_id" &