C²S Consulting logo
C²S Consulting | Primers | Proxmox

Build a Proxmox Cluster

Diarmuid O'Briain, diarmuid@obriain.com
08/11/2016, version 1.0

Last updated: 08-11-2016 20:39


There are two nodes in the cluster.

  • node1: 192.168.1.111
  • node2: 192.168.1.222

Download the Proxmox VE ISO from the website and install on two or more servers. During the install the script prompts for root password and IP network settings so that these are preconfigured once the system boots.

In each server edit the /etc/hosts file to reflect the IP addresses and node names of each.

  root@node1:~# cat /etc/hosts
  127.0.0.1	localhost
  192.168.1.111	node1.lovelace.com node1 pvelocalhost
  192.168.1.222	node2.lovelace.com node2

  
  root@node2:~# cat /etc/hosts
  127.0.0.1     localhost
  192.168.1.222	node2.lovelace.com node2 pvelocalhost
  192.168.1.111	node1.lovelace.com node1
  

Create the cluster in either node. It is demonstrated here for node2.

  root@node2:~# pvecm create UIXP-Cluster
  Corosync Cluster Engine Authentication key generator.
  Gathering 1024 bits for key from /dev/urandom.
  Writing corosync key to /etc/corosync/authkey.
  

Check it is OK and conform there is a flag of Quorate.

  root@node2:~# cat /etc/pve/corosync.conf 
  totem {
    version: 2
    secauth: on
    cluster_name: UIXP-Cluster
    config_version: 1
    ip_version: ipv4
    interface {
      ringnumber: 0
      bindnetaddr: 192.168.1.222
    }
  }
  
  nodelist {
    node {
      ring0_addr: node2
      name: node2
      nodeid: 1
      quorum_votes: 1
    }
  }
  
  quorum {
    provider: corosync_votequorum
  }
  
  logging {
    to_syslog: yes
    debug: off
  }


  root@node2:~# pvecm status
  Quorum information
  ------------------
  Date:             Tue Nov  8 15:34:04 2016
  Quorum provider:  corosync_votequorum
  Nodes:            1
  Node ID:          0x00000001
  Ring ID:          1/4
  Quorate:          Yes
  
  Votequorum information
  ----------------------
  Expected votes:   1
  Highest expected: 1
  Total votes:      1
  Quorum:           1  
  Flags:            Quorate 
  
  Membership information
  ----------------------
      Nodeid      Votes Name
  0x00000001          1 192.168.1.222 (local)
  

Now log into the second node and add it to the cluster.

  root@node1:~# pvecm add 192.168.1.222
  root@192.168.1.111's password: 
  copy corosync auth key
  stopping pve-cluster service
  backup old database
  waiting for quorum...OK
  generating node certificates
  merge known_hosts file
  restart services
  successfully added node 'node1' to cluster.
  

Confirm all is OK in node1.

  root@node1:~# pvecm status
  Quorum information
  ------------------
  Date:             Tue Nov  8 15:36:44 2016
  Quorum provider:  corosync_votequorum
  Nodes:            2
  Node ID:          0x00000002
  Ring ID:          1/8
  Quorate:          Yes
  
  Votequorum information
  ----------------------
  Expected votes:   2
  Highest expected: 2
  Total votes:      2
  Quorum:           2  
  Flags:            Quorate 
  
  Membership information
  ----------------------
      Nodeid      Votes Name
  0x00000001          1 192.168.1.111 (local)
  0x00000002          1 192.168.1.222
  

and confirm in node2.

  root@node2:~# pvecm status
  Quorum information
  ------------------
  Date:             Tue Nov  8 15:37:10 2016
  Quorum provider:  corosync_votequorum
  Nodes:            2
  Node ID:          0x00000001
  Ring ID:          1/8
  Quorate:          Yes
  
  Votequorum information
  ----------------------
  Expected votes:   2
  Highest expected: 2
  Total votes:      2
  Quorum:           2  
  Flags:            Quorate 
  
  Membership information
  ----------------------
      Nodeid      Votes Name
  0x00000001          1 192.168.1.111
  0x00000002          1 192.168.1.222 (local)
  

Now login to the web interface of either node.

or

Proxmox

Copyright © 2024 C²S Consulting