Giter Club home page Giter Club logo

pacemaker's Introduction

Pacemaker

Pacemaker Ubuntu 18.04 virtual box Apache2

Install Oracle Virtual box

Download Ubuntu Server 18.0-.- .iso. https://www.osboxes.org/ubuntu-server/ Create 2 ubuntu Server (Node) and installing both
Run both server (server1, server2) install apache first

apt-get intall -y apach2

Install necessary packages for pacemaker

apt-get  install pacemaker corosync crmsh pcs ufw firewalld fence-agents wget policycoreutils-python-utils

Edit your hostname on both server

nano /etc/hosts

192.168.56.00 —server1 192.168.56.01 —server2

Now, check for connectivity to the outside world. Start small by testing whether we can reach the gateway we configured.

ping -c 3 server2

Check you received 3 packet from server2

Create the corosync configuration file on both machines manually

nano /etc/corosync/corosync.conf
totem {
version: 2
secauth: off
cluster_name: pacemaker1
transport: udpu
}

nodelist {
node {
ring0_addr: server1
nodeid: 101
}
node {
ring0_addr: server2
nodeid: 102
}
}

quorum {
provider: corosync_votequorum
two_node: 1
wait_for_all: 1
last_man_standing: 1
auto_tie_breaker: 0
}
logging {
 to_logfile: yes
 logfile: /var/log/corosync/corosync.log
 to_syslog: yes
 timestamp: on
}
service {
 name: pacemaker
 ver: 1
}
EOF
nano /etc/default/corosync 

START=yes

Allow cluster services through firewall both server

firewall-cmd --permanent --add-service=high-availability
firewall-cmd --reload

Enable pcs Daemon both server

 systemctl start pcsd.service 
 systemctl enable pcsd.service

Now we will set a password for the hacluster user, using the same password on both server

 passwd hacluster
 Changing password for user hacluster.
 New password: 12345678
pcs property set stonith-enabled=false

start pacemaker in both server

service pacemaker start
systemctl enable pcsd.service pacemaker.service corosync.service
systemctl start pcsd.service
iptables --flush

One your master server(server1) Configure Corosync

Pcs cluster auth server1 server2 -u hacluster -p 12345678 –force

Check the both server are Authorized Use pcs cluster setup on the same node to generate and synchronize the corosync Configuration

pcs cluster setup --name mycluster server1 server2 –force

Start and Verify Cluster

Start the Cluster and To disable STONITH, set the stonith-enabled cluster option to false

pcs cluster start –all
pcs cluster status
pcs property set stonith-enabled=false

Add a Resource

pcs property set no-quorum-policy=ignore
pcs resource defaults migration-threshold=1 --force
pcs resource create ClusterIP ocf:heartbeat:IPaddr2 ip=1.2.3.4 cidr_netmask=32 nic=lo op monitor interval=30s
pcs cluster setup --name mycluster server1 server2 –force

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.