Introduction

Some of the basic cluster and node configuration settings are stored in the /etc/storpool.conf file, and also in the /etc/storpool.conf.d/*.conf files. Here you can find how to add settings to these files, and an example for a minimal configuration.

Note

While this and other documents mainly refer to the /etc/storpool.conf file, keep in mind that the current configuration of a node is the aggregation of settings from all the configuration files.

Configuration basics

Each setting is used by one or more of the Background services. A service reads its parameters from the configuration files only when it is started or restarted. Whenever you change a setting you also need to restart the services that use this setting.

The main configuration file /etc/storpool.conf can contain the following types of entries:

  • Settings common for the whole cluster. They are usually placed in the first half of the file.

  • Settings that are specific for individual hosts. They are usually placed in the second half of the file. For details, see Per host configuration below.

The settings provided in the /etc/storpool.conf.d/ apply only for the corresponding host. For details, see Using the files in /etc/storpool.conf.d/ below.

Per host configuration

When you need to add specific configuration details for a particular host, you can do this in a dedicated section of the /etc/storpool.conf file. Here is an example:

[spnode1.example.com]
SP_OURID=1
SP_IFACE1_CFG=1:eth1.100:eth1:100:10.1.100.1:b:x:r
SP_IFACE2_CFG=1:eth2.100:eth2:100:10.2.100.1:b:x:r
SP_NODE_NON_VOTING=1

Such a section should start with a line containing the name of the host in square brackets, as returned by the hostname command:

[spnode1.example.com]
SP_OURID=1

Consider that you can also add host-specific settings to /etc/storpool.conf.d/*.conf files, as described in the next section.

Using the files in /etc/storpool.conf.d/

Note

The settings provided using files in /etc/storpool.conf.d/ are treated as if they are set in the per-host section for this specific node (see above) of the main storpool.conf file.

The /etc/storpool.conf.d/*.conf configuration files must meet all of the following requirements:

  • The name ends with the .conf extension.

  • The name does not start with a dot (.).

When the system locates files in the /etc/storpool.conf.d/ directory with correct names (like local.conf or hugepages.conf), it would process the settings set in them. It would ignore files with incorrect names, like .hidden.conf, local.confx, server.conf.bak, or storpool.conf~.

Maintaining consistency

It is important that each node has valid configuration sections for all nodes in the cluster in its local /etc/storpool.conf file. That’s why you should take care to keep consistent /etc/storpool.conf files across all nodes in the cluster!

For example, you can achieve this by keeping the most recent version of the configuration file in a Git repository, and pulling this version on the nodes in your cluster.

Note the following:

  • In case there are differences in the checksums of the /etc/storpool.conf files in all nodes the system generates monitoring alerts. For details, see Per-host alerts.

  • The /etc/storpool.conf.d/*.conf files could differ on different nodes.

Minimal node configuration

The minimum working configuration must specify the network interface and authentication tokens (see Network communication), and the unique ID of the node and the number of expected nodes (see Identification and voting). Here is an example:

#-
# Copyright (c) 2013 - 2017  StorPool.
# All rights reserved.
#

# Human readable name of the cluster, usually in the "Company Name"-"Location"-"number" form
# For example: StorPool-Sofia-1
# Mandatory for monitoring
SP_CLUSTER_NAME=  #<Company-Name-PoC>-<City-or-nearest-airport>-<number>

# Remote authentication token provided by StorPool support for data related to crashed services, collected
# vmcore-dmesg files after kernel panic, per-host monitoring alerts, storpool_iolatmon alerts, and so on.
SP_RAUTH_TOKEN= <rauth-token>

# Computed by the StorPool Support team; consists of location and cluster separated by a dot
# For example: nzkr.b
# Mandatory (since version 16.02)
SP_CLUSTER_ID=  #Ask StorPool Support

# Interface for storpool communication
#
# Default: empty
SP_IFACE1_CFG=1:eth1.100:eth1:100:10.1.100.1:b:x:r
SP_IFACE2_CFG=1:eth2.100:eth2:100:10.2.100.1:b:x:r

# expected nodes for beacon operation
#
# !!! Must be specified !!!
#
SP_EXPECTED_NODES=3

# API authentication token
#
# 64bit random value
# For example, generate it with: od -vAn -N8 -tu8 /dev/random
SP_AUTH_TOKEN=4306865639163977196

##########################

[spnode1.example.com]
SP_OURID = 1

If you need more examples, check the /usr/share/doc/storpool/examples/storpool.conf.example file in your StorPool installation.