about 7 years ago

Opendaylight for openflow1.3 build on ubuntu 14.04-lts

Preparation

  1. INSTALL ORACLE JAVA 7

    sudo add-apt-repository ppa:webupd8team/java
    sudo apt-get update
    sudo apt-get install oracle-java7-installer
    export JAVA_HOME=/usr/lib/jvm/java-7-oracle/     //you can add it to your bashrc.
    

    Then, you can use 'java -version' to test install successfully.

  2. INSTALL maven

    sudo apt-get install maven
    

    Then, you can use 'mvn -v' to test install successfully.
    如果你完全安裝完,版本應該均要大於下面的範例,(我嘗試到最後這一版是最容易成功的)

    Apache Maven 3.0.5
    Maven home: /usr/share/maven
    Java version: 1.7.0_67, vendor: Oracle Corporation
    Java home: /usr/lib/jvm/java-7-oracle/jre
    Default locale: en_US, platform encoding: UTF-8
    OS name: "linux", version: "3.13.0-32-generic", arch: "amd64", family: "unix"
    
  3. INSTALL git

    sudo apt-get install git
    

    Start building opendaylight

  4. Pull code

    • Here, I use ssh to pull code. If you also want to use 'ssh', you have to register in opendaylight git link. And then, follow Gerrit_Setup to register SSH key.
    • Or, you can use http to git opendaylight file. Please refer to pull code.
    • But I didn't check these are same.
      export ODL_USERNAME=<username for the account you created at OpenDaylight>
      //for example export ODL_USERNAME=tutul
      
      mkdir opendaylight;cd opendaylight
      for PROJECT in affinity bgpcep controller defense4all dlux integration \
      lispflowmapping opendove openflowjava openflowplugin ovsdb vtn yangtools; \
      do git clone ssh://${ODL_USERNAME}@git.opendaylight.org:29418/${PROJECT}.git; \
      done
      
  5. Cmpiling code

    • Set up environment variables
      export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=256m"
      
      Then, start compiler.
    • May be, you need to step by step enforce each command, becouse compiler possibly appear error.
    • However, if controller can be compiled, the Opendaylight can run normally.
    • 因為osgi的架構,所有的專案可以被分開撰寫,但只編譯其中一個專案也是可以run,而核心的專案即是controller,因專案裡會放置基本可以運作的原件,故基本功能均可正常運行。
      (cd controller;mvn clean install)
      (cd affinity;mvn clean install)
      (cd bgpcep;mvn clean install)
      (cd lispflowmapping;mvn clean install)
      (cd openflowjava;mvn clean install)
      (cd openflowplugin;mvn clean install)
      (cd ovsdb/commons/parent;mvn clean install)
      (cd vtn;mvn clean install)
      (cd yangtools;mvn clean install)
      
    • 或這你的需求只是想先編譯稍微測試運作,那麼你可以只編譯下列地方,亦可正常運作。 (cd opendaylight/controller/opendaylight/distribution/opendaylight;mvn clean install)
  6. Run the controller and simply test

    ./controller/opendaylight/distribution/opendaylight/target/distribution.opendaylight-osgipackage/opendaylight/run.sh
    
    • And then, open the browser, input URL 'http://127.0.0.1:8080/'.
    • You will see opendaylight management web site. (default login user name: admin; passwd:admin )
  7. 未完... (還剩測試的部分)

  8. Reference
    http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html
    http://www.jedelman.com/home/getting-opendaylight-installed
    https://wiki.opendaylight.org/view/GettingStarted:Pulling,_Hacking,_and_Pushing_All_the_Code_from_the_CLI

  9. Article update information

    • 2014/9/04 更改為以 14.04 編譯,才成功編過,完整的controller專案
    • 2014/8/02 Add "6.Run the controller and simply test"
    • 2014/7/26 Begin writing this Article.
Archlinux Installation with Raid →