How to deploy self-developed bundle to Opendaylight production environment
来源:互联网 发布:360登录 网络错误 编辑:程序博客网 时间:2024/05/10 11:30
Howto deploy self-developed bundle to Opendaylight production environment
1 Introduction
Apache Karaf provides many convenient ways for bundles installation. But when we develop our user-defined bundles with Opendaylight archtype, it is difficult to deploy these bundles into production environment.
Searching WWW can’t provide useful help. So write this post to record the steps in case someday had been forgotten.
Usually we start our bundle development with mvn command:
mvn archetype:generate \
-DarchetypeGroupId=org.opendaylight.controller \
-DarchetypeArtifactId=opendaylight-startup-archetype \
-DarchetypeVersion=ODLVER\
-DarchetypeRepository=https://nexus.opendaylight.org/content/repositories/public/ \
-DarchetypeCatalog=https://nexus.opendaylight.org/content/repositories/public/archetype-catalog.xml
Where ODLVER may be “1.2.1-Boron-SR1”, “1.1.4-Beryllium-SR4”or others. All available ODLVER values can be achieved from here:
“https://nexus.opendaylight.org/content/repositories/public/org/opendaylight/controller/opendaylight-startup-archetype/”
After successful creation, our project contains at least three submodules: api, impl, and features, carefully write down their “groupId” and “artifactId”. All the submodules have the same“groupId” and different “artifactId”.
Assume project name is “PROJECT”, then their artifactId may be “PROJECT-aggregator”, “PROJECT-api”,and “PROJECT-features”. In the following, symbols of “PROJECT-ID”, “PROJECT-API-ID”and “PROJECT-FEATURES-ID” refer to as their values.
There are two methods to deploy this PROJECT into Opendaylight distribution.
- Build a complete distribution ODL with this PROJECT.
- Singly deploy this PROJECT to a running ODL distribution.
2 Build a complete distribution ODL with this PROJECT
First build ODL distribution, then add this PROJECT into distribution.
1) Checkout ODL distribution from git and build
mvn command:
$ git clone https://git.opendaylight.org/gerrit/integration/distribution
$ cd distribution
$ git tag
$ git checkout release/beryllium-sr4(release/boron-sr1)
$ mvn clean install
2) Add this PROJECT to distribution features
In ODL distribution directory,
File “pom.xml”, add one line as:
<PROJECT.version>here is PROJECT’s version</PROJECT.version>
File “features-index/pom.xml”, add dependency:
<dependency>
<groupId>PROJECT-GROUPID</groupId>
<artifactId>PROJECT-FEATURES-ID</artifactId>
<version>${PROJECT.version}</version>
<classifier>features</classifier>
<type>xml</type>
</dependency>
File “features-index/src/main/resources/features.xml”, add one line:
<repository>mvn:PROJECT-GROUPID/PROJECT-FEATURES-ID/${PROJECT.version}/xml/features</repository>
3) Build a newly distribution which contains this PROJECT.
$ mvn clean install
The newly distribution is created in directory “distribution-karaf\target”
3 Individually deploy PROJECT to a running ODL distribution environment
Apache karaf can load bundles from maven repository. In a running ODL distribution, directory “system” is the maven format directory which contains bundles to load and run.
When our PROJECT develops correctly with no failures of command “mvn clean install”, our PROJECT bundles reside in local maven repository which directory is usually at “~/.m2”.
1) Copy the PROJECT’s bundles to running ODL distribution’s repository “system”
For example from local maven directory:
$ cp –R ~/.m2/repository/org/bupt/ ~/distribution-karaf-0.4.4-Beryllium-SR4/system/org
Or from current PROJECT’s directory (RECOMMENDED!):
$ cp –R karaf/target/assembly/system/org/bupt ~/distribution-karaf-0.4.4-Beryllium-SR4/system/org
2) Add PROJECT’s features to ODL feature-integration-index xml file
Open the running ODL distribution’s “features-integration-index-[RELEASE-VERSION]-features.xml”
For example with Beryllium-SR4, file path is:
“distribution-karaf-0.4.4-Beryllium-SR4/system\org\opendaylight\integration\features-integration-index\0.4.4-Beryllium-SR4/features-integration-index-0.4.4-Beryllium-SR4-features.xml”
Then add one line of PROJECT’s feature repository as following:
<repository>mvn:PROJECT-GROUPID/PROJECT-FEATURES-ID/${PROJECT.version}/xml/features</repository>
3) (Optional) Start odl, and install features repo.
$ ./bin/karaf
opendaylight@root> feature:repo-add mvn:PROJECT-GROUPID/PROJECT-FEATURES-ID/PROJECT-VERSION/xml/features
opendaylight@root> feature:list
opendaylight@root>feature:install <your features>
That is all!
- How to deploy self-developed bundle to Opendaylight production environment
- How To...Deploy to IIS7
- How to release software developed by QT Creator?
- how to java --->environment variable
- Please help to prepare environment of production server
- How to configure environment to use JavaMail?
- How To Migrate Magento From Development To Production Servers
- How to auto build and deploy project
- How to deploy OS in a cluster
- How to Deploy a OAF Files
- How to deploy MapViewer to Oracle WebLogic Server
- How to deploy maven project to tomcat inside your eclipse
- How to Deploy/Publish Jasper Report to Jasper Server
- how to modify Visual Studio 2010 environment
- Bookmarks--How to establish Android Develop Environment
- How to set up CI environment
- how-to-set-environment-path-variable
- how to select checkbox on cli environment?
- JavaWeb学习总结——通用标签和表单标签(尚硅谷_佟刚老师)
- Squid下Http头信息优先级
- JSP动作标签
- 模拟实现strcmp函数
- 基于opencv的ORB算法的提取
- How to deploy self-developed bundle to Opendaylight production environment
- 关于Android高德地图4.12无法显示地图只显示Logo问题,非只添加 jniLibs.srcDirs = ['libs']就解决的
- Angular2路由的简单实用
- 2019: [Usaco2009 Nov]找工作
- Python之syntaxerror invalid syntax,input 也raw_input合并
- xcode导出ipa的几种方式
- sqlserver replace替换text类型字段
- 编程方式刷新Squid缓存服务器的五种方法
- license处理方案