Date: Thu, 28 Mar 2024 11:16:16 +0000 (UTC) Message-ID: <428972574.727.1711624576362@ip-10-30-146-46.us-west-2.compute.internal> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_726_952394875.1711624576359" ------=_Part_726_952394875.1711624576359 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
This section covers the details involved in getting, installing,= and running ONOS. Both single- and multi-instance cases are described.&nbs= p;
This section assumes that the reader has already checked out the latest = source by following Getting ONOS - ONOS Source Code.
If you are installing into an Ubuntu VM, make sure you have completed st= eps 2 and 3 from ONOS fr= om Scratch to install Karaf, Maven, and Java 8.
ONOS and its test scripts are developed and tested on OS X (Mavericks an= d later) and Ubuntu (14.04 64-bit), with focus on the latter.
We recommend the following if a VM is used for running ONOS:
In order to build and run ONOS the following are requir= ed:
Finally, to take full advantage of the ONOS test suite = and various developer conveniences, it is also recommended that developers = have the following tools available on their machines:
The ONOS install process relies on the environment variable =
JAVA_HOME being properly set. In other words, both mvn =
--version
and java -version
should report the=
same Java version:
The best way to prevent this version mismatch is to install Maven before= Java 8.
The binaries for both Maven and Karaf can be downloaded as tar arc= hives, where installation entails extracting them to the desired locat= ion. For example, if your archives were downloaded to ~/Downloads, and you = wish to install Maven and Karaf into ~/Applications:
$ cd; m= kdir Downloads Applications $ cd Downloads $ wget http://download.nextag.com/apache/karaf/3.0.3/apache-karaf-3.0.3.tar= .gz $ wget http://archive.apache.org/dist/maven/maven-3/3.3.1/binaries/apache-m= aven-3.3.1-bin.tar.gz $ tar -zxvf apache-karaf-3.0.3.tar.gz -C ../Applications/ $ tar -zxvf apache-maven-3.3.1-bin.tar.gz -C ../Applications/
For OS X, the latest Oracle Java 8 SDK can be downloaded from Orac= le.
For Ubuntu, the following steps will upgrade the installation to J= ava 8:
$ sudo = apt-get install software-properties-common -y $ sudo add-apt-repository ppa:webupd8team/java -y $ sudo apt-get update $ sudo apt-get install oracle-java8-installer oracle-java8-set-default -y= pre>
You will have to accept the Ora= cle binary license terms
If not set automatically during the Java 8 installation process, T= he JAVA_HOME environment variable should be set to the JRE install= ation location for Java 8. The process for verifying/setting the proper ver= sion varies with platform.
On OS X: The current JAVA_HOME may be verified with:
$ /usr/= libexec/java_home /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home
To set the version, either= run or add the following to the shell profile:
$ expor= t JAVA_HOME=3D$(/usr/libexec/java_home -v 1.8)
On Ubuntu: To verify the JAVA_HOME:
$ env |= grep JAVA_HOME JAVA_HOME=3D/usr/lib/jvm/java-8-oracle
If JAVA_HOME is not set or= incorrect, either run or add the following to the shell profile:
$ expor= t JAVA_HOME=3D/usr/lib/jvm/java-8-oracle
To get the most from the tools and instructions discussed in the followi= ng sections, it is highly recommended that the ONOS_ROOT environment variable is exported in the shell profile (.bash_aliases<= /em>, .profile, etc.) to refer to the top of the ONOS source tree.= For example:
$ expor= t ONOS_ROOT=3D~/onos $ source $ONOS_ROOT/tools/dev/bash_profile
To use karaf or onos command described in followi= ng sections, $KARAF_ROOT/bin needs be added to the PATH e= nvironment variable.
By default $ONOS_ROOT/tools/dev/bash_profile expects $KARAF= _ROOT to be ~/Applications/apache-karaf-$KARAF_VERSION and ad= d them to the PATH.
If you have installed Apache Karaf to a different path, define $KARAF_ROOT pointing to the correct path before including $ONOS_ROOT/tools/dev/bash_profile
ONOS uses Maven for managing the= build process. To build the ONOS code-base from the top-most level, and fr= om scratch, simply type the following:
$ cd ~/= onos $ mvn clean install
This triggers a full build, complete with unit testing. This may take se=
veral minutes, depending on the compute resources of the machine used. ONOS=
developer tool-kit also includes onos-build
command and alias=
ob
, both of which build the entire code tree from any locatio=
n.
When complete, there should be an output similar to the following:
[INFO] = --- maven-bundle-plugin:2.5.3:install (default-install) @ onos-branding --- [INFO] Installing org/onlab/onos/onos-branding/1.1.0-SNAPSHOT/onos-branding= -1.1.0-SNAPSHOT.jar [INFO] Writing OBR metadata [INFO] --------------------------------------------------------------------= ---- [INFO] Reactor Summary: [INFO]=20 [INFO] onos-build-conf ................................... SUCCESS [0.697s] [INFO] onos .............................................. SUCCESS [2.549s] [INFO] onlab-utils ....................................... SUCCESS [1.521s] [INFO] onlab-junit ....................................... SUCCESS [4.707s] [INFO] onlab-misc ........................................ SUCCESS [8.002s] [INFO] onlab-netty ....................................... SUCCESS [3.119s] [INFO] onlab-nio ......................................... SUCCESS [2.048s] [INFO] onlab-osgi ........................................ SUCCESS [0.635s] [INFO] onlab-rest ........................................ SUCCESS [0.637s] [INFO] onlab-thirdparty .................................. SUCCESS [2.212s] [INFO] onos-core ......................................... SUCCESS [0.481s] [INFO] onos-api .......................................... SUCCESS [6.186s] [INFO] onos-core-store ................................... SUCCESS [0.641s] [INFO] onos-core-trivial ................................. SUCCESS [3.002s] [INFO] onos-core-net ..................................... SUCCESS [5.778s] [INFO] onos-core-serializers ............................. SUCCESS [2.788s] [INFO] onos-core-dist .................................... SUCCESS [8.149s] [INFO] onos-json ......................................... SUCCESS [0.615s] [INFO] onos-web .......................................... SUCCESS [0.533s] [INFO] onos-gui .......................................... SUCCESS [0.888s] [INFO] onos-rest ......................................... SUCCESS [1.886s] [INFO] onos-cli .......................................... SUCCESS [1.163s] [INFO] onos-of ........................................... SUCCESS [0.457s] [INFO] onos-of-api ....................................... SUCCESS [8.798s] [INFO] onos-providers .................................... SUCCESS [0.431s] [INFO] onos-of-providers ................................. SUCCESS [0.473s] [INFO] onos-of-provider-device ........................... SUCCESS [1.940s] [INFO] onos-of-provider-link ............................. SUCCESS [2.042s] [INFO] onos-of-provider-host ............................. SUCCESS [1.562s] [INFO] onos-of-provider-packet ........................... SUCCESS [1.946s] [INFO] onos-of-provider-flow ............................. SUCCESS [0.821s] [INFO] onos-lldp-provider ................................ SUCCESS [1.824s] [INFO] onos-host-provider ................................ SUCCESS [1.672s] [INFO] onos-of-ctl ....................................... SUCCESS [2.213s] [INFO] onos-of-drivers ................................... SUCCESS [0.560s] [INFO] onos-apps ......................................... SUCCESS [0.436s] [INFO] onos-app-tvue ..................................... SUCCESS [0.625s] [INFO] onos-app-fwd ...................................... SUCCESS [0.618s] [INFO] onos-app-ifwd ..................................... SUCCESS [0.592s] [INFO] onos-app-foo ...................................... SUCCESS [0.814s] [INFO] onos-app-mobility ................................. SUCCESS [0.611s] [INFO] onos-app-proxyarp ................................. SUCCESS [0.579s] [INFO] onos-app-config ................................... SUCCESS [0.626s] [INFO] onos-app-sdnip .................................... SUCCESS [5.847s] [INFO] onos-app-calendar ................................. SUCCESS [0.631s] [INFO] onos-app-optical .................................. SUCCESS [0.732s] [INFO] onos-app-metrics .................................. SUCCESS [0.435s] [INFO] onos-app-metrics-intent ........................... SUCCESS [0.639s] [INFO] onos-app-metrics-topology ......................... SUCCESS [0.681s] [INFO] onos-app-oecfg .................................... SUCCESS [1.282s] [INFO] onos-features ..................................... SUCCESS [0.442s] [INFO] onos-branding ..................................... SUCCESS [0.486s] [INFO] --------------------------------------------------------------------= ---- [INFO] BUILD SUCCESS [INFO] --------------------------------------------------------------------= ---- [INFO] Total time: 1:40.113s [INFO] Finished at: Sat Nov 08 13:49:43 PST 2014 [INFO] Final Memory: 120M/1453M [INFO] --------------------------------------------------------------------= ---- $
Once the build has completed, we can =
use the onos-package=
span>
shell tool to produce =
an installable compressed tar file, which contains ONOS artifacts as well a=
s ONOS-branded distribution of Apache Karaf. If your development machine ha=
s the zip command available, the onos-package
&nb=
sp;tool will also produce a ZIP file variant with the same contents as the =
tar file. As with onos-build
, onos-package also has an al=
ias called op
. =
The following shows what one should expect to see when running onos-p=
ackage
command:
$ op -rw-r--r-- 1 tom wheel 101196349 Apr 30 14:39 /tmp/onos-1.2.0.user.tar.g= z -rw-r--r-- 1 tom wheel 101763602 Apr 30 14:39 /tmp/onos-1.2.0.user.zip $
This section describes both launching ONOS on the build machine lo=
cally, which can be useful when developing functionality that does not requ=
ire an ONOS cluster. To allow running ONOS directly on the deve=
lopment machine, ONOS toolbox comes with onos-karaf
=
command, and corresponding ok
alias, which makes sure that Apa=
che Karaf is installed and properly configured to run ONOS before starting =
it.
Note: This tool is purposefully designed for development machines = and is not intended to be used for production environments. It accepts = ;the same arguments as does the original karaf command.
For the time-being, in order to run ONOS locally, we have to export ONOS_NIC
environment variables with t=
he IP address prefix to configure ONOS clustering component. This requireme=
nt will disappear before the Cardinal release however. For example:
$ expor= t ONOS_IP=3D10.1.9.255
To configure ONOS with a set of applications that should be automaticall= y activated on startup, use the ONOS_APPS environment variable as follows:<= /p>
$ expor= t ONOS_APPS=3Ddrivers,openflow,proxyarp,mobility,fwd
To pre-stage applications and appropriately configure ONOS, use the karaf
command:
$ ok cl= ean Creating local cluster configs for IP 10.1.9.247... Setting up hazelcast.xml for subnet 10.1.9.*... Staging builtin apps... Customizing apps to be auto-activated: drivers,openflow,proxyarp,mobility,f= wd... Welcome to Open Network Operating System (ONOS)! ____ _ ______ ____ / __ \/ |/ / __ \/ __/ / /_/ / / /_/ /\ \ \____/_/|_/\____/___/ 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 ONOS= . onos>
At this point, typing This section describes how to deploy and run ONOS using the various deve=
loper and test tools, specifically Remote installations are useful when one wishes to run ONOS on a remote =
machine (or a VM), or run multiple ONOS instances in a cluster. This sectio=
n demonstrates remote installation on a single remote machine. The ONOS build process produces a number of OSGi bundles, which are esse=
ntially Java jar files. These bundles can be deployed in any OSGi con=
tainer, but this would require that such container be installed, properly c=
onfigured, and that the bundles be collected and properly staged. help onos
at the p=
rompt should still bring up a list of available commands. Pressing Ctrl-D or logout
will exit the CLI.<=
/p>
Deploying ONOS remotely using ONOS test tools
onos-package
and onos=
-install
available in the ONOS source tree.Overview
onos-package
and onos-=
install
, simplif=
ies this task down to two steps:
onos-package packages the ONOS binaries into a distributable compressed tar. Then,
onos=
-install
pushes the package created by onos-package
ont=
o the remote VM and ignites the ONOS service.Some preparations are needed for= using these scripts:=
On the build machine:
The ONOS_APPS variable should be se= t to the list of ONOS apps that should be auto-ignited:
$ expor= t ONOS_APPS=3D"drivers,openflow,proxyarp,mobility,fwd"
On the target VM:
A user named sdn with password-less sudo
privi=
lege, or, on the build machine, the ONOS_USER environmen=
t variable is set to the preferred user for the VM.
To enable sudo without a password, edit the sudoers configurati=
on. To do this, run sudo visudo
within the VM, and add the fol=
lowing line:
sdn ALL= =3D(ALL) NOPASSWD:ALL
Additionally, onos-install =
relies on ssh
t=
o deploy the package to the target machine. To make the process easier, p=
span>assword-less (e.g. key-based)&=
nbsp;login to the VM is reco=
mmended. The
$ onos-= push-keys 192.168.56.10 sdn@192.168.56.10's password:=20 sdn@192.168.56.10's password:
This requires that the keys have= been generated prior to using the utility. As shown above, it will ask for= the password twice.
Run
to produce a s=
elf-contained tar archive:
onos-package
$ onos-= package -rw-r--r-- 1 onosuser wheel 34187574 Nov 8 14:52 /tmp/onos-1.2.0.onosuser.t= ar.gz
As seen above, the file has the naming convention "onos-1.2.0.<username>.tar.gz", and is created =
under the /tmp directory.
Deploy the binary by pointing onos-install to the remote target to run ONOS on (192.168.56.20 in this example=
):
$ onos-= install 192.168.56.20 onos start/running, process 9513
onos-insta=
ll -f [target]
will force a reinstall.
Once ONOS is running, the onos
u=
tility can be used to attach to the remote instance's CLI:
$ onos = 192.168.56.20 Welcome to Open Network Operating System (ONOS)! ____ _ ______ ____ =20 / __ \/ |/ / __ \/ __/ =20 / /_/ / / /_/ /\ \ =20 \____/_/|_/\____/___/ =20 =20 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 ONOS= . onos>
Alternatively, pointing a browser at http://<onos-ip>:8181/onos/ui
will display the ONOS Web GUI.
For deploying ONOS on multiple remote machines (i.e., as a cluster), the= behavior of the ONOS utilities can be configured by employing tes= t cells. Test cells are discussed under Test Environment Setup in the Developer'= s Guide.
For deployers who just want to install ONOS software from the distributa= ble onos.tar.gz file, without checking out the ONOS source code, t= hey can follow these simple steps to get ONOS up and running.
First, untar the onos.tar.=
gz
via the following command
tar zxf= onos-1.2.0*.tar.gz
After that change to the newly c= reated directory and configure the network interface that ONOS should use f= or clustering using the onos-config tool, for example:
bin/ono= s-config MyONOS 10.128.11.*
Note: If you are installing on m= ultiple machines which you intend to cluster, make sure you use the same co= mmand to configure them.
At this point, you are ready to run the ONOS as a standalone instance. T=
o do that, you can use the onos-service
tool as follows.
bin/ono= s-service server &
Alternatively, you can integrate the onos-service
into your=
Linux init daemon of choice. Note that etc/onos.conf
can=
be copied to the system /etc/init
directory to use the Linux =
upstart deamon.
If you wish to form a cluster from individually installed ONOS instances=
, use the onos-form-cluster
tool with the IP addresses of all =
the ONOS instances, as in the following example:
bin/ono= s-form-cluster 10.128.11.1 10.128.11.2 10.128.11.3
This tool generates a cluster configuration and uploads it to all the ON= OS instances via ONOS REST API. Note that this request will trigger all ONO= S instances to restart. When they finish the restart process, they will all= be part of the same cluster.
To attach a console to the local instance, you can use the bin/ono=
s
tool or you can remotely ssh on port 8181 as in the following exam=
ple:
ssh -p = 8101 karaf@10.128.11.1
To setup password-less login via SSH keys, please follow documentation o= n Apache Karaf 3.0.3 web pages.
Both Maven and Karaf rely on network access for some of their functional= ity. One of the first points to check if a build fails is to check for conn= ectivity, and rebuild the project once it is restored.
In Karaf, connectivity issues may manifest as bundles not loading (e.g. =
not being able to use any ONOS-related commands, or help onos
=
returning nothing). It may also take some time for ONOS to fully boot up, i=
n which case some commands may not be available for the first minute or so.=
ONOS by default activates the webconsole
feature of Apache =
Karaf, so you can point your browser at http://<onos-ip>:8=
181/system/console
to trouble-shoot features, bundles and component =
dependencies.
Make sure that the primary user in the VM (sdn) has superuser privilege,= or is part of sudoers.
Also be sure that there is a .m2 directory in the user's home d= irectory. Running Maven at least once in the VM will generate the directory= .
P=
revious : Getting ONOS
Next : Interacting with ONOS