Ubuntu 24.04
Sponsored Link

Pacemaker : स्थापित करना2024/07/23

 

लिनक्स उच्च उपलब्धता प्रणाली, Pacemaker को स्थापित और कॉन्फ़िगर करें।

यह उदाहरण निम्न प्रकार से पर्यावरण पर आधारित है।

                                  |
+----------------------+          |          +----------------------+
| [  Cluster Node#1  ] |10.0.0.51 | 10.0.0.52| [  Cluster Node#2  ] |
|   node01.srv.world   +----------+----------+   node02.srv.world   |
|                      |                     |                      |
+----------------------+                     +----------------------+

[1] सभी नोड्स पर, Pacemaker इंस्टॉल करें और कुछ सेटिंग्स कॉन्फ़िगर करें।
root@node01:~#
apt -y install pacemaker pcs
root@node01:~#
systemctl enable pcsd
# क्लस्टर व्यवस्थापक पासवर्ड सेट करें

root@node01:~#
passwd hacluster

Changing password for user hacluster.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.

# क्लस्टर आरंभ करें

root@node01:~#
pcs cluster destroy

[2] एक नोड पर, बुनियादी क्लस्टर सेटिंग्स कॉन्फ़िगर करें।
# नोड्स के बीच अधिकृत करें

root@node01:~#
pcs host auth node01.srv.world node02.srv.world

Username:
hacluster

Password:
node01.srv.world: Authorized
node02.srv.world: Authorized
# क्लस्टर कॉन्फ़िगर करें

root@node01:~#
pcs cluster setup ha_cluster node01.srv.world node02.srv.world

No addresses specified for host 'node01.srv.world', using 'node01.srv.world'
No addresses specified for host 'node02.srv.world', using 'node02.srv.world'
Destroying cluster on hosts: 'node01.srv.world', 'node02.srv.world'...
node01.srv.world: Successfully destroyed cluster
node02.srv.world: Successfully destroyed cluster
Requesting remove 'pcsd settings' from 'node01.srv.world', 'node02.srv.world'
node01.srv.world: successful removal of the file 'pcsd settings'
node02.srv.world: successful removal of the file 'pcsd settings'
Sending 'corosync authkey', 'pacemaker authkey' to 'node01.srv.world', 'node02.srv.world'
node01.srv.world: successful distribution of the file 'corosync authkey'
node01.srv.world: successful distribution of the file 'pacemaker authkey'
node02.srv.world: successful distribution of the file 'corosync authkey'
node02.srv.world: successful distribution of the file 'pacemaker authkey'
Sending 'corosync.conf' to 'node01.srv.world', 'node02.srv.world'
node01.srv.world: successful distribution of the file 'corosync.conf'
node02.srv.world: successful distribution of the file 'corosync.conf'
Cluster has been successfully set up.

# क्लस्टर के लिए सेवाएँ प्रारंभ करें

root@node01:~#
pcs cluster start --all

node01.srv.world: Starting Cluster...
node02.srv.world: Starting Cluster...
# ऑटो-स्टार्ट सेट करें

root@node01:~#
pcs cluster enable --all

node01.srv.world: Cluster Enabled
node02.srv.world: Cluster Enabled
# स्थिति दिखाओ

root@node01:~#
pcs cluster status

Cluster Status:
 Cluster Summary:
   * Stack: corosync (Pacemaker is running)
   * Current DC: node01.srv.world (version 2.1.6-6fdc9deea29) - partition with quorum
   * Last updated: Mon Jul 22 23:59:21 2024 on node01.srv.world
   * Last change:  Mon Jul 22 23:59:08 2024 by hacluster via crmd on node01.srv.world
   * 2 nodes configured
   * 0 resource instances configured
 Node List:
   * Online: [ node01.srv.world node02.srv.world ]

PCSD Status:
  node02.srv.world: Online
  node01.srv.world: Online

root@node01:~#
pcs status corosync


Membership information
----------------------
    Nodeid      Votes Name
         1          1 node01.srv.world (local)
         2          1 node02.srv.world
[3] यदि आप आरंभ करने के लिए सभी क्लस्टर सेटिंग्स को हटाना चाहते हैं, तो निम्नानुसार चलाएँ।
root@node01:~#
pcs cluster stop --all

node01.srv.world: Stopping Cluster (pacemaker)...
node02.srv.world: Stopping Cluster (pacemaker)...
node01.srv.world: Stopping Cluster (corosync)...
node02.srv.world: Stopping Cluster (corosync)...

root@node01:~#
pcs cluster destroy --all

Warning: Unable to load CIB to get guest and remote nodes from it, those nodes will not be deconfigured.
node02.srv.world: Stopping Cluster (pacemaker)...
node01.srv.world: Stopping Cluster (pacemaker)...
node02.srv.world: Successfully destroyed cluster
node01.srv.world: Successfully destroyed cluster
मिलान सामग्री