]> git.proxmox.com Git - pve-docs.git/blame - pvecm.adoc
pmxcfs.adoc: use systemctl to restart service
[pve-docs.git] / pvecm.adoc
CommitLineData
d8742b0c
DM
1ifdef::manvolnum[]
2PVE({manvolnum})
3================
4include::attributes.txt[]
5
6NAME
7----
8
9pvecm - Proxmox VE Cluster Manager
10
11SYNOPSYS
12--------
13
14include::pvecm.1-synopsis.adoc[]
15
16DESCRIPTION
17-----------
18endif::manvolnum[]
19
20ifndef::manvolnum[]
21Cluster Manager
22===============
23include::attributes.txt[]
24endif::manvolnum[]
25
8a865621
DM
26The {PVE} cluster manager 'pvecm' is a tool to create a group of
27physical servers. Such group is called a *cluster*. We use the
28http://www.corosync.org[Corosync Cluster Engine] for reliable group
29communication, and such cluster can consists of up to 32 physical nodes
30(probably more, dependent on network latency).
31
32'pvecm' can be used to create a new cluster, join nodes to a cluster,
33leave the cluster, get status information and do various other cluster
34related tasks. The Proxmox Cluster file system (pmxcfs) is used to
35transparently distribute the cluster configuration to all cluster
36nodes.
37
38Grouping nodes into a cluster has the following advantages:
39
40* Centralized, web based management
41
42* Multi-master clusters: Each node can do all management task
43
44* Proxmox Cluster file system (pmxcfs): Database-driven file system
45 for storing configuration files, replicated in real-time on all
46 nodes using corosync.
47
48* Easy migration of Virtual Machines and Containers between physical
49 hosts
50
51* Fast deployment
52
53* Cluster-wide services like firewall and HA
54
55
56Requirements
57------------
58
59* All nodes must be in the same network as corosync uses IP Multicast
60 to communicate between nodes (also see
61 http://www.corosync.org[Corosync Cluster Engine]). NOTE: Some
62 switches do not support IP multicast by default and must be manually
63 enabled first.
64
65* Date and time have to be synchronized.
66
67* SSH tunnel on port 22 between nodes is used.
68
69* If you are interested in High Availability too, for reliable quorum
70 you must have at least 3 nodes (all nodes should have the same
71 version).
72
73* We recommend a dedicated NIC for the cluster traffic, especially if
74 you use shared storage.
75
76NOTE: It is not possible to mix Proxmox VE 3.x and earlier with
77Proxmox VE 4.0 cluster.
78
79
afcff28d
DM
80Cluster Setup
81-------------
8a865621
DM
82
83First, install {PVE} on all nodes. Make sure that each node is
84installed with the final hostname and IP configuration. Changing the
85hostname and IP is not possible after cluster creation.
86
87Currently the cluster creation has to be done on the console, so you
88need to login via 'ssh'.
89
90
91Create the Cluster
92~~~~~~~~~~~~~~~~~~
93
94Login via 'ssh' to the first Proxmox VE node. Use a unique name for
95your cluster. This name cannot be changed later.
96
97 hp1# pvecm create YOUR-CLUSTER-NAME
98
99To check the state of your cluster use:
100
101 hp1# pvecm status
102
103
104Adding Nodes to the Cluster
105~~~~~~~~~~~~~~~~~~~~~~~~~~~
106
107Login via 'ssh' to the node you want to add.
108
109 hp2# pvecm add IP-ADDRESS-CLUSTER
110
111For `IP-ADDRESS-CLUSTER` use the IP from an existing cluster node.
112
113CAUTION: A new node cannot hold any VM´s, because you would get
114conflicts about identical VM IDs. To workaround, use vzdump to backup
115and to restore to a different VMID after adding the node to the
116cluster.
117
118To check the state of cluster:
119
120 # pvecm status
121
122.Check Cluster Status
123----
124hp2# pvecm status
125Quorum information
126~~~~~~~~~~~~~~~~~~
127Date: Mon Apr 20 12:30:13 2015
128Quorum provider: corosync_votequorum
129Nodes: 4
130Node ID: 0x00000001
131Ring ID: 1928
132Quorate: Yes
133
134Votequorum information
135~~~~~~~~~~~~~~~~~~~~~~
136Expected votes: 4
137Highest expected: 4
138Total votes: 4
139Quorum: 2
140Flags: Quorate
141
142Membership information
143~~~~~~~~~~~~~~~~~~~~~~
144 Nodeid Votes Name
1450x00000001 1 192.168.15.91
1460x00000002 1 192.168.15.92 (local)
1470x00000003 1 192.168.15.93
1480x00000004 1 192.168.15.94
149----
150
151If you only want the list of all nodes use:
152
153 # pvecm nodes
154
155.List Nodes in a Cluster
156----
157hp2# pvecm nodes
158
159Membership information
160~~~~~~~~~~~~~~~~~~~~~~
161 Nodeid Votes Name
162 1 1 hp1
163 2 1 hp2 (local)
164 3 1 hp3
165 4 1 hp4
166----
167
168
169Remove a Cluster Node
170~~~~~~~~~~~~~~~~~~~~~
171
172CAUTION: Read carefully the procedure before proceeding, as it could
173not be what you want or need.
174
175Move all virtual machines from the node. Make sure you have no local
176data or backups you want to keep, or save them accordingly.
177
178Log in to one remaining node via ssh. Issue a 'pvecm nodes' command to
179identify the nodeID:
180
181----
182hp1# pvecm status
183
184Quorum information
185~~~~~~~~~~~~~~~~~~
186Date: Mon Apr 20 12:30:13 2015
187Quorum provider: corosync_votequorum
188Nodes: 4
189Node ID: 0x00000001
190Ring ID: 1928
191Quorate: Yes
192
193Votequorum information
194~~~~~~~~~~~~~~~~~~~~~~
195Expected votes: 4
196Highest expected: 4
197Total votes: 4
198Quorum: 2
199Flags: Quorate
200
201Membership information
202~~~~~~~~~~~~~~~~~~~~~~
203 Nodeid Votes Name
2040x00000001 1 192.168.15.91 (local)
2050x00000002 1 192.168.15.92
2060x00000003 1 192.168.15.93
2070x00000004 1 192.168.15.94
208----
209
210IMPORTANT: at this point you must power off the node to be removed and
211make sure that it will not power on again (in the network) as it
212is.
213
214----
215hp1# pvecm nodes
216
217Membership information
218~~~~~~~~~~~~~~~~~~~~~~
219 Nodeid Votes Name
220 1 1 hp1 (local)
221 2 1 hp2
222 3 1 hp3
223 4 1 hp4
224----
225
226Log in to one remaining node via ssh. Issue the delete command (here
227deleting node hp4):
228
229 hp1# pvecm delnode hp4
230
231If the operation succeeds no output is returned, just check the node
232list again with 'pvecm nodes' or 'pvecm status'. You should see
233something like:
234
235----
236hp1# pvecm status
237
238Quorum information
239~~~~~~~~~~~~~~~~~~
240Date: Mon Apr 20 12:44:28 2015
241Quorum provider: corosync_votequorum
242Nodes: 3
243Node ID: 0x00000001
244Ring ID: 1992
245Quorate: Yes
246
247Votequorum information
248~~~~~~~~~~~~~~~~~~~~~~
249Expected votes: 3
250Highest expected: 3
251Total votes: 3
252Quorum: 3
253Flags: Quorate
254
255Membership information
256~~~~~~~~~~~~~~~~~~~~~~
257 Nodeid Votes Name
2580x00000001 1 192.168.15.90 (local)
2590x00000002 1 192.168.15.91
2600x00000003 1 192.168.15.92
261----
262
263IMPORTANT: as said above, it is very important to power off the node
264*before* removal, and make sure that it will *never* power on again
265(in the existing cluster network) as it is.
266
267If you power on the node as it is, your cluster will be screwed up and
268it could be difficult to restore a clean cluster state.
269
270If, for whatever reason, you want that this server joins the same
271cluster again, you have to
272
273* reinstall pve on it from scratch
274
275* then join it, as explained in the previous section.
d8742b0c
DM
276
277
278ifdef::manvolnum[]
279include::pve-copyright.adoc[]
280endif::manvolnum[]