2.1. Installation and Configuration using rpm or deb package¶
Both packages (rpm and deb) install in the same directories and otherwise are identical. Information in this document applies to both, unless specific package format is mentioned.
The package creates role account nw2 on the machine when it is installed. All directories created during installation are owned by this role account.
The package creates two directories:
All files are installed in a directory created inside of /opt/netspyglass/versions/. We create new directory for each version and add a symlink /opt/netspyglass/current that points to the latest version.
Directory /opt/netspyglass/home/ is used to store configuration files, databases and logs.
The package has two dependencies
manual: java >= 1.8.0 manual: jsvc
Actual package names for java and jsvc depend on the distribution.
The rpm we ship has been tested with CentOS and Fedora Linux systems. The deb package has been tested with Ubuntu 14.04 and 16.04 LTS systems
When installed from the rpm or deb package, NetSpyGlass uses two configuration files:
File /etc/default/netspyglass contains few parameters used by the service startup script /etc/init.d/netspyglass to find the binaries and supply initial configuration parameters needed to start the application. Once the server is running, it takes the rest of the configuration from the file /opt/netspyglass/home/nw2.conf.
Usually you do not need to change anything in the file /etc/default/netspyglass when you are just getting started. You may need to add some JVM command line parameters later on when your NetSpyGlass system grows, for example you may need to add parameters to control JVM heap size, however this only becomes necessary on large installations.
184.108.40.206. Startup configuration file /etc/edfault/netspyglass¶
File /etc/default/netspyglass can have the following parameters (not all of these are mandatory):
- INSTALL_DIR : directry where binary package has been installed. The package gets installed in the directory /opt/netspyglass/versions/<version_number> but rpm and deb packages also create a symlink /opt/netspyglass/current that points to the latest version. Variable INSTALL_DIR usually has value /opt/netspyglass/current. This variable is used by the startup script netspyglass.sh to find Java JAR file netspyglass-1.0.jar
- USER : the name of the user account used to run the server. By default this is nw2.
- HOME : NetSpyGlass server home directory. By default this is /opt/netspyglass/home, this directory is created by the rpm/deb package when it is installed.
- SERVER_CLI : command line arguments for the server
- ROLE : server role. The default value is “primary,monitor”, it is intended for single server installation. Roles can be different when NetSpyGlass is configured to run as a cluster (see Cluster configuration). You do not need to change the role if you install NetSpyGlass for evaluation or intend to run a single server.
- REGION : this parameter is used when NetSpyGlass runs in a cluster configuration, see Cluster configuration. Do not change this if you install NetSpyGlass for evaluation or intend to run a single server.
- ZK : connect string for Zookeeper. This only needs to be changed if you already run Zookeeper as part of your infrastructure and want to use it. Default value “embedded” makes NetSpyGlass server start its own embedded Zookeeper server. Do not change this if you install NetSpyGlass for evaluation or intend to run a single server. See Cluster configuration for more details.
File /etc/default/netspyglass installed by the rpm/deb package has default values for all necessary parameters for a single server NetSpyGlass installation.
Shell variable SERVER_CLI is used to build command line for the server. It includes both parameters passed to Java VM (for example those that control heap size) and parameters that control the application.
2.1.2. Running the Server¶
We provide shell script /etc/init.d/netspyglass that can be used to start and stop NetSpyGlass process.
220.127.116.11. Starting and stopping NetSpyGlass¶
To start or stop the service, use commands:
service netspyglass start service netspyglass stop
The server finds its configuration file nw2.conf using variable CONFIG defined in the file /etc/default/netspyglass.
It is also possible to run a cluster of NetSpyGlass servers. This becomes necessary when total number of devices approaches a thousand or more and total number of monitoring variables reaches 100,000 or more. See Cluster configuration for more information on running NetSpyGlass in cluster configuration.
NetSpyGlass uses zookeeper for coordination, service discovery and configuration. This is especially vital when NetSpyGlass runs in a cluster configuration, however standalone server needs zookeeper too. You can use embedded zookeeper server that runs as part of the NetSpyGlass server process or external zookeeper server if you already have one. This is controlled by the command line parameter -DZK. If this parameter has value “embedded” (-DZK=embedded), then embedded zookeeper server is started and used by NetSpyGlass. This is the default. If you already have zookeeper and want to use it, pass its ip address and port number as the value for the parameter -DZK. For example oarameter -DZK=10.1.2.3:2181 tells the monitor to find zookeeper server on the machine with address 10.1.2.3, port 2181.