Ubuntu System opendaylight Source compilation installation

Source: Internet
Author: User
Tags git clone

Operating system: Linux X64/ubuntu 14.04

Research area: Software-defined Networking Sdn (software-defined Networking)

Development component: Opendaylight

Disclaimer: Reprint Please indicate the source and the article link

First, Environment construction

1. Java+apache MAVEN Basic development environment building. See the corresponding previous two documents:

Java Development Environment Building under the Linux Ubuntu system

Installation and configuration of Apache Maven under the Linux Ubuntu system

2. Install the Git tool to get the Opendaylight source code.

sudo apt-get install Git-core

3. For opendaylight, after installing MAVEN, you need to edit a very important file settings.xml. By modifying the file directly, you can customize MAVEN's behavior globally on the machine. ~/.M2 is the default Maven local repository. There are no settings.xml files in the post-~/.m2 of Maven just installed. Under the/etc/maven there is a settings.xml prototype, in general, we prefer to copy the file to the home directory under the. m2/Directory (here ~ represents the user directory), and then modify the file to customize the behavior of Maven at the user scope. The former is also called the global configuration, which is called the user Configuration. If both are present, their contents are merged and the user-scoped settings.xml takes precedence. Here to create the. M2 folder under the ~/directory, and then execute the Modify command (see official website: https://wiki.opendaylight.org/view/GettingStarted:Development_Environment_Setup):

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

When finished, enter "sudo gedit/.m2/settings.xml" To view settings.xml content, which should appear as follows:

# Shortcut command for grabbing Settings.xmlcp-n ~/.m2/settings.xml{,.orig}; Wget-q-o-https://raw.githubusercontent.com/opendaylight/odlparent/master/settings.xml > ~/.m2/settings.xml <settings xmlns= "http://maven.apache.org/SETTINGS/1.0.0" 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 "> <profiles> <profile> <id>opendaylight-release</id> <repositories> <re          Pository> <id>opendaylight-mirror</id> <name>opendaylight-mirror</name>            <url>http://nexus.opendaylight.org/content/repositories/public/</url> <releases>          <enabled>true</enabled> <updatePolicy>never</updatePolicy> </releases> <snapshots> <enabled>false</enabled> &LT;/SNapshots> </repository> </repositories> <pluginRepositories> <pluginreposit Ory> <id>opendaylight-mirror</id> <name>opendaylight-mirror</name> & Lt;url>http://nexus.opendaylight.org/content/repositories/public/</url> <releases> <          Enabled>true</enabled> <updatePolicy>never</updatePolicy> </releases> <snapshots> <enabled>false</enabled> </snapshots> </pluginreposi tory> </pluginRepositories> </profile> <profile> <id>opendaylight-snapshots< /id> <repositories> <repository> <id>opendaylight-snapshot</id> & Lt;name>opendaylight-snapshot</name> <url>http://nexus.opendaylight.org/content/repositories/ Opendaylight.snapshot/</url> <releases> <enabled>false</enabled> </releases> <sn apshots> <enabled>true</enabled> </snapshots> </repository> &lt ;/repositories> <pluginRepositories> <pluginRepository> <id>opendaylight-snapsho T</id> <name>opendaylight-snapshot</name> <url>http://nexus.opendaylight.org/con Tent/repositories/opendaylight.snapshot/</url> <releases> <enabled>false</enabled > </releases> <snapshots> <enabled>true</enabled> </sn apshots> </pluginRepository> </pluginRepositories> </profile> </profiles> < Activeprofiles> <activeProfile>opendaylight-release</activeProfile> <activeProfile> Opendaylight-snapshots</activeproFile> </activeProfiles></settings> 

Second, Opendaylight source code acquisition, compilation and installation

1. Create a new project folder and get Opendaylight source code:

sudo mkdir opendaylightcd opendaylightsudo git clone https://git.opendaylight.org/gerrit/p/controller.git

2. Specify the version of the compiled ODL (take the lithium lithium version as an example) and check the confirmation:

CD controllersudo git checkout stable/lithiumgit Branch

3. Network compile controller (verify that the previous Settings.xml file has been modified):

MVN clean Install


* If a test compilation error occurs during compilation, you can add-dskiptests skip test to speed up compilation, other compilation errors, and try the solution:

There are two kinds of current encounters: A. Specifies that the directory cannot be created or accessed: Change folder read and Write permissions, and re-compile B into sudo mode. Pom.xml related error: Copy the settings.xml under ~/.M2 to the/ROOT/.M2 directory: sudo cp ~/.m2/settings.xml/root/.m2, recompile compilation succeeded!

4. The controller verifies the operation.

The old version of the directory structure is "Controller/opendaylight/distribution", in the new version of the directory structure no longer exist "distribution" this subfolder, This is why many friends refer to the previous guide but cannot find the distribution subfolder to start the controller. Here should CD enter the "Controller/karaf/opendaylight-karaf" folder, enter:

./target/assembly/bin/karaf

This will start the controller into [email protected]> mode. This time, the Opendaylight controller project initial installation is complete!

  

* Third, Test:integration project source code compilation and installation

* Previously compiled controller projects are core controllers without rich feature such as WebGui (Dlux). Integration is a framework project in which all of the parts that have been developed and modified (including controllers, Openflowplugin&java three projects) are compiled into packages and can be executed together under the catalog of the project. Note that if you are developing your own package, you can drop it directly into that directory. However, if the original project is modified, and then compiled package to replace the original package in the above directory, there is a problem is integration plugin directory under the package name and controller, Openflowplugin, Openflowjava The compiled package naming method is a little different, copy the past before renaming, so that it and the original package file name in the directory consistent, and then copy the replacement. (Refer to the "Opendaylight Development Learning Notes Base Controller" from @jason-zhou children's shoes). After you copy the jar packages from each project into integration, use MVN clean install to compile the integration. directory where the project is located:

[Email protected]:~/developapps/opendaylight/integration/distributions/karaf/target/assembly/system/org/ opendaylight$ lsaaa               Integration      neutron         sdninterfaceapp  uscbgpcep            iotdm            Nic             sfc              vpnservicecapwap            l2switch         odlparent       snmp             vtn<strong><span style= "color: #ff0000;" >controller</span></strong>        LACP             <strong><span style= "color: #ff0000;" >openflowjava</span></strong>    sxp              yangtoolscoretutorials     lispflowmapping  <span style= "color: #ff0000;" ><strong>openflowplugin</strong></span>  tcpmd5didm              mdsal            ovsdb           Topoprocessingdlux              Nemo             packetcable     tsdrgroupbasedpolicy  netconf          reservation     TTP

* Here only the Basic integration project is compiled and installed, and the Openflowplugin and Openflowjava works will be detailed in another article.

1. Download and compile the integration.

Back to Opendaylight root directory, enter the following command to get integration source code:

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

After the operation is completed, you can see that the integration directory is in the directory, enter the integration directory, specify the version (checkout) to Stable/lithium, and compile:

CD integrationgit Checkout stable/lithiummvn clean install-dskiptests        (or CD into subdirectory/distributions/karaf execute this command)

2. When the compilation is complete, enter the integration/distributions/karaf/target/assembly directory and run the following command to start the ODL:

Bin/karaf

At this point, go to the ODL command line interface, the "feature:list-i" command to view the installed function module, through the "feature:install <feature>" command can install the desired feature.

* Karaf module will make the controller's plugin into Karaf Feature and then package it into a Karaf file that can be imported into Apache Kar. Karaf is an OSGi-based operating environment that provides a variety of management utility for OSGi application management containers.

Here, a opendaylight controller that can be used to develop and install a rich feature function module has been basically built.

Ubuntu System opendaylight Source compilation installation

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.