10. Server command line reference

The vipu-server command line has the following syntax:

vipu-server [GlobalOptions]

$ vipu-server --storage /opt/vipu-server/vipu-server.json

10.1. Global options

Global options work with all vipu commands. You can also pass global options as environment variables or in a config file.

Table 10.1 Global options

Option

Description

--autodiscovery-listen-interfaces=nics

-a nics

A comma separated list of network interface names where the agent autodiscovery service will listen for multicast messages from the V-IPU agents (default: autodiscovery service disabled)

--check-db-migration

Returns whether the storage needs to be migrated by running vipu-server –migrate-db

--config=path

Choose a configuration file explicitly; do not look in the default locations

--default-user-id=username

Provides a default user ID that will be used to administer the server when running in secure mode (default: $USER)

--exporter-activate

When using this option vipu-server will run the built-in V-IPU prometheus metrics exporter (default: exporter is disabled)

--exporter-listen=string

Address and port where the prometheus metrics exporter will listen to. Metrics will be available over HTTP. (default: “:2113”)

--exporter-metrics-path=string

URL where the exporter metrics will be exposed from (default: “/metrics”)

--listen=string

The server listening address for the admin API (default “:8090”)

--listen-user=string

The server listening address for the user-only API (default: disabled; both admin and user APIs are served by the address defined with the --listen option)

--local-sock-only

Server only listens to the local unix socket ignoring the --listen/--listen-user options (default: server listens to both the addresses defined by --listen/--listen-user and a local socket)

--socket=path

The path where the server local unix socket will be created to. Note that the absolute path of the unix socket cannot be more than 108 characters long, so if you try to start the server from a deeply nested directory it will fail with an error message. If it is a requirement to start the server from a deeply nested directory, you should start the server with the --socket option to spawn the unix socket in a directory where absolute-path + socket-name is less than 108 characters long (default: “./vipu-server.sock”)

--migrate-db

Migrate storage to the next DB schema version. Please ensure you have a backup of your DB before migrating. This will look for the vipu-server.json file to update in the current directory, unless you specify a different location with --storage

--prometheus-sd-config-file=path

Points to a file where the server will write the V-IPU exporter entries associated with the managed V-IPU agents. This file is in a JSON format compatible with the prometheus file-based discovery service (https://prometheus.io/docs/guides/file-sd/)

--storage-init

Initialise the server storage state. vipu-server must be called explicitly with this option the very first time to initialise the server storage

--storage path

File for storing server state in (default “./vipu-server.json”)

--help, -h

Show help for the vipu-server command

--version, -v

Show version

10.1.1. Using a configuration file

All the options listed in Section 10.1, Global options can be overridden with a vipu-server configuration file. The option names in the configuration file are identical but without the leading hyphens. For example, if you start vipu-server with the following command from the shell:

$ vipu-server --listen :8100 --exporter-activate --exporter-listen localhost:2113

The corresponding vipu-server options can be overridden in a configuration file that looks like this:

// Listens to the non-default port 8100
listen = ":8100"
// Activates the V-IPU exporter
exporter-activate = true
// V-IPU exporter only listens to localhost:2113
exporter-listen = "localhost:2113"

The server will look for a configuration file in the following ordered list of directories and will load the first configuration file found:

  1. Configuration file provided with the --config option

  2. ./.vipu-server-config.hcl

  3. $HOME/.vipu-server-config.hcl

  4. /etc/vipu/vipu-server-config.hcl

10.1.2. Using environment variables

All the options listed in Section 10.1, Global options can be overridden using environment variables using the syntax: VIPU_SERVER_OPTION_NAME.

Everything should be upper case and without the leading hyphens. The remaining hyphens (-) should be replaced by underscores (_). For example, if you start vipu-server with the following command from the shell:

$ vipu-server --listen :8100 --exporter-activate --exporter-listen localhost:2113

The corresponding options can be specified with the following environment variables:

$ export VIPU_SERVER_LISTEN=":8100"
$ export VIPU_SERVER_EXPORTER_ACTIVATE="true"
$ export VIPU_SERVER_EXPORTER_LISTEN="localhost:2113"