Jump to: navigation, search

Install On Ubuntu 14.04

How to compile ODL on Ubuntu 14.0.4

Ensure you use Ubuntu 14.04.2 LTS (Trusty Tahr)

Now, install a JDK.

# sudo apt-get install openjdk-7-jdk
If you have mvn compile error,  try install java 8 [reference : http://askubuntu.com/questions/464755/how-to-install-openjdk-8-on-14-04-lts]
  #sudo add-apt-repository ppa:webupd8team/java -y
  #sudo apt-get update
  #sudo apt-get install oracle-java8-installer

We need Maven to build ODL. Install the most recent version of Maven

# sudo mkdir -p /usr/local/apache-maven

Download the maven source code

# wget http://ftp.wayne.edu/apache/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz

Now install maven

# sudo mkdir /usr/local/apache-maven
# sudo mv apache-maven-3.3.3-bin.tar.gz /usr/local/apache-maven
# sudo tar -xzvf /usr/local/apache-maven/apache-maven-3.3.3-bin.tar.gz -C /usr/local/apache-maven/
# sudo update-alternatives --install /usr/bin/mvn mvn /usr/local/apache-maven/apache-maven-3.3.3/bin/mvn 1
# sudo update-alternatives --config mvn
# sudo apt-get install vim
# vim ~/.bashrc

Add these to your ~/.bashrc

export M2_HOME=/usr/local/apache-maven/apache-maven-3.3.3
export MAVEN_OPTS="-Xms256m -Xmx512m" # Very important to put the "m" on the end
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 # This matches sudo update-alternatives --config java

If you install jdk version 8, have to change JAVA_HOME like below

export JAVA_HOME=/usr/lib/jvm/java-8-oracle

Use the ~/.bashrc

source ~/.bashrc

Now use git to build ODL

# sudo apt-get install git
# git clone https://git.opendaylight.org/gerrit/integration/distribution

Lesson Learned: You will get a "Parent no found" error unless you have the right settings.xml in your ~/.m2 folder

# curl https://raw.githubusercontent.com/opendaylight/odlparent/master/settings.xml --create-dirs -o ~/.m2/settings.xml
# cd distribution
# mvn clean install -DskipTests

Lesson Learned: Prevent java.net.bind exception.

If you have openvswitch services installed and running, then we need to stop the openvswitch switch and controller services. Otherwise we'll get a "bind to address already in use" error.

# sudo service openvswitch-controller stop
# sudo service openvswitch-switch stop

Run the thing (Takes about 3 minutes to start)

# cd distributions/karaf/target/assembly/bin
# ./karaf -of13

If it hangs, run

# ./karaf clean -of13

Now you can add "Apps." To enable DLUX, and have RESTCONF API control Southbound connections to OVS, you just need to install one APP, which will install all the dependencies.

opendaylight-user@root>feature:install odl-l2switch-switch-ui

Be sure to restart ovs so you can use mininet

# sudo service openvswitch-switch start

If you do not have the openvswitch-switch service, then either use 14.04.02 LTS or run:

# sudo apt-get install openvswitch-switch

Note: You do not need to use OVS for mininet. Mininet supports many virtual switches. See the Mininet FAQ for details.

Install mininet

# sudo apt-get install mininet

Start a mininet

# sudo mn --mac --topo single,3 --controller remote --switch ovsk,protocols=OpenFlow13

In a different shell set the switch to OpenFlow13 (Beware, unlike Karaf "^z and then 'bg %2' the process" doesn't work consistently)

# sudo ovs-vsctl set bridge s1 protocols=OpenFlow13

You can dump the flow table of the mininet switch

# sudo ovs-ofctl -O OpenFlow13 dump-flows s1

You can open the controller at http://127.0.0.1:8181/index.html

Restconf at http://127.0.0.1:8181/restconf/operational/network-topology:network-topology

API browser at http://127.0.0.1:8181/apidoc/explorer/index.html