OpenDaylight source code compilation and installation in Ubuntu

Source: Internet
Author: User
Operating System: Linuxx64/Ubuntu14.04 field of study: Software Defined Network (SDN) development component: OpenDaylight I. Environment Construction 1. Java + ApacheMaven basic development environment construction. See the corresponding first two documents: "UbuntuLinux system Java Development Environment Building" http://www.linuxidc.com/

Operating System: Linux x64/Ubuntu 14.04

Research Field: Software defined Network (SDN)

Development component: OpenDaylight

I. Environment Construction

1. Set up the basic development environment for Java + Apache Maven. For more information, see the first two documents:

The Ubuntu Linux system Java Development Environment Building http://www.linuxidc.com/Linux/2015-12/126928.htm

Ubuntu Linux system Apache Maven installation and configuration http://www.linuxidc.com/Linux/2015-12/126929.htm

2. Install the Git tool to obtain the OpenDaylight source code.

Sudo apt-get install git-core

3. After installing Maven for Opendaylight, You need to edit a very important file settings. xml. You can directly modify this file to customize Maven behavior on the machine .~ /. M2 is the default maven local repository. After installing maven ~ /. M2 does not contain the settings. xml file. The configuration. xml prototype is available in/etc/maven. In general, we prefer to copy the file to the. m2/directory under the home Directory (here ~ Directory), and then modify the file to customize Maven behavior within the user scope. The former is also called global configuration, and the latter is called user configuration. If both exist, their content will be merged, and the settings. xml in the user range takes precedence. Here we will go ~ /Directory to create the. m2 folder, and then execute the modify command (see the official website: https://wiki.opendaylight.org/view/GettingStarted:Development_Environment_Setup ):

Sudo mkdir. m2
Sudo cp-n ~ /. M2/settings. xml {,. orig}; \ wget-q-O-https://raw.githubusercontent.com/opendaylight/odlparent/master/settings.xml> ~ /. M2/settings. xml

Enter "sudo gedit/. m2/settings. xml" to view the settings. xml content:

# Export cut command for grabbing settings. xml
Cp-n ~ /. M2/settings. xml {,. orig };\
Wget-q-O-https://raw.githubusercontent.com/opendaylight/odlparent/master/settings.xml> ~ /. M2/settings. xml
Xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance"
Xsi: schemaLocation = "http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
 


Opendaylight-release


Opendaylight-mirror
Opendaylight-mirror
Http://nexus.opendaylight.org/content/repositories/public/

True
Never


False





Opendaylight-mirror
Opendaylight-mirror
Http://nexus.opendaylight.org/content/repositories/public/

True
Never


False




Opendaylight-snapshots


Opendaylight-snapshot
Opendaylight-snapshot
Http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/

False


True





Opendaylight-snapshot
Opendaylight-snapshot
Http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/

False


True





Opendaylight-release
Opendaylight-snapshots

Ii. OpenDaylight source code acquisition, compilation, and installation

1. Create a project folder and obtain the OpenDaylight source code:

Sudo mkdir openDayLight
Cd openDayLight
Sudo git clone https://git.opendaylight.org/gerrit/p/controller.git

2. Specify the ODL version to be compiled (taking Lithium as an example) and check and confirm:

Cd controller
Sudo git checkout stable/lithium
Git branch

3. Compile Controller over the Internet (check that the settings. xml file has been modified ):

Mvn clean install


* If a Test compilation error occurs during compilation, you can add-DskipTests to skip the Test to speed up compilation. Other compilation errors and solutions are as follows:

There are currently two types:
A. The specified directory cannot be created or accessed: Change the folder read and write permissions and re-compile in sudo mode.
B. pom. xml error: Set ~ Copy settings. xml under/. m2 to the/root/. m2 Directory: sudo cp ~ /. M2/settings. xml/root/. m2, recompile
Compiled successfully!

4. Verify the running of the controller.

The directory structure of the old version is "controller/opendaylight/distribution". The new version does not contain the "distribution" sub-folder, this is why many friends refer to the previous guide but cannot find the distribution sub-folder to start the controller. In cd, enter the "controller/karaf/opendaylight-karaf" folder and enter:

./Target/assembly/bin/karaf

The Controller is started to enter the opendaylight-user @ root> mode. At this time, the initial installation of the controller project of Opendaylight is complete!

* 3. TEST: Compile and install the source code of the Integration project

* The previously compiled Controller project does not have core controllers such as WebGUI (DLUX) and rich Feature. Integration is a framework project. After all the self-developed and modified parts (including controller, openflowPlugin & Java) are compiled into a package, can be executed together in the project directory. Note: If you develop your own package, you can directly put it under this directory. However, if the original project is modified and the compiled package must replace the original package in the preceding directory, the problem is that the package name and controller, openflowplugin, under the plugin directory of integration, the package naming method compiled in openflowjava is slightly different. before copying the package, rename it to make the original package file name under the sum directory consistent, and then copy and replace it. (Refer to "Controller of the foundation of the OpenDaylight Development Study Notes" from @ jason-zhou kids shoes.) Copy the jar packages of each project to integration and use mvn clean install to compile integration. Project directory:

Username @ ubuntu :~ /DevelopApps/openDayLight/integration/distributions/karaf/target/assembly/system/org/opendaylight $ ls
Aaa integration neutron sdninterfaceapp usc
Bgpcep iotdm nic sfc vpnservice
Capwap l2switch odlparent snmp vtn
ControllerLacpOpenflowjavaSxp yangtools
Coretutorials lispflowmappingOpenflowpluginTcpmd5
Didm mdsal ovsdb topoprocessing
Dlux nemo packetcable tsdr
Groupbasedpolicy netconf reservation ttp

* Only the compilation and installation steps of the basic Integration project are provided here. The Openflowplugin and Openflowjava projects will be detailed in another article.

1. Download and compile Integration.

Return to the openDaylight root directory and enter the following command to obtain the Integration source code:

Git clone https://git.opendaylight.org/gerrit/p/integration.git

After the operation is complete, you can see an extra integration directory under the Directory and enter the integration directory. The specified version (checkout) is stable/lithium for compilation:

Cd integration
Git checkout stable/lithium
Mvn clean install-DskipTests (or run this command on the cd subdirectory/distributions/karaf)

2. After compilation, go to the integration/distributions/karaf/target/assembly directory and run the following command to start ODL:

Bin/karaf

Go to the ODL command line interface, run the "feature: list-I" command to view the installed functional modules, and run the "feature: install "Command to install the desired feature.

* The Karaf module will generate the Controller plug-in into the Karaf Feature and package it into the kar file that can be imported to Apache karaf. Karaf is based on the OSGI runtime environment and provides various management utility as the management container for OSGI applications.

Here, an OpenDaylight controller that can be used to develop and install a wide range of Feature functional modules has been basically set up.

This article permanently updates the link address: Http://www.linuxidc.com/Linux/2015-12/1269.30htm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.