/docs/MyDocs

To get this branch, use:
bzr branch http://darksoft.org/webbzr/docs/MyDocs

« back to all changes in this revision

Viewing changes to Administration/Server/Cluster/ha/rh-ha.txt

  • Committer: Suren A. Chilingaryan
  • Date: 2017-04-03 02:45:17 UTC
  • Revision ID: csa@suren.me-20170403024517-dwzj0z0k1cmhxm7u
Restructuring, OpenShift, Ansible, Git

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Installing
2
 
==========
3
 
    zypper in zypper in corosync pacemaker
4
 
 
5
 
    zypper ar http://download.opensuse.org/repositories/devel:/languages:/ruby:/extensions/openSUSE_13.1/devel:languages:ruby:extensions.repo
6
 
    zypper in pcs-0.9.139-csa.noarch.rpm
7
 
 
8
 
    passwd hacluster            [on all nodes]
9
 
    systemctl start pcsd
10
 
 
11
 
    systemctl enable corosync
12
 
    systemctl enable pacemaker
13
 
    systemctl enable pcsd
14
 
 
15
 
Creating a HA cluster
16
 
=====================
17
 
    pcs cluster auth -u hacluster 192.168.26.131 192.168.26.132 192.168.26.135
18
 
    pcs cluster setup --name cluster_nfs 192.168.26.131 192.168.26.132
19
 
    pcs cluster start --all
20
 
 
21
 
    pcs property set stonith-enabled=false              [ Disable STONOTH which is killing unexpected nodes to prevent data corruption ]
22
 
    pcs property set no-quorum-policy=ignore            [ Disables qourum which ensures that bigger part of cluster is working and smaller 
23
 
 
24
 
Split-brain
25
 
===========
26
 
    When the cluster looses connectivity, the data corruption may happen as each node 
27
 
    thinks he is only alive.
28
 
    quorum      - is the concept used to select which nodes are part of active cluster and which are not. 
29
 
                if 'total_nodes < 2 * active_nodes', then this part of cluster have a quorum and continues
30
 
                to operate while if number of active nodes is less, then the part is considered disconnected
31
 
                and stops. However, this is not working for 2 node clusters. In this case, the qorum checking 
32
 
                can be (and should be) disabled with:
33
 
                        pcs property set no-quorum-policy=ignore                
34
 
    stonith     - is concept to ensure what services are stopped once node is disconnected from 
35
 
                cluster. For simpler clusters this can be disabled with
36
 
                        pcs property set stonith-enabled=false
37
 
 
38
 
Resources
39
 
=========
40
 
    pcs resource create nfs_ip ocf:heartbeat:IPaddr2 ip=192.168.26.150 cidr_netmask=24 op monitor interval=15s
41
 
    pcs resource create webserver ocf:heartbeat:apache configfile=/etc/httpd/conf/httpd.conf statusurl="http://localhost/server-status" op monitor interval=1min
42
 
    
43
 
    pcs resource delete nfs_ip
44
 
 
45
 
    Listing available types of resources
46
 
        pcs resource standards
47
 
        pcs resource providers
48
 
        pcs resource agents ocf:glusterfs
49
 
        pcs resource agents ocf:heartbeat
50
 
 
51
 
 
52
 
Configuring migration
53
 
=====================
54
 
    There is two parameters:
55
 
    prefers     - the service will be run on the system with higher value of prefers
56
 
    stickness   - unless prefers is also above stickness, the service will not be migrated to new system with higher prefers.
57
 
 
58
 
    Setting
59
 
        pcs resource meta nfs_ip resource-stickiness=100
60
 
        pcs constraint location nfs_ip prefers 192.168.26.132=200
61
 
 
62
 
    Restricting 2 services to run on the same node
63
 
        pcs constraint colocation add webserver virtual_ip INFINITY
64
 
 
65
 
    Specifying the order of execution
66
 
        pcs constraint order virtual_ip then webserver
67
 
 
68
 
    Checking currently set constraits
69
 
        pcs constraint
70
 
 
71
 
    Simulating resource allocation
72
 
        crm_simulate -sL
73
 
        
74
 
    Also stickiness may be set while creating of the resource [using default or excplicitely]
75
 
        pcs resource defaults resource-stickiness=100
76
 
        pcs resource create nfs_ip ocf:heartbeat:IPaddr2 ip=192.168.26.150 cidr_netmask=24 op monitor interval=15s meta resource-stickiness=5O
77
 
 
78
 
Checking status
79
 
===============
80
 
    pcs status cluster
81
 
    pcs status nodes
82
 
    corosync-cmapctl  | grep members
83
 
    pcs status corosync
84
 
    crm_verify -L -V
85
 
 
86
 
 
87
 
Checking operation
88
 
==================
89
 
    pcs cluster stop node1                      [just stops a single node for cehcking]
90
 
 
91
 
 
92
 
Problems
93
 
========
94
 
 - if one node is out corosync starts to use memory and shortly gets a lot of it and many logs...
95
 
 - can we somehow provide a 3rd (4th,5th) verification nodes in the cluster to use it only for qourom checking?