]> git.proxmox.com Git - pve-docs.git/blobdiff - ha-manager.adoc
ha-manager.adoc: remove obsolete text
[pve-docs.git] / ha-manager.adoc
index eadf60e0810be148b8aecc438dbdc0495ad54251..d8489cb232652a4e2e0c04c30c8b3162749e4852 100644 (file)
@@ -1,15 +1,15 @@
-[[chapter-ha-manager]]
+[[chapter_ha_manager]]
 ifdef::manvolnum[]
-PVE({manvolnum})
-================
-include::attributes.txt[]
+ha-manager(1)
+=============
+:pve-toplevel:
 
 NAME
 ----
 
 ha-manager - Proxmox VE HA Manager
 
-SYNOPSYS
+SYNOPSIS
 --------
 
 include::ha-manager.1-synopsis.adoc[]
@@ -17,14 +17,12 @@ include::ha-manager.1-synopsis.adoc[]
 DESCRIPTION
 -----------
 endif::manvolnum[]
-
 ifndef::manvolnum[]
 High Availability
 =================
-include::attributes.txt[]
+:pve-toplevel:
 endif::manvolnum[]
 
-
 Our modern society depends heavily on information provided by
 computers over the network. Mobile devices amplified that dependency,
 because people can access the network any time from anywhere. If you
@@ -58,7 +56,7 @@ yourself. The following solutions works without modifying the
 software:
 
 * Use reliable ``server'' components
-
++
 NOTE: Computer components with same functionality can have varying
 reliability numbers, depending on the component quality. Most vendors
 sell components with higher reliability as ``server'' components -
@@ -107,21 +105,27 @@ hard and costly. `ha-manager` has typical error detection and failover
 times of about 2 minutes, so you can get no more than 99.999%
 availability.
 
+
 Requirements
 ------------
 
+You must meet the following requirements before you start with HA:
+
 * at least three cluster nodes (to get reliable quorum)
 
 * shared storage for VMs and containers
 
 * hardware redundancy (everywhere)
 
+* use reliable “server” components
+
 * hardware watchdog - if not available we fall back to the
   linux kernel software watchdog (`softdog`)
 
 * optional hardware fencing devices
 
 
+[[ha_manager_resources]]
 Resources
 ---------
 
@@ -148,16 +152,17 @@ To provide High Availability two daemons run on each node:
 
 `pve-ha-lrm`::
 
-The local resource manager (LRM), it controls the services running on
-the local node.
-It reads the requested states for its services from the current manager
-status file and executes the respective commands.
+The local resource manager (LRM), which controls the services running on
+the local node. It reads the requested states for its services from
+the current manager status file and executes the respective commands.
 
 `pve-ha-crm`::
 
-The cluster resource manager (CRM), it controls the cluster wide
-actions of the services, processes the LRM results and includes the state
-machine which controls the state of each service.
+The cluster resource manager (CRM), which makes the cluster wide
+decisions. It sends commands to the LRM, processes the results,
+and moves resources to other nodes if something fails. The CRM also
+handles node fencing.
+
 
 .Locks in the LRM & CRM
 [NOTE]
@@ -165,7 +170,7 @@ Locks are provided by our distributed configuration file system (pmxcfs).
 They are used to guarantee that each LRM is active once and working. As a
 LRM only executes actions when it holds its lock we can mark a failed node
 as fenced if we can acquire its lock. This lets us then recover any failed
-HA services securely without any interference from the now unknown failed Node.
+HA services securely without any interference from the now unknown failed node.
 This all gets supervised by the CRM which holds currently the manager master
 lock.
 
@@ -178,24 +183,31 @@ locks are working.
 
 It can be in three states:
 
-* *wait for agent lock*: the LRM waits for our exclusive lock. This is
-  also used as idle sate if no service is configured
-* *active*: the LRM holds its exclusive lock and has services configured
-* *lost agent lock*: the LRM lost its lock, this means a failure happened
-  and quorum was lost.
+wait for agent lock::
+
+The LRM waits for our exclusive lock. This is also used as idle state if no
+service is configured.
+
+active::
+
+The LRM holds its exclusive lock and has services configured.
+
+lost agent lock::
+
+The LRM lost its lock, this means a failure happened and quorum was lost.
 
 After the LRM gets in the active state it reads the manager status
 file in `/etc/pve/ha/manager_status` and determines the commands it
 has to execute for the services it owns.
 For each command a worker gets started, this workers are running in
-parallel and are limited to maximal 4 by default. This default setting
+parallel and are limited to at most 4 by default. This default setting
 may be changed through the datacenter configuration key `max_worker`.
 When finished the worker process gets collected and its result saved for
 the CRM.
 
-.Maximal Concurrent Worker Adjustment Tips
+.Maximum Concurrent Worker Adjustment Tips
 [NOTE]
-The default value of 4 maximal concurrent Workers may be unsuited for
+The default value of at most 4 concurrent workers may be unsuited for
 a specific setup. For example may 4 live migrations happen at the same
 time, which can lead to network congestions with slower networks and/or
 big (memory wise) services. Ensure that also in the worst case no congestion
@@ -235,11 +247,18 @@ promoted to the CRM master.
 
 It can be in three states:
 
-* *wait for agent lock*: the LRM waits for our exclusive lock. This is
-  also used as idle sate if no service is configured
-* *active*: the LRM holds its exclusive lock and has services configured
-* *lost agent lock*: the LRM lost its lock, this means a failure happened
-  and quorum was lost.
+wait for agent lock::
+
+The CRM waits for our exclusive lock. This is also used as idle state if no
+service is configured
+
+active::
+
+The CRM holds its exclusive lock and has services configured
+
+lost agent lock::
+
+The CRM lost its lock, this means a failure happened and quorum was lost.
 
 It main task is to manage the services which are configured to be highly
 available and try to always enforce them to the wanted state, e.g.: a
@@ -255,17 +274,59 @@ quorum, the LRM waits for a new quorum to form. As long as there is no
 quorum the node cannot reset the watchdog. This will trigger a reboot
 after the watchdog then times out, this happens after 60 seconds.
 
+
 Configuration
 -------------
 
-The HA stack is well integrated in the Proxmox VE API2. So, for
-example, HA can be configured via `ha-manager` or the PVE web
-interface, which both provide an easy to use tool.
+The HA stack is well integrated into the {pve} API. So, for example,
+HA can be configured via the `ha-manager` command line interface, or
+the {pve} web interface - both interfaces provide an easy way to
+manage HA. Automation tools can use the API directly.
+
+All HA configuration files are within `/etc/pve/ha/`, so they get
+automatically distributed to the cluster nodes, and all nodes share
+the same HA configuration.
+
+
+Resources
+~~~~~~~~~
+
+The resource configuration file `/etc/pve/ha/resources.cfg` stores
+the list of resources managed by `ha-manager`. A resource configuration
+inside that list look like this:
+
+----
+<type>:<name>
+       <property> <value>
+       ...
+----
+
+It starts with a resource type followed by a resource specific name,
+separated with colon. Together this forms the HA resource ID, which is
+used by all `ha-manager` commands to uniquely identify a resource
+(example: `vm:100` or `ct:101`). The next lines contain additional
+properties:
+
+include::ha-resources-opts.adoc[]
+
+
+Groups
+~~~~~~
+
+The HA group configuration file `/etc/pve/ha/groups.cfg` is used to
+define groups of cluster nodes. A resource can be restricted to run
+only on the members of such group. A group configuration look like
+this:
+
+----
+group: <group>
+       nodes <node_list>
+       <property> <value>
+       ...
+----
+
+include::ha-groups-opts.adoc[]
 
-The resource configuration file can be located at
-`/etc/pve/ha/resources.cfg` and the group configuration file at
-`/etc/pve/ha/groups.cfg`. Use the provided tools to make changes,
-there shouldn't be any need to edit them manually.
 
 Node Power Status
 -----------------
@@ -297,10 +358,11 @@ the update process can be too long which, in the worst case, may result in
 a watchdog reset.
 
 
+[[ha_manager_fencing]]
 Fencing
 -------
 
-What Is Fencing
+What is Fencing
 ~~~~~~~~~~~~~~~
 
 Fencing secures that on a node failure the dangerous node gets will be rendered
@@ -366,6 +428,7 @@ That minimizes the possibility of an overload, which else could cause an
 unresponsive node and as a result a chain reaction of node failures in the
 cluster.
 
+[[ha_manager_groups]]
 Groups
 ------
 
@@ -381,17 +444,41 @@ A service bound to this group will run on the nodes with the highest priority
 available. If more nodes are in the highest priority class the services will
 get distributed to those node if not already there. The priorities have a
 relative meaning only.
+  Example;;
+  You want to run all services from a group on `node1` if possible. If this node
+  is not available, you want them to run equally splitted on `node2` and `node3`, and
+  if those fail it should use `node4`.
+  To achieve this you could set the node list to:
+[source,bash]
+  ha-manager groupset mygroup -nodes "node1:2,node2:1,node3:1,node4"
 
 restricted::
 
-resources bound to this group may only run on nodes defined by the
+Resources bound to this group may only run on nodes defined by the
 group. If no group node member is available the resource will be
 placed in the stopped state.
+  Example;;
+  Lets say a service uses resources only available on `node1` and `node2`,
+  so we need to make sure that HA manager does not use other nodes.
+  We need to create a 'restricted' group with said nodes:
+[source,bash]
+  ha-manager groupset mygroup -nodes "node1,node2" -restricted 
 
 nofailback::
 
-the resource won't automatically fail back when a more preferred node
+The resource won't automatically fail back when a more preferred node
 (re)joins the cluster.
+  Examples;;
+  * You need to migrate a service to a node which hasn't the highest priority
+  in the group at the moment, to tell the HA manager to not move this service
+  instantly back set the 'nofailback' option and the service will stay on
+  the current node.
+
+  * A service was fenced and it got recovered to another node. The admin
+  repaired the node and brought it up online again but does not want that the
+  recovered services move straight back to the repaired node as he wants to
+  first investigate the failure cause and check if it runs stable. He can use
+  the 'nofailback' option to achieve this.
 
 
 Start Failure Policy
@@ -411,12 +498,12 @@ specific for each resource.
 
 max_restart::
 
-maximal number of tries to restart an failed service on the actual
+Maximum number of tries to restart an failed service on the actual
 node.  The default is set to one.
 
 max_relocate::
 
-maximal number of tries to relocate the service to a different node.
+Maximum number of tries to relocate the service to a different node.
 A relocate only happens after the max_restart value is exceeded on the
 actual node. The default is set to one.
 
@@ -433,7 +520,7 @@ placed in an error state. In this state the service won't get touched
 by the HA stack anymore.  To recover from this state you should follow
 these steps:
 
-* bring the resource back into an safe and consistent state (e.g:
+* bring the resource back into a safe and consistent state (e.g.,
 killing its process)
 
 * disable the ha resource to place it in an stopped state
@@ -443,6 +530,7 @@ killing its process)
 * *after* you fixed all errors you may enable the service again
 
 
+[[ha_manager_service_operations]]
 Service Operations
 ------------------
 
@@ -451,19 +539,19 @@ This are how the basic user-initiated service operations (via
 
 enable::
 
-the service will be started by the LRM if not already running.
+The service will be started by the LRM if not already running.
 
 disable::
 
-the service will be stopped by the LRM if running.
+The service will be stopped by the LRM if running.
 
 migrate/relocate::
 
-the service will be relocated (live) to another node.
+The service will be relocated (live) to another node.
 
 remove::
 
-the service will be removed from the HA managed resource list. Its
+The service will be removed from the HA managed resource list. Its
 current state will not be touched.
 
 start/stop::