Added RAMCloud replication parameter to cluster script.
Modified onos.sh so that RAMCloud host parameter falls back to hostname.
Added usage for "deldb" option to onos.sh.
Added interactive confirmation of deldb to onos.sh.

Change-Id: Icf7022574758bc544d1e2f85abc0f83a7e8e48d8
diff --git a/cluster-mgmt/conf/onos-cluster.conf b/cluster-mgmt/conf/onos-cluster.conf
index d36dd35..ddf99b2 100644
--- a/cluster-mgmt/conf/onos-cluster.conf
+++ b/cluster-mgmt/conf/onos-cluster.conf
@@ -10,6 +10,10 @@
 # Protocol used by RAMCloud cluster (fast+udp by default)
 #cluster.hosts.ramcloud.protocol = fast+udp
 
+# Number of RAMCloud replicas (0 by default)
+# On N node cluster, maximum value will be N-1 replicas
+#cluster.hosts.ramcloud.server.replicas = 0
+
 # Communication method used for Hazelcast communication
 #cluster.hosts.hazelcast.network = multicast
 cluster.hosts.hazelcast.network = tcp-ip
diff --git a/cluster-mgmt/conf/template/onos_node.conf.template b/cluster-mgmt/conf/template/onos_node.conf.template
index b6e069d..0dadf66 100644
--- a/cluster-mgmt/conf/template/onos_node.conf.template
+++ b/cluster-mgmt/conf/template/onos_node.conf.template
@@ -32,6 +32,11 @@
 # Port number of RAMCloud server (12242 by default)
 ramcloud.server.port = __RAMCLOUD_SERVER_PORT__
 
+# RAMCloud server option replicas (0 by default)
+# This value must be the same cluster wide.
+# On N node cluster, maximum value will be N-1 replicas
+ramcloud.server.replicas = __RAMCLOUD_SERVER_REPLICAS__
+
 # List of hostname/ip[:port] which forms Hazelcast datagrid
 # If this value is empty, Hazelcast will be set to multicast mode.
 # Inversely, if this value is set, multicast settings will be ignored.
diff --git a/cluster-mgmt/onos-cluster.sh b/cluster-mgmt/onos-cluster.sh
index 0e03c29..fac7110 100755
--- a/cluster-mgmt/onos-cluster.sh
+++ b/cluster-mgmt/onos-cluster.sh
@@ -31,12 +31,13 @@
   echo "${CLUSTER_CONF} not found."
   exit 1
 fi
-CLUSTER_HOSTS=$(read-conf ${CLUSTER_CONF}       cluster.hosts.names             `hostname` | tr ',' ' ')
-CLUSTER_BACKEND=$(read-conf ${CLUSTER_CONF}     cluster.hosts.backend)
-CLUSTER_RC_PROTOCOL=$(read-conf ${CLUSTER_CONF} cluster.hosts.ramcloud.protocol "fast+udp")
-CLUSTER_HC_NETWORK=$(read-conf ${CLUSTER_CONF}  cluster.hosts.hazelcast.network)
-CLUSTER_HC_ADDR=$(read-conf ${CLUSTER_CONF}     cluster.hosts.hazelcast.multicast.address "224.2.2.3")
-CLUSTER_HC_PORT=$(read-conf ${CLUSTER_CONF}     cluster.hosts.hazelcast.multicast.port    "54327")
+CLUSTER_HOSTS=$(read-conf ${CLUSTER_CONF}              cluster.hosts.names                       `hostname` | tr ',' ' ')
+CLUSTER_BACKEND=$(read-conf ${CLUSTER_CONF}            cluster.hosts.backend)
+CLUSTER_RC_PROTOCOL=$(read-conf ${CLUSTER_CONF}        cluster.hosts.ramcloud.protocol           "fast+udp")
+CLUSTER_RC_SERVER_REPLICAS=$(read-conf ${CLUSTER_CONF} cluster.hosts.ramcloud.server.replicas    "0")
+CLUSTER_HC_NETWORK=$(read-conf ${CLUSTER_CONF}         cluster.hosts.hazelcast.network)
+CLUSTER_HC_ADDR=$(read-conf ${CLUSTER_CONF}            cluster.hosts.hazelcast.multicast.address "224.2.2.3")
+CLUSTER_HC_PORT=$(read-conf ${CLUSTER_CONF}            cluster.hosts.hazelcast.multicast.port    "54327")
 ############################################
 
 
@@ -192,6 +193,7 @@
   sed -i -e "s|__RAMCLOUD_IP__|${rc_ip}|" ${tempfile}
   sed -i -e "s|__RAMCLOUD_COORD_PORT__|${rc_coord_port}|" ${tempfile}
   sed -i -e "s|__RAMCLOUD_SERVER_PORT__|${rc_server_port}|" ${tempfile}
+  sed -i -e "s|__RAMCLOUD_SERVER_REPLICAS__|${CLUSTER_RC_SV_REPLICAS}|" ${tempfile}
   
   if [ ${CLUSTER_HC_NETWORK} = "tcp-ip" ]; then
     sed -i -e "s|__HAZELCAST_MEMBERS__|${hc_hosts}|" ${tempfile}