原文地址:https://blog.csdn.net/u010827484/article/details/81222622
1、部署基础环境

1.1 安装 git

sudo apt-get install git

1.2 安装 Maven

sudo apt-get install maven安装完成后:
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...done.
done.
root@ubuntu:/home/odl#测试java环境:
root@ubuntu:/home/odl# java -version

2、创建sfc-oxygen目录并下载ODL代码到sfc-oxygen目录,然后切换到oxygen的稳定分支:

git clone https://git.opendaylight.org/gerrit/p/sfc.git  --branch stable/oxygen --single-branch sfc-oxygen下载完成后:
root@ubuntu:/home/odl# git clone https://git.opendaylight.org/gerrit/p/sfc.git  --branch stable/oxygen --single-branch sfc-oxygen
Cloning into 'sfc-oxygen'...
remote: Finding sources: 100% (26479/26479)
remote: Total 26479 (delta 9512), reused 26193 (delta 9512)
Receiving objects: 100% (26479/26479), 17.90 MiB | 275.00 KiB/s, done.
Resolving deltas: 100% (9512/9512), done.
Checking connectivity... done.
root@ubuntu:/home/odl# cd sfc-oxygen/
root@ubuntu:/home/odl/sfc-oxygen# git branch
* stable/oxygen
root@ubuntu:/home/odl/sfc-oxygen#

3、编译 opendaylight 过程中可能会因为网络的原因下载失败,只需要重新编译就行

设置maven堆空间,有助于编译过程,节约编译时间:

export MAVEN_OPTS=’-Xmx1048m -XX:MaxPermSize=512m’

you can increase the heap space, the -Xmx setting, to greater than 1G if memory is available. When building in maven, the max memory reached will be displayed at the end of the build. You can use this as a guide to determine if more memory would help decrease build times. Approx 1.5G of RAM is needed by the JVM to run the Helium Controller repeatedly and avoid OOM errors.

开始编译:–DskipTests:跳过测试过程,可以节约很多时间
mvn clean install -DskipTests提示如下错误:
root@ubuntu:/home/odl/sfc-oxygen# mvn clean install -DskipTests
Warning: JAVA_HOME environment variable is not set.
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for org.opendaylight.sfc:sfc-parent:0.7.3-SNAPSHOT: Could not find artifact org.opendaylight.mdsal:binding-parent:pom:0.12.3-SNAPSHOT and 'parent.relativePath' points at no local POM @ line 6, column 11@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project org.opendaylight.sfc:sfc-parent:0.7.3-SNAPSHOT (/home/odl/sfc-oxygen/pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for org.opendaylight.sfc:sfc-parent:0.7.3-SNAPSHOT: Could not find artifact org.opendaylight.mdsal:binding-parent:pom:0.12.3-SNAPSHOT and 'parent.relativePath' points at no local POM @ line 6, column 11 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
root@ubuntu:/home/odl/sfc-oxygen#

以上错误原因是ODL编译过程中Maven会下载很多包,但是找不到下载的源需要在当前用户目录加上settings.xml

下载Opendaylight官网提供的settings.xml并保存在当前用户目录:root@ubuntu:/home/odl/sfc-oxygen# wget -q -O - https://raw.githubusercontent.com/opendaylight/odlparent/master/settings.xml > ~/.m2/settings.xml

重新编译 ODL:

root@ubuntu:/home/odl/sfc-oxygen# mvn clean install –DskipTestsWarning: JAVA_HOME environment variable is not set.
[INFO] Scanning for projects...
Downloading: https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/org/opendaylight/mdsal/binding-parent/0.12.3-SNAPSHOT/maven-metadata.xml
Downloaded: https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/org/opendaylight/mdsal/binding-parent/0.12.3-SNAPSHOT/maven-metadata.xml (617 B at 0.1 KB/sec)
Downloading: https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/org/opendaylight/mdsal/binding-parent/0.12.3-SNAPSHOT/binding-parent-0.12.3-20180722.142257-14.pom

出错了…分析错误原因是因为在java环境中没有tools.jar包,查看java安装目录找不到这个包,还是重新装java:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 07:43 min
[INFO] Finished at: 2018-07-25T04:10:06-07:00
[INFO] Final Memory: 118M/233M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.17:check (check-license) on project sfc-parent: Execution check-license of goal org.apache.maven.plugins:maven-checkstyle-plugin:2.17:check failed: Plugin org.apache.maven.plugins:maven-checkstyle-plugin:2.17 or one of its dependencies could not be resolved: Could not find artifact com.sun:tools:jar:1.8.0 at specified path /usr/lib/jvm/java-8-openjdk-amd64/jre/../lib/tools.jar -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
root@ubuntu:/home/odl/sfc-oxygen#

安装java:

1、卸载现有java
apt-get --purge remove java-common2、安装java添加ppa
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update安装oracle-java-installer
sudo apt-get install oracle-java8-installer设置系统默认jdk
sudo update-java-alternatives -s java-8-oraclejava安装测试
java -version
javac -version导出JAVA安装目录到环境变量:
export JAVA_HOME=/usr/lib/jvm/java-8-oracle/3、重新安装Maven,卸载java-common时会卸载掉mvn命令,重新安装就可以了
sudo apt-get install maven

又出错了…

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 33:17 min
[INFO] Finished at: 2018-07-25T05:17:44-07:00
[INFO] Final Memory: 162M/233M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:0.0.24:bower (bower) on project sfc-ui-module: Failed to run task: 'bower install' failed. (error code 1) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :sfc-ui-module
root@ubuntu:/home/odl/sfc-oxygen#

分析出错原因,是因为系统没有bower,安装bower后重新编译ODL

root@ubuntu:/home/odl/sfc-oxygen# apt-get install npm
root@ubuntu:/home/odl/sfc-oxygen# npm install bower -g
npm WARN deprecated bower@1.8.4: We don't recommend using Bower for new projects. Please consider Yarn and Webpack or Parcel. You can read how to migrate legacy project here: https://bower.io/blog/2017/how-to-migrate-away-from-bower/
/usr/local/bin/bower -> /usr/local/lib/node_modules/bower/bin/bower
/usr/local/lib
└── bower@1.8.4

继续出错……

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 07:37 min
[INFO] Finished at: 2018-07-25T05:55:52-07:00
[INFO] Final Memory: 164M/233M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:0.0.24:bower (bower) on project sfc-ui-module: Failed to run task: 'bower install' failed. (error code 1) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :sfc-ui-module

google后知道mvn使用root编译需要加上如下参数,继续编译

echo '{ "allow_root": true }' > /root/.bowerrc

大概需要2个小时,编译完成

SFC部署

1、进入karaf目录:

/home/odl/sfc-oxygen/karaf/target/assembly

2、删除karaf历史数据:

rm instances/ journal/ data/cache/ -rf

3、启动odl

root@ubuntu:/home/odl/sfc-oxygen/karaf/target/assembly# ./bin/karaf clean
Apache Karaf starting up. Press Enter to open the shell now...
100% [========================================================================]Karaf started in 1s. Bundle stats: 13 active, 13 total________                       ________                .__  .__       .__     __       \_____  \ ______   ____   ____ \______ \ _____  ___.__.|  | |__| ____ |  |___/  |_     /   |   \\____ \_/ __ \ /    \ |    |  \\__  \<   |  ||  | |  |/ ___\|  |  \   __\    /    |    \  |_> >  ___/|   |  \|    `   \/ __ \\___  ||  |_|  / /_/  >   Y  \  |      \_______  /   __/ \___  >___|  /_______  (____  / ____||____/__\___  /|___|  /__|      \/|__|        \/     \/        \/     \/\/            /_____/      \/          Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown OpenDaylight.opendaylight-user@root>

当前ODL只有基础组件,需要安装SFC环境需要的组件

opendaylight-user@root>feature:list -i
Name                                 │ Version │ Required │ State   │ Repository                           │ Description
─────────────────────────────────────┼─────────┼──────────┼─────────┼──────────────────────────────────────┼──────────────────────────────────────────────────
31c3ba29-4dc2-4fff-a491-3a8393c9ab46 │ 0.0.0   │ x        │ Started │ 3a6a1663-0dfe-4efd-8ae1-127045152b07 │
aries-proxy                          │ 4.1.5   │          │ Started │ standard-4.1.5                       │ Aries Proxy
aries-blueprint                      │ 4.1.5   │          │ Started │ standard-4.1.5                       │ Aries Blueprint
feature                              │ 4.1.5   │          │ Started │ standard-4.1.5                       │ Features Support
shell                                │ 4.1.5   │          │ Started │ standard-4.1.5                       │ Karaf Shell
shell-compat                         │ 4.1.5   │          │ Started │ standard-4.1.5                       │ Karaf Shell Compatibility
deployer                             │ 4.1.5   │          │ Started │ standard-4.1.5                       │ Karaf Deployer
bundle                               │ 4.1.5   │          │ Started │ standard-4.1.5                       │ Provide Bundle support
config                               │ 4.1.5   │          │ Started │ standard-4.1.5                       │ Provide OSGi ConfigAdmin support
diagnostic                           │ 4.1.5   │          │ Started │ standard-4.1.5                       │ Provide Diagnostic support
instance                             │ 4.1.5   │          │ Started │ standard-4.1.5                       │ Provide Instance support
jaas                                 │ 4.1.5   │          │ Started │ standard-4.1.5                       │ Provide JAAS support
log                                  │ 4.1.5   │          │ Started │ standard-4.1.5                       │ Provide Log support
package                              │ 4.1.5   │          │ Started │ standard-4.1.5                       │ Package commands and mbeans
service                              │ 4.1.5   │          │ Started │ standard-4.1.5                       │ Provide Service support
system                               │ 4.1.5   │          │ Started │ standard-4.1.5                       │ Provide System support
kar                                  │ 4.1.5   │          │ Started │ standard-4.1.5                       │ Provide KAR (KARaf archive) support
ssh                                  │ 4.1.5   │          │ Started │ standard-4.1.5                       │ Provide a SSHd server on Karaf
management                           │ 4.1.5   │          │ Started │ standard-4.1.5                       │ Provide a JMX MBeanServer and a set of MBeans in
wrap                                 │ 0.0.0   │          │ Started │ standard-4.1.5                       │ Wrap URL handler
standard                             │ 4.1.5   │          │ Started │ standard-4.1.5                       │ Wrap feature describing all features part of a st
opendaylight-user@root> 

根据SFC架构,北向接口需要安装restconf相关组件,南向接口需要安装netconf相关组件以及南北向抽象层mdsal的相关组件和提供SFC功能的核心组件:

opendaylight-user@root>feature:install odl-netconf-api odl-netconf-mapping-api odl-netconf-util odl-netconf-netty-util odl-netconf-client odl-sfc-netconf odl-netconf-connector-all odl-netconf-notifications-api odl-mdsal-apidocs odl-mdsal-models odl-mdsal-binding odl-mdsal-binding-runtime odl-mdsal-common odl-mdsal-broker odl-mdsal-clustering-commons odl-mdsal-distributed-datastore odl-mdsal-remoterpc-connector odl-mdsal-broker-local odl-restconf odl-restconf-noauth odl-sfc-model odl-sfc-provider odl-sfc-provider-rest  odl-sfc-ovs odl-sfc-ui odl-sfc-sb-rest odl-sfc-openflow-renderer
opendaylight-user@root>

《Cisco VPP SFC》4、ODL SFC 安装相关推荐

  1. 《Cisco VPP SFC 》1、 VPP 安装

    原文地址:https://blog.csdn.net/u010827484/article/details/81029919 基础环境 Linux ubuntu 4.13.0-36-generic # ...

  2. 使用GNS3和Cisco IOU搭建路由交换实验-安装篇

    如何使用GNS3和Cisco IOU搭建路由交换实验-安装篇 GNS3软件的安装 建议大家从官网直接下载最新版本的GNS3,官网连接http://www.gns3.com/ 根据系统类型选择相应的版本 ...

  3. CISCO内网客户端软件anyconnect-win安装下载

    ❤️CISCO内网客户端软件anyconnect-win安装下载 功能作用:用来连接内网

  4. Cisco Packet Tracer软件的下载安装

    Cisco Packet Tracer软件的下载安装 计算机网络实验需要下载安装Cisco Packet Trace 1.下载安装 https://www.bilibili.com/video/BV1 ...

  5. cisco packet tracer8.2.0下载安装教程

    您可以参考以下步骤来安装Cisco Packet Tracer 8.2.0: 下载Cisco Packet Tracer 8.2.0安装文件. 双击安装文件,根据屏幕上的提示进行安装. 安装完成后,运 ...

  6. 《Cisco VPP SFC》2、NSH_SFC 安装

    原文地址:https://blog.csdn.net/u010827484/article/details/81031539 SFC概念 SFC是Service Function Chain的缩写,直 ...

  7. Cisco Packet Tracer 6.0下载安装及汉化包使用方法

    1.下载Cisco Packet Tracer 6.0安装程序 2.下载完成之后是一个exe文件,双击打开 3.点击next 4.点击第一项我同意 5.选择安装位置 6.点击next等待安装完成,中间 ...

  8. Cisco VPP(1) 简介

    一.简介 VPP全称Vector Packet Processing,是Cisco2002年开发的商用代码. 2016年2月11号,Linux基金会创建FD.io项目.Cisco将VPP代码的开源版本 ...

  9. java sfc模拟器_Higan(sfc超精准模拟器)

    Higan模拟器是一款极其小众且使用麻烦的游戏平台模拟器,虽然使用起来麻烦,但是其全面性和精准性最让用户津津乐道,有些比较老一点的游戏通过它都能完美运行,就比如雅达利系列的卡带游戏,用其他模拟器都可能 ...

  10. Cisco Packet Tracer 6.0下载安装及汉化包使用方法无积分版

    1.下载Cisco Packet Tracer 6.0安装程序 网盘链接:https://pan.baidu.com/s/1CmnxAD9MkCtE7pc8Tjw0IA  提取码:frkb  2.下载 ...

最新文章

  1. 51nod 1298:圆与三角形(计算几何)
  2. 《我在51CTO微职位学软考——奋发之路》
  3. OpenCV图像处理——修复失焦模糊的图像
  4. Redux中的重要概念
  5. 【Qt】Qt窗口几何布局
  6. 在IIS上部署你的ASP.NET Core项目
  7. matlab向量归一化_已知近似的特征值,求特征向量
  8. (软件工程复习核心重点)第三章需求分析-第五节:验证软件需求
  9. 学习Numpy,看这篇文章就够啦
  10. SSH远程管理OpenSSH使用
  11. BlackBerry 开发笔记入门 J2ME
  12. 数据结构——二叉排序树
  13. 高通qxdm抓取sensor的log【学习笔记】
  14. Win10系统盘瘦身
  15. 2019重庆大学计算机学院研究生,【计算机】计算机学院举行2019级研究生年级大会...
  16. Pymoo:优化算法的性能指标(Performance Indicators)
  17. Centos7,离线yum源下载,搭建
  18. 言语如何成为交互设计的基础
  19. Scratch学习有什么优点
  20. MongoDB Node 驱动使用指南

热门文章

  1. 计算机的硬盘驱动器是一种,计算机中有两个硬盘驱动器,如何在另一个硬盘驱动器上安装系统?...
  2. oracle sysdate毫秒,oracle systimestamp(sysdate)到毫秒
  3. C#开发斑马RFID打印机zt410
  4. BOF和EOF的区别
  5. 小白刷LeeCode(算法篇):4
  6. socket写超时c语言,设置socket超时时间
  7. Effective Java 2.0_中英文对照_Item 6
  8. 126邮箱自动登录程序
  9. 转载:《星际争霸》星际争霸战略战术的发展和创新
  10. 支付宝支付(详细版)