Thursday 29 October 2015

Cron with Pacemaker

Clustering cron daemon with pacemaker on Cent OS 7

This is a two node cluster with virtual IP and cron daemon as resources. The crontab has to be edited manually in both nodes to have the same task scheduled in it

node1.example.com
node2.example.com

Add the following to the /etc/hosts file in both nodes so that they are able to reach each other

X.X.X.X       node1.example.com        node1
X.X.X.X       node2.example.com        node2

Before starting with the cluster stop and disable the cron service in both nodes

#systemstl stop crond,service
#systemctl disable crond.service

Now install the pre-requisites on both nodes

#yum install -y pcs pacemaker corosync cman wget

Now set password for the hacluster user on both nodes

#passwd hacluster

Now start pcsd service and enable it on both nodes.

#systemctl start pcsd.service
#systemctl enable pcsd.service

Now authorize the cluster nodes. Will ask for username and password. Use "hacluster"

#pcs cluster auth node1 node2

Now create the cluster

#pcs cluster setup --name MYCLUSTER node1 node2
#pcs cluster start --all

Now disable STONITH and quorum as it is not required for a two node setup

#pcs property set stonithpcs resource create CRON systemd:crond-enabled=false

#pcs property set no-quorum-policy=ignore

Now add the resources. We need a virtual IP and tomcat resource

#pcs resource create VirtualIP ocf:heartbeat:IPaddr2 ip=x.x.x.x cidr_netmask=24  op monitor interval=30s

 #pcs resource create CRON systemd:crond

Now to make both resources run in the same node we must have a constraint as follows

# pcs constraint colocation set VirtualIP CRON

Set the order in which the resources has to load
#pcs constraint order set VirtualIP CRON

All done. Now stop the cluster and start it.

#pcs cluster stop --all

#pcs cluster start --all

#pcs status

Friday 23 October 2015

Installing KVM(libvirt) on Ubuntu 14.04

OS: Ubuntu 14.04 - 64 bit

Install the prerequisites and bridge utils for creating the bridge interface

apt-get install vim aptitude bridge-utils

Now lets configure the bridge interface
Change the eth0 interface to manual, create the bridge interface and link the bridge interface with eth0. After configuring the bridge interface the host machine will be connected to eth0 which inturn will be connected to the bridge. Now any traffic originating from the host machine will go through the bridge interface


vim /etc/network/interfaces
----------------------------------------------------------------
auto eth0
iface eth0 inet manual


auto br0
iface br0 inet static
address        x.x.x.x
netmask        255.x.x.x
gateway x.x.x.x
dns-nameservers        8.8.8.8 4.2.2.2
#bridge configuration
bridge_ports eth0
#turning off spaning tree
bridge_stp off
bridge_maxweight 0
bridge_fd 0
----------------------------------------------------------------

Now lets intall KVM

$aptitude install qemu-kvm qemu-system

Now install the virt-manager

$aptitude install virt-manager

After installation we can start virt manager by issuing the following command

$sudo virt-manager

This will launch the Virtual Machine Manager













High Availability with IREDMAIL Integrated with Active Directory

This is step by step guide for Centos 7. Server1 will be the Active node and Server2 will be the failover node. After failover when ...