Allow RAMCloud to start from a configurable option
diff --git a/conf/ramcloud.conf b/conf/ramcloud.conf
index 84b4ff2..ef6881b 100644
--- a/conf/ramcloud.conf
+++ b/conf/ramcloud.conf
@@ -1 +1,2 @@
-ramcloud.coordinator=fast+udp:host=10.128.100.36,port=12246
+ramcloud.coordinatorIp=fast+udp:host=192.168.56.11
+ramcloud.coordinatorPort=port=12246
diff --git a/src/main/java/net/onrc/onos/ofcontroller/core/internal/DeviceStorageImpl.java b/src/main/java/net/onrc/onos/ofcontroller/core/internal/DeviceStorageImpl.java
index 73b0bdb..53a192d 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/core/internal/DeviceStorageImpl.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/core/internal/DeviceStorageImpl.java
@@ -39,8 +39,7 @@
@Override
public void init(final String dbStore, final String conf) {
try {
- ope = GraphDBManager.getDBOperation("ramcloud", "/tmp/ramcloud.conf");
- //ope = GraphDBManager.getDBOperation(dbStore, conf);
+ ope = GraphDBManager.getDBOperation(dbStore, conf);
} catch (Exception e) {
log.error(e.getMessage());
}
diff --git a/src/main/java/net/onrc/onos/ofcontroller/core/internal/LinkStorageImpl.java b/src/main/java/net/onrc/onos/ofcontroller/core/internal/LinkStorageImpl.java
index 66ad0e9..0da9fb8 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/core/internal/LinkStorageImpl.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/core/internal/LinkStorageImpl.java
@@ -33,8 +33,7 @@
*/
@Override
public void init(final String dbStore, final String conf) {
- //this.dbop = GraphDBManager.getDBOperation(dbStore, conf);
- this.dbop = GraphDBManager.getDBOperation("ramcloud", "/tmp/ramcloud.conf");
+ this.dbop = GraphDBManager.getDBOperation(dbStore, conf);
}
diff --git a/src/main/java/net/onrc/onos/ofcontroller/core/internal/SwitchStorageImpl.java b/src/main/java/net/onrc/onos/ofcontroller/core/internal/SwitchStorageImpl.java
index 7c4d9ce..1587629 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/core/internal/SwitchStorageImpl.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/core/internal/SwitchStorageImpl.java
@@ -38,8 +38,7 @@
*/
@Override
public void init(final String dbStore, final String conf) {
- op = GraphDBManager.getDBOperation("ramcloud", "/tmp/ramcloud.conf");
- //op = GraphDBManager.getDBOperation(dbStore, conf);
+ op = GraphDBManager.getDBOperation(dbStore, conf);
}
diff --git a/src/main/java/net/onrc/onos/ofcontroller/core/internal/TopoSwitchServiceImpl.java b/src/main/java/net/onrc/onos/ofcontroller/core/internal/TopoSwitchServiceImpl.java
index c6a5b77..dfd7709 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/core/internal/TopoSwitchServiceImpl.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/core/internal/TopoSwitchServiceImpl.java
@@ -15,8 +15,7 @@
protected final static Logger log = LoggerFactory.getLogger(TopoSwitchServiceImpl.class);
public TopoSwitchServiceImpl(final String dbStore, String conf) {
- op = GraphDBManager.getDBOperation("ramcloud", "/tmp/ramcloud.conf");
- //op = GraphDBManager.getDBOperation(dbStore, conf);;
+ op = GraphDBManager.getDBOperation(dbStore, conf);
}
public TopoSwitchServiceImpl() {
diff --git a/src/main/java/net/onrc/onos/ofcontroller/floodlightlistener/NetworkGraphPublisher.java b/src/main/java/net/onrc/onos/ofcontroller/floodlightlistener/NetworkGraphPublisher.java
index 5cf31f6..2bf4571 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/floodlightlistener/NetworkGraphPublisher.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/floodlightlistener/NetworkGraphPublisher.java
@@ -449,9 +449,7 @@
Map<String, String> configMap = context.getConfigParams(this);
String conf = configMap.get(DBConfigFile);
String dbStore = configMap.get(GraphDBStore);
- System.out.println("conf" + conf + "dbStore" + dbStore);
- op = GraphDBManager.getDBOperation("ramcloud", "/tmp/ramcloud.conf");
- //op = GraphDBManager.getDBOperation(dbStore, conf);
+ op = GraphDBManager.getDBOperation(dbStore, conf);
if (op == null) {
System.out.println("publisher op is null");
}
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java
index 601bccb..3fe3c00 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java
@@ -86,12 +86,8 @@
*/
@Override
public void init(final String dbStore, final String conf) {
- dbHandlerApi = GraphDBManager.getDBOperation("ramcloud", "/tmp/ramcloud.conf");
- dbHandlerInner = GraphDBManager.getDBOperation("ramcloud", "/tmp/ramcloud.conf");
-
- //dbHandlerApi = GraphDBManager.getDBOperation(dbStore, conf);
- //dbHandlerInner = GraphDBManager.getDBOperation(dbStore, conf);
-
+ dbHandlerApi = GraphDBManager.getDBOperation(dbStore, conf);
+ dbHandlerInner = GraphDBManager.getDBOperation(dbStore, conf);
}
/**
diff --git a/src/main/java/net/onrc/onos/ofcontroller/topology/TopologyManager.java b/src/main/java/net/onrc/onos/ofcontroller/topology/TopologyManager.java
index e75a6f2..e246506 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/topology/TopologyManager.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/topology/TopologyManager.java
@@ -80,8 +80,7 @@
*/
public void init(final String dbStore, String config) {
try {
- dbHandler = GraphDBManager.getDBOperation("ramcloud", "/tmp/ramcloud.conf");
- //dbHandler = GraphDBManager.getDBOperation(dbStore, config);
+ dbHandler = GraphDBManager.getDBOperation(dbStore, config);
} catch (Exception e) {
log.error(e.getMessage());
}
diff --git a/start-ramcloud.sh b/start-ramcloud.sh
index 161dc62..c1acc5f 100755
--- a/start-ramcloud.sh
+++ b/start-ramcloud.sh
@@ -1,12 +1,25 @@
#!/bin/bash
+ulimit -c unlimited
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${HOME}/ramcloud/bindings/java/edu/stanford/ramcloud:${HOME}/ramcloud/obj.blueprint-java
+
+function host2ip (){
+ ip=`egrep "$1\$" /etc/hosts |grep -v "ip6"| awk '{print $1}'`
+ echo $ip
+}
+
# Set paths
ONOS_HOME=`dirname $0`
RAMCLOUD_DIR=${HOME}/ramcloud
-LOGDIR=${ONOS_HOME}/ONOS/onos-logs
+LOGDIR=${ONOS_HOME}/onos-logs
RAMCLOUD_LOG=${LOGDIR}/ramcloud.`hostname`.log
-RAMCLOUD_COORDINATOR="fast+udp:host=10.128.4.104,port=12246"
-RAMCLOUD_SERVER="fast+udp:host=10.128.100.35,port=12242"
+thishost=`hostname`
+thisip=`host2ip $thishost`
+coordinatorip=`grep coordinatorIp /tmp/ramcloud.conf | cut -d "=" -f 2,3`
+coordinatorport=`grep coordinatorPort /tmp/ramcloud.conf | cut -d "=" -f 2,3`
+coordinator=`echo $coordinatorip","$coordinatorport`
+RAMCLOUD_COORDINATOR=$coordinator
+RAMCLOUD_SERVER="fast+udp:host=$thisip,port=12242"
function lotate {
logfile=$1
@@ -32,13 +45,12 @@
# Run ramcloud
echo "Starting ramcloud"
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${HOME}/ramcloud/bindings/java/edu/stanford/ramcloud:${HOME}/ramcloud/obj.blueprint-java
- $RAMCLOUD_DIR/obj/server -M -r 0 -L $RAMCLOUD_SERVER -C $RAMCLOUD_COORDINATOR > $RAMCLOUD_LOG 2>&1 &
+ $RAMCLOUD_DIR/obj.blueprint-java/server -M -r 0 -L $RAMCLOUD_SERVER -C $RAMCLOUD_COORDINATOR > $RAMCLOUD_LOG 2>&1 &
}
function stop {
# Kill the existing processes
- capid=`ps -edalf |grep ramcloud |grep obj/server | awk '{print $4}'`
+ capid=`pgrep -f obj.blueprint-java/server | awk '{print $1}'`
pids="$capid"
for p in ${pids}; do
if [ x$p != "x" ]; then
@@ -70,7 +82,7 @@
# deldb
# ;;
status)
- n=`ps -edalf |grep ramcloud |grep obj/server | wc -l`
+ n=`pgrep -f obj.blueprint-java/server | wc -l`
echo "$n ramcloud server running"
;;
*)