Network communication
Setting network-related options - for example, how the network interfaces should
be used, and which are the preferred ports - must be done in the
/etc/storpool.conf
configuration file.
Interfaces for StorPool cluster communication and StorPool block protocol
The network interface options should be defined in the following way:
SP_IFACE1_CFG='config-version':'resolve-interface':'raw-interface':'VLAN':'IP':'resolve':'shared':'mac'
The option names are SP_IFACE1_CFG
and SP_IFACE2_CFG
for the first and
the second storage network interface, respectively. The option values are as
follows:
- config-version
version of the config format (currently 1)
- resolve-interface
Name of the kernel interface that has the IP address.
- raw-interface
Name of the raw interfaces to transmit and receive on.
- VLAN
VLAN tag to use, or 0 if the VLAN is untagged. The VLAN is used for the StorPool block protocol, as well as for the synchronous replication between the cluster nodes.
- IP
IP address to use for storage traffic.
- resolve
‘b’ - use broadcast for resolving (for Ethernet based networks); ‘k’ - use kernel address resolving (for IP-only networks).
- shared
‘s’ for shared in case of a bond interface on top; ‘x’ for exclusive - if nothing else is supposed to use this interface
- mac
‘r’ for using the unmodified MAC of the raw interface; ‘P’ (Privatized MAC); ‘v’ the resolve interfaces.
It is recommended to have two dedicated network interfaces for communication between the nodes. Here are a few examples:
Single VLAN active-backup bond interface, storage and API on the same VLAN:
SP_IFACE1_CFG=1:bond0.900:eth2:900:10.9.9.1:b:s:P SP_IFACE2_CFG=1:bond0.900:eth3:900:10.9.9.1:b:s:P
Single VLAN, LACP bond interface, storage and API on the same VLAN:
SP_IFACE1_CFG=1:bond0.900:eth2:900:10.9.9.1:b:s:v SP_IFACE2_CFG=1:bond0.900:eth3:900:10.9.9.1:b:s:v
Two VLANs: one VLAN for storage, one VLAN for API, both over bond:
SP_IFACE1_CFG=1:bond0.101:eth2:101:10.2.1.1:b:s:P SP_IFACE2_CFG=1:bond0.101:eth2:101:10.2.1.1:b:s:P
Three VLANs: two VLANs for storage, API on separate physical interface
SP_IFACE1_CFG=1:eth2.101:eth2:101:10.2.1.1:b:x:v SP_IFACE2_CFG=1:eth3.201:eth2:201:10.2.2.1:b:x:v
Address for API management
Address on which the StorPool API is bound. It is used by the active
storpool_mgmt
service to receive requests from user-space tools. Multiple
clients can simultaneously send requests to the API; for details about the
management service, see storpool_mgmt. By default, the address
is bound on localhost:
SP_API_HTTP_HOST=127.0.0.1
For cluster-wide access and automatic failover between the nodes, multiple nodes
might have the API service started. Only one storpool_mgmt
service is active
at any given time. The others are in standby mode. The specified IP address is
brought up only on one of the nodes in the cluster at a time - the node with the
active
API service. You may specify an available IP address
(SP_API_HTTP_HOST
), which will be brought up or down on the corresponding
interface (SP_API_IFACE
) when the service becomes active or stand-by.
To configure an interface (SP_API_IFACE
) and address (SP_API_HTTP_HOST
):
SP_API_HTTP_HOST=10.10.10.240
SP_API_IFACE=eth1
Note
The script that adds or deletes the SP_API_HTTP_HOST
address is located
at /usr/lib/storpool/api-ip
. It is executed on every change of the
state of the storpool_mgmt service. The script could be easily modified to
implement additional functions; for example configure routing, firewalls,
and so on.
Port for API management
Port for the storpool_mgmt
service for API management. The default value is
81:
SP_API_HTTP_PORT=81
API authentication token
This value must be an unique integer for each cluster:
SP_AUTH_TOKEN=0123456789
The token can be generated with: od -vAn -N8 -tu8 /dev/random
Note
This token is used only for the API authentication. Cluster management and inter-node communication (client to server, server-to-server) are not authenticated.
Ignore RX port option
Used to instruct the services that the network can preserve the selected port even when altering ports. Default value is 0:
SP_IGNORE_RX_PORT=0
Preferred port
Used for setting which port is preferred when two networks are specified, but only one of them could actually be used for any reason (in an active-backup bond style). The default value is 0 (load-balancing):
SP_PREFERRED_PORT=0 # load-balancing
When you want to specify a port, you should use one of the following values:
SP_PREFERRED_PORT=1 # use SP_IFACE1_CFG by default
SP_PREFERRED_PORT=2 # use SP_IFACE2_CFG by default
Address for the bridge service
IP address for the storpool_bridge
bridge service (see
Background services) to bind to for inbound or outbound connections. If
not specified, the wildcard address (0.0.0.0) will be used.
SP_BRIDGE_HOST=180.220.200.8
Interface for the bridge address
Expected when the SP_BRIDGE_HOST
value is a floating IP address for the
storpool_bridge
service:
SP_BRIDGE_IFACE=bond0.900
Unlike the interfaces used for the StorPool block protocol, this interface must be active in the Linux kernel. The traffic to it is routed by the Linux network stack.
Resolve interface is bridge
If set, the top interface in the SP_IFACE1/2_CFG
will be considered as a
bridge by the the iface-genconf
tool. Also, if set the
SP_BOND_IFACE_NAME
is required (see below). Default: (empty)
SP_RESOLVE_IFACE_IS_BRIDGE
Note that this parameter is used only during the installation of StorPool, when the network interface configuration is prepared. The parameter is not used by the StorPool services, and modifying it would not affect these services.
Name of the bond interface
Required when the SP_RESOLVE_IFACE_IS_BRIDGE
option is set (see above). Used
by the iface-genconf
tool to indicate what the name of the bond under the
resolve interface would have to be. Default: (empty)
SP_BOND_IFACE_NAME
Note that this parameter is used only during the installation of StorPool, when the network interface configuration is prepared. The parameter is not used by the StorPool services, and modifying it would not affect these services.
Bridge service network mask
IP network mask (in bits) for the bridge service. Will default to 32 if unset. Default: (empty)
SP_BRIDGE_NET
Path to iproute2
Path to the iproute2 utilities. Default: unset
SP_IPROUTE2_PATH=
Host and port for the Web interface
You can use the SP_GUI_HTTP_HOST
option to set the HTTP server host for
StorPool’s Web interface. By default it is unset, in which case the Web
interface is not available.
SP_GUI_HTTP_HOST=127.0.0.1
You can also use the option for setting the port. Default: 443
SP_GUI_HTTP_PORT=443