OpenDaylight入門之環境搭建


需先行下載的軟件:

  • JVM 1.7 或者更高的版本, 例如:OpenJDK 1.7
  • Git, 用於從Git repository提取ODL(OpenDaylight)控制器
  • Maven

安裝相關軟件,並使用Git提取代碼:

$ sudo apt-get update
$ sudo apt-get install maven git openjdk-7-jre openjdk-7-jdk
$ git clone http://git.opendaylight.org/gerrit/p/controller.git
$ cd controller/opendaylight/distribution/opendaylight/
$ mvn clean install
$ cd target/distribution.opendaylight-0.1.0-SNAPSHOT-osgipackage/opendaylight
$ ./run.sh

 

以為按照上面步驟就能順利安裝,那么你就錯了,總會有些bug。

下面寫寫我所遇到的bug。

1. 下載了controller的git repository之后,發現controller/opendaylight/目錄下並沒有distribution文件夾

也就是需要在controller/目錄下執行一遍mvn clean install(其實我對maven軟件部署一點都不知道,感覺就像是Makefile那樣的)。

然后就會下載一系列的文件,過程有點久,結果遇到類似下面的問題(忘記截圖了):

可以看到是BUILD FAILURE,很多找不到依賴的問題,先不管,打開controller/opendaylight/目錄,發現有distribution了,以為可以繼續最上面的過程,要成功了,但又出現一些問題,執行下面命令,得到結果

$ cd controller/opendaylight/distribution/opendaylight/
$ mvn clean install

不知道怎么弄了,distribution下沒有target目錄,肯定沒成功。

於是又找到一篇文章OpenDaylight開發學習筆記基礎之Controller篇照着瞎折騰,

在controller/目錄和controller/opendaylight/distribution/opendaylight/目錄都mvn clean install一遍,想着不成功就不弄了,每次install都要幾分鍾,最后居然讓我看到了BUILD SUCCESS,警告什么的都不管了:

然后執行如下命令:
$ cd target/distribution.opendaylight-0.1.0-SNAPSHOT-osgipackage/opendaylight $ ./run.sh
在瀏覽器輸入localhost:8080,總算是成功了。



參考資料:
1. OpenDaylight Controller:Pulling, Hacking, and Pushing the Code from the CLI
2. OpenDaylight開發學習筆記基礎之Controller篇

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM