Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

ONOS-1.6.0 source code installation

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces how to install onos-1.6.0 under Ubuntu16.0.4 system.

1 tools and raw materials

Java8 JDK

ApacheMaven (3.0 and later)

ApacheKaraf (3.0.5 and later)

Git (if you don't use git to get the source code, you don't need to install git. I have downloaded all the source code packages here)

2 installation dependency

2.1 install Java8

There are two ways for Ubuntu to install JDK:

Install via ppa (source)

Download the package and install it through the official website.

Note: the first method is recommended, because it is easy to use apt-get upgrade to obtain the upgrade of jdk, but I use the second method to install it here because of the network speed.

The installation of the package is divided into five steps:

2.1.1 download the JKD package on the official website

Download address: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Select tar.gz package download for linux x64 platform

2.1.2 extract to the specified directory

Jdk-8u102-linux-x64.tar.gz is used here for installation.

Create a directory

Sudo mkdir / usr/lib/jvm

Extract to this directory

Sudo tar-zxvf jdk-8u102-linux-x64.tar.gz-C / usr/lib/jvm

2.1.3 configure environment variables

Vim / .bashrc

Append something to the end of the file:

Export JAVA_HOME=/usr/lib/jvm/jdk1.8.0

Export JRE_HOME=$JAVA_HOME/jre

Export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib

Export PATH=$JAVA_HOME/bin:$PATH

Make the environment variable take effect immediately:

Source / .bashrc

2.1.4 set the system default JDK

Sudo update-alternatives-install / usr/bin/javajava / usr/lib/jvm/jdk1.8.0/bin/java 300

Sudo update-alternatives-install / usr/bin/javacjavac / usr/lib/jvm/jdk1.8.0/bin/javac 300

2.1.5 Test results

Java-version

2.2 install apache-karaf

Upload the downloaded apache-karaf package to the Downloads directory through the sftp tool (apache-karaf uses version 3.0.5 or above, apache-karaf-3.0.8.tar.gz is used here).

Create an Applications folder (for installing karaf and maven)

Mkdir ~ / Applications

Enter the Downloads directory

Cd Downloads/

Extract apache-karaf-3.0.8.tar.gz to the Applications directory

Tar-zxvf apache-karaf-3.0.8.tar.gz-C ~ / Applications

2.3 install apache-maven

Upload the downloaded apache-maven package to the Downloads directory through the sftp tool (apache-maven uses version 3.0 or above, apache-maven-3.3.9-bin.tar.gz is used here).

Enter the Downloads directory

Cd Downloads/

Extract apache-maven-3.3.9-bin.tar.gz to the Applications directory

Tar-zxvf apache-maven-3.3.9-bin.tar.gz-C ~ / Applications

Set the apache-maven environment variable and edit the ~ / .bashrc file

Vim / .bashrc

Add a few lines at the end of the file:

ExportM2_HOME=/home/dev/Applications/apache-maven-3.3.9

Export PATH=$PATH:$M2_HOME/bin

Make the environment variable effective immediately

Source / .bashrc

Verify the results of maven installation

Mvn-v, which shows that the installation is successful:

3 install ONOS

Download ONOS source code

Download address: https://github.com/opennetworkinglab/onos/archive/1.6.0.zip

Wget https://github.com/opennetworkinglab/onos/archive/1.6.0.zip

The download directory is not required. Download it to the ~ / Downloads directory here.

Create a working directory

Mkdir~/workspace

Enter the Downloads directory

Cd ~ / Downloads

Decompress the onos source code to the ~ / workspace directory

Unzip onos-1.6.0.zip-d ~ / workspace

3.2 Environment variable settings

Before building onos, you need to set two environment variables, ONOS_ROOT and KARAF_ROOT.

Open the ~ / .bashrc file

Vim / .bashrc

Add the following at the end of the file:

Export ONOS_ROOT=/home/dev/workspace/onos-1.6.0

ExportKARAF_ROOT=/home/dev/Applications/apache-karaf-3.0.8

Export PATH=$KARAF_ROOT/bin:$PATH

Save and exit

To make the environment variable take effect immediately, execute the following command

Source / .bashrc

3.3.Building ONOS

Onos uses apache-karaf-3.0.5 by default, so we need to edit the bash_profile and features.xml of onos.

Vim $ONOS_ROOT/features/features.xml

Change mvn:org.apache.karaf.features/standard/3.0.5/xml/features to mvn:org.apache.karaf.features/standard/3.0.8/xml/features

Save exit.

Vim $ONOS_ROOT/tools/dev/bash_profile

Modify export KARAF_VERSION=$ {KARAF_VERSION:-3.0.5} to export KARAF_VERSION=$ {KARAF_VERSION:-3.0.8}, consistent with the previously configured version of karaf.

To make the environment variable take effect immediately, execute the following command

Source $ONOS_ROOT/tools/dev/bash_profile

To speed up the compilation, you can open the pom.xml file in the lib directory and comment out the code style check.

Vim $ONOS_ROOT/lib/pom.xml

Find the maven-checkstyle-plugin plug-in and comment out the following

Enter the onos root directory

Cd ~ / $ONOS_ROOT

Mvn clean install (where you can skip test cases using mvn clean install-DskipTests)

Enter a long wait.

Seeing this interface, I think it's worth waiting for more than ten minutes. Congratulations, it's been compiled and passed.

3.4 run ONOS

Before running, you need to set the value of ONOS_IP

Export ONOS_IP=172.16.132.75 (here IP is changed to your own address)

Start onos

Ok clean

It's another wait.

Until we see this eye-catching red ONOS logo, here, we are very close to success, let's check it out.

3.5 verify the installation results

Open another command line window and execute the following command

Netstat-anput | grep 6633

Netstat-anput | grep 8181

The above results show that our controller has been installed successfully.

You can also use the list command to see how the module is loaded directly in the karaf console.

Open the browser and enter http://:8181/onos/ui/ in the address bar to access the onos controller. The default user name: karaf, password: karaf

4 Test ONOS

Generally use mininet to simulate the Openflow network for testing, there are a lot of articles on the Internet, so I won't write any more here.

Attachment: http://down.51cto.com/data/2368150

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report