-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathheartbeat.conf
103 lines (94 loc) · 3.36 KB
/
heartbeat.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# heartbeat.conf - Configuration file for Heartbeat. Defines microservice
# health checks, and actions to take whenever those services change state.
#
# General Configuration
# #####################
#
# Defines Heartbeat daemon runtime configuration.
#
# user - Run the daemon as this user. This user must have sufficient privileges
# to run the promotion and demotion actions. If None, this defaults to the
# user launching the heartbeat daemon.
# group - Run the daemon as this group. If None, defaults to the login group of
# the user launching the heartbeat daemon.
# logfile - Log file location. Uses working directory by default. See
# 'loglevel' for more details.
# loglevel - From most to least verbose, valid log levels are DEBUG, INFO,
# WARNING, ERROR and CRITICAL. INFO is recommended in production.
# pidfile - PID file location. Uses working directory by default. PID file
# doubles as a lock file in daemon mode.
# threads - Number of health checks to launch in parallel. Recommend setting
# this value to one less than the number of physical CPU cores.
# daemonize - Detaches a standalone daemon if set to True (yes). Iterates
# through health checks on a frequency defined by 'interval'.
# interval - Frequency health checks are run in seconds. Only applies in
# daemon mode. Defaults to once per minute.
#
# Action Definitions
# ##################
#
# Actions come in two varieties, promotions and demotions. Promotions are
# triggered whenever all health checks return true (system is healthy), while
# demotions are triggered whenever one or more health checks fail (system is
# unhealthy).
#
# Both promotions are demotions are defined as key-value pairs. The value is
# often a command or executable to be run whenever the system changes state,
# while the key is referenced in the health check definitions. Each unique key
# must have both promotion and demotion values. Example below.
#
# [promotions]
# nginx = service nginx start
#
# [demotions]
# nginx = service nginx stop
#
# Health Check Definitions
# ########################
#
# Defines Heartbeat health checks. Example below.
#
# action - Defintes promotion and demotion actions to take when system health
# changes state. See 'Action Definitions' for more details.
# hostname - Hostname or IP address to check.
# port - TCP port to connect to (1 - 65535).
# path - Path to check (e.g. /health). Used for HTTP/HTTPS health checks only.
# timeout - Health check response timeout, in seconds.
# type - Health check to perform. Valid types are HTTP, HTTPS and TCP.
#
# [webapp]
# type = http
# hostname = localhost
# port = 8080
# path = /app/login
# action = nginx
################################################################################
# General configuration.
[general]
loglevel = info
logfile = heartbeat.log
pidfile = heartbeat.pid
user = None
group = None
threads = 1
interval = 60
daemonize = no
################################################################################
# Action definitions.
[promotions]
sentinel = touch /tmp/health.html
[demotions]
sentinel = rm -f /tmp/health.html
################################################################################
# Health check defaults.
[DEFAULT]
action = sentinel
hostname = localhost
path = /
port = 8080
timeout = 5
type = tcp
################################################################################
# Health check definitions.
[ssh]
port = 22