Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
# IP addresses of the ONOS cluster nodes
export OC1=10.192.19.101
export OC2=10.192.19.102
export OC3=10.192.19.103
export OC4=10.192.19.104
export OC5=10.192.19.105


# Provide a list of all ONOS instances using the above variables
export ONOS_INSTANCES=“$OC1 $OC2 $OC3 $OC4 $OC5"

# Optionally export ONOS web user/password if non-default ones are used
export ONOS_WEB_USER=onos
export ONOS_WEB_PASS=rocks

...

After this, and after exporting the PATH environment variable as indicated above, you should be able to type in the following commands to manage the cluster, e.g.:

Code Block
languagebash
onos # CLI to the first instance $OC1
onos 3 # CLI to the third instance $OC3
onos ipaddress # CLI to the ONOS at the given IP
onos 2 summary # execute “summary” CLI on 2nd instance $OC2
onos-diagnostics # collect ONOS diagnostics on the entire cluster
...

...

Since the tools contacts all ONOS node cluster instances, it needs to know the IP addresses of those machines. To avoid having to specify these IP addresses as part of the command, you can export the ONOS_INSTANCES environment variable to specify the addresses. Here’s an example of how to set the variable:


Code Block
languagebash
# The list of IP addresses is given as a space separated list

...


$ export ONOS_INSTANCES="10.192.19.111 10.192.19.112 10.192.19.113"

The tool also accesses the ONOS REST API to collect logs and for this it requires the REST API username and password credentials. These credentials can be provided either via ONOS_WEB_USER and ONOS_WEB_PASSWD environment variables or via command options (see usage below)

Once enabled, the onos-diagnostics tool can be run as follows:


Code Block
languagebash
$ onos-diagnostics

There is an option that allows for naming the resulting archive file for differentiation between different cluster instances, e.g.

Code Block
languagebash
# This will produce archive file /tmp/delta-pod-diags.tar.gz

...


$ onos-diagnostics -n delta-pod

The resuling /tmp/*-diags.tar.gz file will contain all relevant information about the ONOS cluster.

The following is the usage help for the onos-diagnostics tool:


Code Block
languagebash
usage: onos-diagnostics [-x] [-n name] [-u user] [-p password] [ip1 ip2...]

...


Environment Variables:

...


   ONOS_INSTANCES

...

    IPs or hostnames of ONOS cluster machines
   ONOS_WEB_USER

...

     username for REST API
   ONOS_WEB_PASS

...

Example Usages:

   # Collect compressed diagnostics for the cluster.

   # REST API user and password are drawn from environment variables.

...

     password for REST API
Example Usages:
   # Collect compressed diagnostics for the cluster.
   # REST API user and password are drawn from environment variables.
   # Collection archive will be named /tmp/onos-diags.tar.gz

...


   # The cluster node IPs will be drawn from ONOS_INSTANCES variable.

...


   $ onos-diagnostics

...

   # Collect diagnostics for the cluster and leave them extracted.

...


   # Collect diagnostics for the cluster and leave them extracted.
   # Collection directory will be named /tmp/prague-diags/

...


   # Collection archive will be named /tmp/prague-diags.tar.gz.

...


   # REST API user name is 'onos' and password is 'rules'.

...


   # The cluster node IPs will be drawn from ONOS_INSTANCES variable.

...


   $ onos-diagnostics -x -n prague -u onos -p

...

   # Collect compressed diagnostics for a cluster.

   # REST API user name is 'onos' and password is 'rules'.

...

 rules
   # Collect compressed diagnostics for a cluster.
   # REST API user name is 'onos' and password is 'rules'.
   # Collection archive will be named /tmp/onos-diags.tar.gz

...

   # The cluster node IPs are listed explicitly.

...


   # The cluster node IPs are listed explicitly.
   $ onos-diagnostics -u onos -p rules 172.17.0.11 172.17.0.12 172.17.0.13

...

Remote Admin Tools Environment Setup

...