Umesh Krishnaswamy | b676ca2 | 2013-01-11 12:39:25 -0800 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | # Set paths |
| 4 | FL_HOME=`dirname $0` |
| 5 | FL_JAR="${FL_HOME}/target/floodlight.jar" |
| 6 | FL_LOGBACK="${FL_HOME}/logback.xml" |
| 7 | |
| 8 | # Set JVM options |
| 9 | JVM_OPTS="" |
| 10 | #JVM_OPTS="$JVM_OPTS -server -d64" |
| 11 | #JVM_OPTS="$JVM_OPTS -Xmx2g -Xms2g -Xmn800m" |
| 12 | #JVM_OPTS="$JVM_OPTS -XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods" |
| 13 | #JVM_OPTS="$JVM_OPTS -XX:MaxInlineSize=8192 -XX:FreqInlineSize=8192" |
| 14 | #JVM_OPTS="$JVM_OPTS -XX:CompileThreshold=1500 -XX:PreBlockSpin=8" |
| 15 | #JVM_OPTS="$JVM_OPTS -Dpython.security.respectJavaAccessibility=false" |
| 16 | |
| 17 | # Set classpath to include titan libs |
| 18 | CLASSPATH=`echo ${FL_HOME}/lib/*.jar ${FL_HOME}/lib/titan/*.jar | sed 's/ /:/g'` |
| 19 | |
| 20 | |
| 21 | # Create a logback file if required |
| 22 | cat <<EOF_LOGBACK >${FL_LOGBACK} |
| 23 | <configuration scan="true" debug="true"> |
| 24 | <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> |
| 25 | <encoder> |
| 26 | <pattern>%level [%logger:%thread] %msg%n</pattern> |
| 27 | </encoder> |
| 28 | </appender> |
| 29 | |
| 30 | <appender name="FILE" class="ch.qos.logback.core.FileAppender"> |
| 31 | <file>onos.log</file> |
| 32 | <encoder> |
| 33 | <pattern>%date %level [%thread] %logger{10} [%file:%line] %msg%n</pattern> |
| 34 | </encoder> |
| 35 | </appender> |
| 36 | |
| 37 | <logger name="org" level="WARN"/> |
| 38 | <logger name="LogService" level="WARN"/> <!-- Restlet access logging --> |
| 39 | <logger name="net.floodlightcontroller.logging" level="WARN"/> |
| 40 | |
| 41 | <root level="DEBUG"> |
| 42 | <appender-ref ref="STDOUT" /> |
| 43 | <appender-ref ref="FILE" /> |
| 44 | </root> |
| 45 | </configuration> |
| 46 | EOF_LOGBACK |
| 47 | |
| 48 | # Delete and recreate /tmp/netmap |
Umesh Krishnaswamy | 84f0cac | 2013-01-23 19:07:13 -0800 | [diff] [blame] | 49 | rm -rf /tmp/cassandra.titan |
| 50 | mkdir /tmp/cassandra.titan |
| 51 | |
| 52 | # Clear logs |
| 53 | rm onos.log |
Umesh Krishnaswamy | b676ca2 | 2013-01-11 12:39:25 -0800 | [diff] [blame] | 54 | |
| 55 | # Run floodlight |
| 56 | echo "Starting ONOS controller ..." |
| 57 | echo |
| 58 | java ${JVM_OPTS} -Dlogback.configurationFile=${FL_LOGBACK} -Xbootclasspath/a:$CLASSPATH -jar ${FL_JAR} -cf ./onos.properties |