GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
HASTMON.CONF(5) FreeBSD File Formats Manual HASTMON.CONF(5)

hastmon.conf
configuration file for the hastmon(8) deamon and the hastmonctl(8) utility.

The hastmon.conf file is used by both hastmon(8) daemon and hastmonctl(8) control utility. Configuration file is designed in a way that exactly the same file can be (and should be) used on all nodes. Every line starting with # is treated as comment and ignored.

General syntax of the hastmon.conf file is following:
# Global section
control <addr>
listen <addr>
timeout <seconds>
attempts <number>
heartbeat_interval <seconds>
complaint_count <number>
complaint_interval <seconds>
exec <path>
role_on_start <role>

key {
        algorithm <name>
        secret <string>
}

on <node> {
	# Node section
        control <addr>
        listen <addr>
        priority <number>
	attempts <number>
        heartbeat_interval <seconds>
        complaint_count <number>
        complaint_interval <seconds>
        role_on_start <role>
}

on <node> {
	# Node section
        control <addr>
        listen <addr>
        priority <number>
        attempts <number>
	heartbeat_interval <seconds>
        complaint_count <number>
        complaint_interval <seconds>
        role_on_start <role>
}

resource <name> {
	# Resource section
	exec <path>
	timeout <seconds>
	attempts <number>
	heartbeat_interval <seconds>
	complaint_count <number>
	complaint_interval <seconds>
        role_on_start <role>

	key {
		algorithm <name>
		secret <string>
	}

	on <node> {
		# Resource-node section
		# Required
		exec <path>
		# Required
		remote <addr>
                priority <number>
                attempts <number>
                heartbeat_interval <seconds>
                complaint_count <number>
                complaint_interval <seconds>
                role_on_start <role>
	}
	on <node> {
		# Resource-node section
		# Required
		exec <path>
		# Required
		remote <addr>
                priority <number>
                attempts <number>
                heartbeat_interval <seconds>
                complaint_count <number>
                complaint_interval <seconds>
                role_on_start <role>
	}
}

Most of the various available configuration parameters are optional. If parameter is not defined in the particular section, it will be inherited from the parent section. For example, if the listen parameter is not defined in the node section, it will be inherited from the global section. If the global section does not define the listen parameter at all, the default value will be used.

The ⟨node⟩ argument can be replaced either by a full hostname as obtained by gethostname(3), only first part of the hostname, or (on FreeBSD) by node's UUID as found in the kern.hostuuid sysctl(8) variable.

The following statements are available:

⟨number⟩

Nubber of attempt to start resource before giving up. The default value is 3.

⟨number⟩

Number of complaints secondary should receive before initiating failovering. The default value is 5.

⟨seconds⟩

Conplaint's life time in seconds. Complaints older this interval are expired and not taken into consideration. The default value is 60.

⟨addr⟩

Address for communication with hastmonctl(8). Each of the following examples defines the same control address:

uds:///var/run/hastmonctl
unix:///var/run/hastmonctl
/var/run/hastmonctl
    

The default value is uds:///var/run/hastmonctl. listen statement.

⟨path⟩

Execute the given program on various events and to check resource status. Below is the list of currently implemented events and arguments the given program is executed with:

Executed on primary node to start resource.

Executed on both primary and secondary nodes to stop resource.

Executed on both primary and secondary nodes to check resource status.

The script should return 0 as an exit status if the resource is running and is OK, 1 if the resource is not running and some other value if the resource is in unknown state.

Executed on both primary and secondary nodes when resource role is changed.

Executed on both primary and secondary nodes when connection for the given resource between the nodes is established.

Executed on both primary and secondary nodes when connection for the given resource between the nodes is lost.

The ⟨path⟩ argument should contain full path to executable program. If the given program exits with code different than 0, hastmon will log it as an error.

The ⟨resource⟩ argument is resource name from the configuration file.

The ⟨oldrole⟩ argument is previous resource role (before the change). It can be one of: init, secondary, primary, watchdog.

The ⟨newrole⟩ argument is current resource role (after the change). It can be one of: init, secondary, primary, watchdog.

⟨addr ...⟩

List of addresses (separated by space) of hosts that can connect to the node. Format is the same as for the

⟨seconds⟩

Interval between heartbeats (checks) in seconds. The default value is 10.

Secret used for node authentication. If not specified host access is controlled only by remote and friends settings.

⟨name⟩

Signature algorithm being used (MD5, SHA1, SHA256, RIPEMD160).

⟨string⟩

Actual authentication key.

⟨addr⟩

Address to listen on in form of:

protocol://protocol-specific-address
    

Each of the following examples defines the same listen address:

0.0.0.0
0.0.0.0:8458
tcp://0.0.0.0
tcp://0.0.0.0:8458
tcp4://0.0.0.0
tcp4://0.0.0.0:8458
    

The default value is tcp4://0.0.0.0:8458.

⟨number⟩

Node's priority (the lower number the higher priority). Priority is used when several primaries are started (e.g. after previous primary died) to negotiate who will be primary and who has to switch to secondary. The default value is 100.

⟨addr ...⟩

Addresses of the remote hastmon daemons (separated by space). Format is the same as for the listen statement. When operating as a primary node these addresses will be used to connect to the secondary nodes. When operating as a secondary node only connections from these addresses will be accepted. When operating as a watchdog node these addresses will be used to check resource status on the nodes and send complaints. + .Pp + A special value of + .Va none + can be used when the remote address is not yet known (eg. the other node is not + set up yet).

⟨role⟩

Role a resource should be set on hastmon start. It can be one of: init, secondary, primary, watchdog. The default role is init.

⟨seconds⟩

Connection timeout in seconds. The default value is 5.

/usr/local/etc/hastmon.conf
The default hastmon.conf configuration file.
/var/run/hastmonctl
Control socket used by the hastctl(8) control utility to communicate with the hastmon(8) daemon.

The example configuration file can look as follows:
# host1 and host2 run hast resource. Watchdog is run on host3.
resource hast {
	exec /usr/local/etc/rc.d/hast

	on host1 {
		friends tcp4://host3
		remote tcp4://host2
		priority 1
	}
	on host2 {
		friends tcp4://host3
		remote tcp4://host1
		priority 2
	}
	on host3 {
		remote tcp4://host1 tcp4://host2
	}
}

# host1, host2 and host3 run mail resource.
# Watchdog is run on host4 and host5.
resource mail {
	friends tcp4://10.0.0.4 tcp4://10.0.0.5
	exec /usr/local/etc/rc.d/mail

	on host1 {
		remote tcp4://10.0.0.2 tcp4://10.0.0.3
		priority 1
	}
	on host2 {
		remote tcp4://10.0.0.1 tcp4://10.0.0.3
		priority 2
	}
	on host3 {
		remote tcp4://10.0.0.1 tcp4://10.0.0.2
		priority 3
	}
	on host4 {
		remote tcp4://10.0.0.1 tcp4://10.0.0.2 tcp4://10.0.0.3
	}
	on host5 {
		remote tcp4://10.0.0.1 tcp4://10.0.0.2 tcp4://10.0.0.3
	}
}

gethostname(3), hastmonctl(8), hastmon(8).
October 20, 2010 FreeBSD 13.1-RELEASE

Search for    or go to Top of page |  Section 5 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.