Creating a Proxmox cluster

A cluster is nothing but a group of Proxmox servers or nodes, sharing resources. A Proxmox cluster can contain up to 32 physical nodes. If network latency permits, the number of nodes can be higher. But any number of nodes higher than 32 may cause an unstable situation within the cluster.

As of Proxmox VE 5, we cannot create clusters through the graphical interface. The entire process of cluster creation must be done through the CLI. Proxmox provides a tool to create and add nodes to a cluster called Proxmox VE Cluster Manager or pvecm.

When naming a cluster, keep in mind that it can be a maximum of 15 characters and only—can be used as a special character.

To create a new cluster, log in to any available Proxmox node through SSH and run the following command:

# pvecm create <clustername>

For our first demo cluster, we are going to run the following command to create a cluster named pmx-cluster:

# pvecm create pmx-cluster

After successfully creating the cluster, we can quickly check it through the following command:

# pvecm status

The following screenshot shows the result after running the pvecm command:

As shown in the previous screenshot, we have created a new cluster from node 1. We are now going to add a second node into the cluster. To add a member node, log in to the node through SSH, and then run the following command:

# pvecm add <existing_member_ip>

If there is more than one member node in the cluster already, then the IP address in the command can be any of those nodes. As mentioned earlier, there is no master-slave scheme in a Proxmox cluster. All nodes share the same cluster configuration and information. For our demo cluster, we are going to add our second node into the cluster using the following command, where 172.16.2.1 is the assigned IP address of the first node in the cluster:

# pvecm add 172.16.2.1

The command will initiate the process of adding the node into the cluster and will display results as it progresses. The command also starts or restarts necessary services. The only user prompt that is necessary in the beginning of the process is to enter the destination node's root credentials. The following screenshot shows the command to add a node and the process it progresses through:

Sometimes it may be necessary to rejoin a member node with the same hostname and IP address into the cluster for any number of reasons, such as a hostname change or reinstall. The node-joining command will produce an error, as shown in the following screenshot, if the node has the same network information as it had previously:

The reason this error occurs is the cluster configuration already has a node listed in it with the same hostname and IP address. In such cases, we can add an option at the end of the node-joining command as follows:

# pvecm add <existing_mode_ip> -f

The command will forcefully rewrite the cluster configuration, recreate the SSH authentication key, and join the member node. We can see the list of member nodes in the cluster using the following command:

# pvecm nodes

We can also use the pvecm command to remove or detach a member node from the cluster. This command should be run from any node in the cluster except from the node being detached.

Before removing a node from the cluster, ensure that all virtual machines have been moved to other nodes of the cluster, because after the node is detached, all VMs residing in the node will become inaccessible from the rest of the nodes in the cluster.

The following command will remove a node from the Proxmox cluster:

# pvecm delnode <hostname/IP>
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.218.38.125