Tibit Netconf Server

  Copyright (C) 2022 by Tibit Communications, Inc.
  All rights reserved.

This document provides instructions for installing the Tibit Netconf Server.

See the following additional documents for more information on the Tibit Netconf Server:
 * Tibit Tech Note TN037 Tibit NETCONF/YANG User Guide & Release Notes.



MongoDB Requirements
--------------------

The Tibit Netconf Server requires MongoDB version 4.0 or higher.

The Tibit Netconf Server relies on MongoDB change streams to receive configuration
updates from the database. A replica set must be configured to enable change streams
in MongoDB.

See TN037 Tibit NETCONF/YANG User Guide & Release Notes for more information on
MonogDB configuration requirements.

Use the following steps to configure a replica set in MongoDB:

1. Edit the MongoDB configuration file '/etc/mongod.conf' and uncomment or add
the following lines:

    replication:
        replSetName: rs0

2. Restart MongoDB

    $ sudo systemctl restart mongod.service

3. Use mongo shell to run 'rs.initiate()' to initialize the Replica Set.

    $ mongo

    > rs.initiate()
    {
        "info2" : "no configuration specified. Using a default configuration for the set",
        "me" : "ubuntu:27017",
        "ok" : 1,
        "$clusterTime" : {
            "clusterTime" : Timestamp(1569349356, 1),
            "signature" : {
                "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
                "keyId" : NumberLong(0)
            }
        },
        "operationTime" : Timestamp(1569349356, 1)
    }



Install Steps
-------------

Use the following steps to install the Tibit Netconf Server. Please note that
the package name is different depending on the version of Ubuntu Linux. The package
built for Ubuntu 18.04 includes the '-UB1804' suffix in the package name, and the
package built for Ubuntu 20.04 includes the '-UB2004' suffix in the name.

1. From a Linux shell, unpack the .zip file and change to the new unpacked directory.
    # Ubuntu 18.04
    unzip R3.2.0-Netconf-UB1804.zip
    cd R3.2.0-Netconf-UB1804

    or

    # Ubuntu 20.04
    unzip R3.2.0-Netconf-UB2004.zip
    cd R3.2.0-Netconf-UB2004

2. Use 'apt' to install the Netconf .deb package.
Note: the installation requires root level privileges.

    sudo apt-get install ./tibit-netconf_R3.2.0_amd64.deb

3. Configure the Mongo Database settings in '/etc/tibit/netconf/NetconfInit.json'.
    {
        "Logging": {
            "Filename" : "/var/log/tibit/netconf.log",
            "FileCount" : 3,
            "FileSize" : 1024000,
            "Netconf" : {
                "Console" : "INFO",
                "File" : "INFO",
                "Syslog" : "INFO"
            }
        },
        "MongoDB": {
            "auth_db": "tibit_users",
            "auth_enable": false,
            "ca_cert_path": "/etc/tibit/ca.pem",
            "host": "127.0.0.1",
            "name": "tibit_pon_controller",
            "netconf_db": "tibit_netconf",
            "password": "",
            "port": "27017",
            "tls_enable": false,
            "username": ""
        }
    }

4. Restart the Tibit Netconf Server using Linux systemd scripts.

    sudo systemctl restart tibit-netconf



Uninstall Steps
---------------

The uninstall process deletes the Tibit Netconf Server binaries and configuration files. This
script completely removes the /etc/tibit/netconf and /opt/tibit/netconf directories from
the file system.

Uninstall steps:

1. Use 'apt' to uninstall the Tibit Netconf service.
Note: uninstall requires root level privileges.
Note: this will completely remove the /etc/tibit/netconf and /opt/tibit/netconf directories.

    sudo apt-get purge tibit-netconf

2. If you see the following warning during 'apt-get purge', use 'rm -rf /opt/tibit/netconf' to
completely remove the /opt/tibit/netconf directory.

dpkg: warning: while removing tibit-netconf, directory '/opt/tibit/netconf' not empty so not removed



Running the Software
--------------------

This section provides a list of commands for administering the Tibit Netconf Server.

Use the following command to start Netconf:

    sudo systemctl start tibit-netconf

Use the following command to restart Netconf:

    sudo systemctl restart tibit-netconf

Use the following command to stop Netconf:

    sudo systemctl stop tibit-netconf

Use the following command to check the status of Netconf:

    sudo systemctl status tibit-netconf

Use the following command to view log messages generated by Netconf:

    sudo tail -f /var/log/tibit/netconf.log

Use the following command to display the most recent console messages logged by Netconf:

    journalctl -r -u tibit-netconf

Use the following command to "tail" console messages logged by Netconf (similar to tail -f):

    journalctl -f -u tibit-netconf

Note: The systemd journaling system logs both console messages (stdout and stderr) and
Syslog messages from the Netconf process by default. Disable either Console or Syslog
logging in /etc/tibit/netconf/NetconfInit.json to avoid the duplicate log messages.