从零开始学OpenDaylight之五:Hello安装到Controller

 一、手动拷贝方式

1. 将Hello项目生成的发布包拷贝至ODL发布版本的

 Hello项目(mvn clean install)后,Hello的feature存在于karaf/target/assembly/system目录下,更进一步\karaf\target\assembly\system\org\opendaylight

 

其中,org\opendaylight为输入的groupId的值

2. 安装Hello组件:

(1) 启动OpenDayLight: 

D:\CODE\distribution-karaf-0.6.0-Carbon\bin>karaf
Apache Karaf starting up. Press Enter to open the shell now...
100% [========================================================================]

Karaf started in 26s. Bundle stats: 296 active, 296 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.

(2). 将Hello 仓库添加到featue list中:

opendaylight-user@root>feature:repo-add mvn:org.opendaylight.hello/hello-features/0.1.0-SNAPSHOT/xml/features
Adding feature url mvn:org.opendaylight.hello/hello-features/0.1.0-SNAPSHOT/xml/features

其中斜体部分的值在:D:\CODE\odlexample\hello\hello\karaf\target\assembly\etc\org.apache.karaf.features.cfg 文件的最后部分:

featuresRepositories = mvn:org.apache.karaf.features/standard/3.0.8/xml/features,mvn:org.apache.karaf.features/enterprise/3.0.8/xml/features,mvn:org.ops4j.pax.web/pax-web-features/3.2.9/xml/features,mvn:org.apache.karaf.features/spring/3.0.8/xml/features,mvn:org.opendaylight.hello/hello-features/0.1.0-SNAPSHOT/xml/features

 

(3). 查看hello是否已安装:

opendaylight-user@root>feature:list|grep hello
odl-hello-api | 0.1.0-SNAPSHOT | | odl-hello-0.1.0-SNAPSHOT | OpenDaylight :: hello :: api
odl-hello | 0.1.0-SNAPSHOT | | odl-hello-0.1.0-SNAPSHOT | OpenDaylight :: hello
odl-hello-rest | 0.1.0-SNAPSHOT | | odl-hello-0.1.0-SNAPSHOT | OpenDaylight :: hello :: REST
odl-hello-ui | 0.1.0-SNAPSHOT | | odl-hello-0.1.0-SNAPSHOT | OpenDaylight :: hello :: UI
odl-hello-cli | 0.1.0-SNAPSHOT | | odl-hello-0.1.0-SNAPSHOT | OpenDaylight :: hello :: CLI
opendaylight-user@root>feature:list -i | grep hello

(4). 安装Hello:

opendaylight-user@root>feature:install odl-hello-ui
opendaylight-user@root>feature:list -i | grep hello
odl-hello-api | 0.1.0-SNAPSHOT | x | odl-hello-0.1.0-SNAPSHOT | OpenDaylight :: hello :: api
odl-hello | 0.1.0-SNAPSHOT | x | odl-hello-0.1.0-SNAPSHOT | OpenDaylight :: hello
odl-hello-rest | 0.1.0-SNAPSHOT | x | odl-hello-0.1.0-SNAPSHOT | OpenDaylight :: hello :: REST
odl-hello-ui | 0.1.0-SNAPSHOT | x | odl-hello-0.1.0-SNAPSHOT | OpenDaylight :: hello :: UI

如果要将hello移除feature list,使用 feature:repo-remove mvn:org.opendaylight.hello/hello-features/0.1.0-SNAPSHOT/xml/features

移除后,查不到,装不上

opendaylight-user@root> feature:repo-remove mvn:org.opendaylight.hello/hello-features/0.1.0-SNAPSHOT/xml/features
opendaylight-user@root>feature:list -i | grep hello
opendaylight-user@root>feature:list|grep hello
opendaylight-user@root>feature:install odl-hello-ui
Error executing command: Can't install feature odl-hello-ui/0.0.0:
null

二、 编译方式:

   参考链接:http://www.sdnlab.com/17863.html

 

转载于:https://www.cnblogs.com/FrankZhou2017/p/7251168.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值