OpenDaylight作为一种开源的SDN控制器,使用Java语言编写,其运行环境依赖如下图所示:
本次环境搭建使用VMware-workstation虚拟机,操作系统选用Ubuntu-16.04。
一、基础环境安装
1. JVM安装
JVM安装比较简单,这里就不再详细列出。安装完毕,验证JVM是否安装成功,执行命令java -version。
root@ubuntu:/etc/profile.d$ java -version
java version "1.8.0_141"
Java(TM) SE Runtime Environment (build 1.8.0_141-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.141-b15, mixed mode)
2. Maven安装
Maven官网下载安装包:http://maven.apache.org/download.cgi,然后执行如下步骤:
步骤1 解压安装包,执行命令:tar zxvf apache-maven-3.5.0-bin.tar.gz
root@ubuntu:~# tar zxvf apache-maven-3.5.0-bin.tar.gz
apache-maven-3.5.0/README.txt
apache-maven-3.5.0/LICENSE
apache-maven-3.5.0/NOTICE
apache-maven-3.5.0/lib/
步骤2 配置maven环境,执行命令:gedit /etc/profile,并添加如下内容
root@ubuntu:/opt# gedit /etc/profile
export M2_HOME=/opt/maven/apache-maven-3.5.0
export CLASSPATH=**CLASSPATH:**M2_HOME/lib
export PATH=**PATH:**M2_HOME/bin
步骤3 使配置文件生效,执行命令:source /etc/profile
root@ubuntu:/opt# source /etc/profile
步骤4 验证安装是否成功,执行命令: mvn -v
root@ubuntu:/opt# mvn -v
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T12:39:06-07:00)
Maven home: /opt/apache-maven-3.5.0
Java version: 1.8.0_141, vendor: Oracle Corporation
Java home: /home/Java/jdk1.8.0_141/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.4.0-21-generic", arch: "amd64", family: "unix"
二、OpenDaylight controller源码****打包
- 下载Controller源码,链接如下:
https://github.com/opendaylight/controller/tree/stable/carbon
- 下载配套的setting.xml,链接如下:
https://github.com/opendaylight/odlparent/blob/stable/carbon/settings.xml
替换Maven目录下对应的setting.xml文件。
[INFO] Installing /home/test/code/controller/controller-stable-carbon/pom.xml to /home/test/.m2/repository/org/opendaylight/controller/releasepom/0.5.2-SNAPSHOT/releasepom-0.5.2-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] mdsal-artifacts .................................... SUCCESS [ 1.026 s]
[INFO] config-api ......................................... SUCCESS [ 47.387 s]
[INFO] config-subsystem ................................... SUCCESS [ 1.623 s]
[INFO] config-plugin-parent ............................... SUCCESS [ 1.636 s]
[INFO] yang-jmx-generator ................................. SUCCESS [ 20.992 s]
[INFO] yang-jmx-generator-plugin .......................... SUCCESS [ 24.874 s]
[INFO] sal-common-api ..................................... SUCCESS [ 24.677 s]
[INFO] sal-common-util .................................... SUCCESS [ 5.327 s]
[INFO] sal-common-impl .................................... SUCCESS [ 7.426 s]
[INFO] sal-test-model ..................................... SUCCESS [ 17.130 s]
[INFO] sal-core-api ....................................... SUCCESS [ 17.604 s]
[INFO] sal-core-spi ....................................... SUCCESS [ 11.724 s]
[INFO] sal-binding-api .................................... SUCCESS [ 11.374 s]
[INFO] sal-dom-config ..................................... SUCCESS [ 24.495 s]
[INFO] sal-inmemory-datastore ............................. SUCCESS [ 23.517 s]
[INFO] sal-broker-impl .................................... SUCCESS [ 33.522 s]
[INFO] sal-schema-service ................................. SUCCESS [ 4.122 s]
[INFO] sal-binding-util ................................... SUCCESS [ 3.590 s]
[INFO] sal-binding-broker-impl ............................ SUCCESS [ 37.996 s]
[INFO] sal-binding-config ................................. SUCCESS [ 16.008 s]
[INFO] config-parent ...................................... SUCCESS [ 1.297 s]
[INFO] sal-dom-broker-config .............................. SUCCESS [ 8.868 s]
[INFO] md-sal-config ...................................... SUCCESS [ 58.410 s]
[INFO] sample-toaster ..................................... SUCCESS [ 5.353 s]
[INFO] sample-toaster-consumer ............................ SUCCESS [ 4.290 s]
[INFO] sample-toaster-provider ............................ SUCCESS [ 14.800 s]
[INFO] sal-parent ......................................... SUCCESS [ 0.032 s]
[INFO] sal-samples ........................................ SUCCESS [ 0.021 s]
[INFO] clustering-it ...................................... SUCCESS [ 0.019 s]
[INFO] clustering-it-config ............................... SUCCESS [ 0.158 s]
[INFO] clustering-it-model ................................ SUCCESS [ 14.184 s]
[INFO] sal-clustering-commons ............................. SUCCESS [03:32 min]
[INFO] sal-akka-raft ...................................... SUCCESS [02:27 min]
[INFO] cds-access-api ..................................... SUCCESS [ 36.652 s]
[INFO] cds-access-client .................................. SUCCESS [ 43.988 s]
[INFO] cds-dom-api ........................................ SUCCESS [ 10.170 s]
[INFO] sal-akka-raft-example .............................. SUCCESS [ 6.198 s]
[INFO] sal-distributed-datastore .......................... SUCCESS [18:26 min]
[INFO] clustering-it-provider ............................. SUCCESS [ 8.670 s]
[INFO] config-util ........................................ SUCCESS [ 9.823 s]
[INFO] config-manager-facade-xml .......................... SUCCESS [ 10.873 s]
[INFO] blueprint .......................................... SUCCESS [ 39.547 s]
[INFO] netty-config-api ................................... SUCCESS [ 25.094 s]
[INFO] shutdown-api ....................................... SUCCESS [ 3.983 s]
[INFO] config-manager ..................................... SUCCESS [ 21.123 s]
[INFO] shutdown-impl ...................................... SUCCESS [ 21.479 s]
[INFO] features-config .................................... SUCCESS [08:55 min]
[INFO] config-persister-api ............................... SUCCESS [ 5.156 s]
[INFO] config-persister-file-xml-adapter .................. SUCCESS [ 34.080 s]
[INFO] config-persister-directory-xml-adapter ............. SUCCESS [ 6.199 s]
[INFO] config-persister-impl .............................. SUCCESS [ 8.930 s]
[INFO] config-persister-feature-adapter ................... SUCCESS [ 4.236 s]
[INFO] features-config-persister .......................... SUCCESS [01:52 min]
[INFO] netty-event-executor-config ........................ SUCCESS [ 10.106 s]
[INFO] netty-threadgroup-config ........................... SUCCESS [ 8.068 s]
[INFO] threadpool-config-api .............................. SUCCESS [ 3.605 s]
[INFO] threadpool-config-impl ............................. SUCCESS [ 13.322 s]
[INFO] netty-timer-config ................................. SUCCESS [ 8.092 s]
[INFO] config-netty-config ................................ SUCCESS [ 1.593 s]
[INFO] features-config-netty .............................. SUCCESS [ 43.829 s]
[INFO] sal-dom-xsql ....................................... SUCCESS [ 11.506 s]
[INFO] Apache Karaf :: Shell odl/xsql Commands ............ SUCCESS [ 3.207 s]
[INFO] sal-connector-api .................................. SUCCESS [ 4.956 s]
[INFO] sal-dom-xsql-config ................................ SUCCESS [ 0.336 s]
[INFO] sal-clustering-config .............................. SUCCESS [ 0.353 s]
[INFO] sal-cluster-admin-api .............................. SUCCESS [ 6.509 s]
[INFO] sal-cluster-admin-impl ............................. SUCCESS [02:56 min]
[INFO] model-parent ....................................... SUCCESS [ 1.193 s]
[INFO] model-inventory .................................... SUCCESS [ 6.717 s]
[INFO] messagebus-api ..................................... SUCCESS [ 10.494 s]
[INFO] messagebus-util .................................... SUCCESS [01:08 min]
[INFO] messagebus-spi ..................................... SUCCESS [ 5.229 s]
[INFO] messagebus-impl .................................... SUCCESS [ 12.471 s]
[INFO] messagebus-config .................................. SUCCESS [ 0.166 s]
[INFO] sal-remoterpc-connector ............................ SUCCESS [ 54.328 s]
[INFO] features-mdsal ..................................... SUCCESS [09:08 min]
[INFO] config-it-base ..................................... SUCCESS [ 20.035 s]
[INFO] mdsal-it-base ...................................... SUCCESS [ 3.408 s]
[INFO] mdsal-it-parent .................................... SUCCESS [ 4.328 s]
[INFO] sample-toaster-it .................................. SUCCESS [01:13 min]
[INFO] sal-dummy-distributed-datastore .................... SUCCESS [01:19 min]
[INFO] Apache Karaf :: Shell odl/xsql Commands ............ SUCCESS [ 3.235 s]
[INFO] sal-binding-it ..................................... SUCCESS [03:22 min]
[INFO] sal-binding-dom-it ................................. SUCCESS [ 24.840 s]
[INFO] mdsal-trace-api .................................... SUCCESS [ 5.017 s]
[INFO] mdsal-trace-dom-impl ............................... SUCCESS [ 4.111 s]
[INFO] mdsal-trace-binding-impl ........................... SUCCESS [ 1.179 s]
[INFO] mdsal-trace-features ............................... SUCCESS [ 58.111 s]
[INFO] odl-config-api ..................................... SUCCESS [03:04 min]
[INFO] OpenDaylight :: Config :: All ...................... SUCCESS [ 36.601 s]
[INFO] odl-config-core .................................... SUCCESS [ 45.630 s]
[INFO] odl-config-manager ................................. SUCCESS [ 33.703 s]
[INFO] config-persister-feature4-adapter .................. SUCCESS [ 4.383 s]
[INFO] OpenDaylight :: Config Persister ................... SUCCESS [ 36.441 s]
[INFO] OpenDaylight :: Config Persister:: Config Startup .. SUCCESS [ 35.118 s]
[INFO] odl-config-netty-config-api ........................ SUCCESS [ 33.180 s]
[INFO] OpenDaylight :: Config-Netty ....................... SUCCESS [ 37.587 s]
[INFO] OpenDaylight :: MDSAL :: Broker .................... SUCCESS [01:00 min]
[INFO] odl-mdsal-clustering-commons ....................... SUCCESS [ 56.875 s]
[INFO] odl-mdsal-remoterpc-connector ...................... SUCCESS [ 44.190 s]
[INFO] odl-mdsal-distributed-datastore .................... SUCCESS [ 45.558 s]
[INFO] odl-mdsal-broker ................................... SUCCESS [ 56.576 s]
[INFO] OpenDaylight :: TracingBroker ...................... SUCCESS [ 58.356 s]
[INFO] OpenDaylight :: TracingBroker ...................... SUCCESS [01:07 min]
[INFO] mdsal-trace-feature-aggregator ..................... SUCCESS [ 0.065 s]
[INFO] mdsaltrace ......................................... SUCCESS [ 0.020 s]
[INFO] yang-test-plugin ................................... SUCCESS [ 43.954 s]
[INFO] yang-test .......................................... SUCCESS [ 20.250 s]
[INFO] logback-config ..................................... SUCCESS [ 40.587 s]
[INFO] config-artifacts ................................... SUCCESS [ 8.597 s]
[INFO] config-filtering-parent ............................ SUCCESS [ 0.764 s]
[INFO] model-topology ..................................... SUCCESS [ 5.427 s]
[INFO] protocol-framework ................................. SUCCESS [01:20 min]
[INFO] commons.logback_settings ........................... SUCCESS [ 1.911 s]
[INFO] filter-valve ....................................... SUCCESS [ 13.103 s]
[INFO] liblldp ............................................ SUCCESS [ 14.803 s]
[INFO] benchmark-api ...................................... SUCCESS [ 7.957 s]
[INFO] dsbenchmark ........................................ SUCCESS [ 7.287 s]
[INFO] ntfbenchmark ....................................... SUCCESS [ 5.727 s]
[INFO] rpcbenchmark ....................................... SUCCESS [ 5.724 s]
[INFO] benchmark-artifacts ................................ SUCCESS [ 0.024 s]
[INFO] benchmark-aggregator ............................... SUCCESS [ 0.026 s]
[INFO] odl-jolokia-osgi ................................... SUCCESS [ 1.618 s]
[INFO] karaf-parent ....................................... SUCCESS [ 50.587 s]
[INFO] features-extras .................................... SUCCESS [01:22 min]
[INFO] distribution.opendaylight-karaf .................... SUCCESS [05:22 min]
[INFO] opendaylight-karaf-empty ........................... SUCCESS [ 24.427 s]
[INFO] karaf-aggregator ................................... SUCCESS [ 0.080 s]
[INFO] odl-config-all ..................................... SUCCESS [ 39.769 s]
[INFO] features4-config ................................... SUCCESS [ 43.597 s]
[INFO] features-config-aggregator ......................... SUCCESS [ 0.035 s]
[INFO] Opendaylight :: Config Persister:: Mapping for Config Subsystem SUCCESS [ 31.774 s]
[INFO] OpenDaylight :: Config Persister:: All ............. SUCCESS [ 38.429 s]
[INFO] features4-config-persister ......................... SUCCESS [ 40.072 s]
[INFO] features-config-persister-aggregator ............... SUCCESS [ 0.029 s]
[INFO] features4-config-netty ............................. SUCCESS [ 36.761 s]
[INFO] features-config-netty-aggregator ................... SUCCESS [ 0.033 s]
[INFO] odl-clustering-test-app ............................ SUCCESS [01:00 min]
[INFO] odl-mdsal-xsql ..................................... SUCCESS [01:01 min]
[INFO] OpenDaylight :: Toaster ............................ SUCCESS [ 57.820 s]
[INFO] odl-mdsal-all ...................................... SUCCESS [01:03 min]
[INFO] odl-mdsal-clustering ............................... SUCCESS [01:10 min]
[INFO] odl-message-bus-collector .......................... SUCCESS [01:07 min]
[INFO] features4-mdsal .................................... SUCCESS [01:12 min]
[INFO] features-mdsal-aggregator .......................... SUCCESS [ 0.054 s]
[INFO] features-protocol-framework ........................ SUCCESS [ 40.792 s]
[INFO] OpenDaylight :: Protocol Framework ................. SUCCESS [ 36.886 s]
[INFO] features4-protocol-framework ....................... SUCCESS [ 36.158 s]
[INFO] features-protocol-framework-aggregator ............. SUCCESS [ 0.026 s]
[INFO] Jolokia JMX/HTTP bridge ............................ SUCCESS [ 40.450 s]
[INFO] OpenDaylight :: Extras :: All ...................... SUCCESS [ 44.130 s]
[INFO] features4-extras ................................... SUCCESS [ 37.831 s]
[INFO] features-extras-aggregator ......................... SUCCESS [ 0.045 s]
[INFO] features-mdsal-benchmark ........................... SUCCESS [02:57 min]
[INFO] OpenDaylight :: Benchmark :: API ................... SUCCESS [ 33.490 s]
[INFO] OpenDaylight :: dsbenchmark ........................ SUCCESS [ 55.640 s]
[INFO] OpenDaylight :: MD-SAL :: benchmark ................ SUCCESS [ 55.503 s]
[INFO] OpenDaylight :: ntfbenchmark ....................... SUCCESS [ 55.919 s]
[INFO] features4-mdsal-benchmark .......................... SUCCESS [ 54.460 s]
[INFO] features-mdsal-benchmark-aggregator ................ SUCCESS [ 0.040 s]
[INFO] features-controller ................................ SUCCESS [ 0.019 s]
[INFO] archetypes-parent .................................. SUCCESS [ 5.008 s]
[INFO] opendaylight-startup-archetype ..................... SUCCESS [ 27.983 s]
[INFO] controller ......................................... SUCCESS [ 0.015 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:01 h
到现在为止,源码打包成功。
-
JAVA
+关注
关注
19文章
2967浏览量
104745 -
开源
+关注
关注
3文章
3348浏览量
42494 -
sdn
+关注
关注
3文章
254浏览量
44791
发布评论请先 登录
相关推荐
评论