...
After running maven as described in Building ONOS, karaf
can be used to start ONOS and attach to its CLI:
...
Tip | |||||
---|---|---|---|---|---|
Launching karaf may bring up the default karaf prompt, without the 'ONOS' ASCII art. This is purely cosmetic, and shouldn't affect functionality; typing If the branding is desired, one can move the branding bundle created during the build process to karaf's lib directory:
And relaunch karaf. |
Launching Remotely
...
Deploying remotely with onos-package
and onos-install
onos-install
Remote installations are useful when one wishes to run multiple ONOS instances as a cluster.
The ONOS build process produces a number of OSGi bundles, which are essentially Java jar files. One could simply deploy these bundles in any OSGi container to run ONOS, but this would require that such container be installed, properly configured, and that the bundles be collected and properly staged. The ONOS utility scripts, onos-package
and onos-install
, simplifies this task by packaging the ONOS binaries into a distributable compressed tar.
Setup
The prerequisites for using these scripts are:
- The Apache Karaf binaries (either .zip or .tar.gz format) are available in ~/Downloads of the build machine
- The ONOS source has been built
- The install target has a Java 8 JRE installed
Additionally, onos-install
relies on ssh
to deploy the package to the target machine. It is recommended that:
- Either the target machine have a user named 'sdn', or on the build machine, the ONOS_USER environment variable is exported with the username used in the target machine
- And password-less (e.g. key-based) login be enabled on the target.
If 1 is met, the onos-push-keys utility can be used to transfer one's public keys to targets. This requires that the keys have been generated prior to using the utility.
Deployment
Running onos-package
produces a self-contained tar archive.
Code Block | ||
---|---|---|
| ||
$ onos-package-rw-r--r-- 1 onosuser wheel 34187574 Nov 8 14:52 /tmp/onos-1.0.0.onosuser.tar.gz |
As seen above, the file has the naming convention "onos-1.0.0.<username>.tar.gz", and is created under the /tmp/ directory.
This file can be deployed by pointing onos-install
to the remote target to run ONOS on (192.168.56.20 in this example):
Code Block | ||
---|---|---|
| ||
$ onos-install 192.168.56.20onos start/running, process 9513 |
Once ONOS is running, the onos
utility can be used to attach to the remote instance's CLI:
Code Block | ||
---|---|---|
| ||
$ onos 192.168.56.20 |
The same welcome banner and prompt as the local case should show up.
Tip |
---|
If ONOS has been previously installed on a remote machine, onos-install -f [target] will force a reinstall. |