Pacemaker a resource-stickiness

Dzavy

Pacemaker a resource-stickiness
« kdy: 15. 04. 2016, 22:03:59 »
Se tady s tim morim, dokumentace neskutecne tragicka, pritom takova zakladni blbost...

Mam dva nody. K tomu nekolik IPaddr2, nekolik Route a jedna sluzba. Vsechno muze bezet vsude krome dvou route - jedna jen na A a druha jen na B. Povedlo se mi nastavit location, colocation i order tak, aby to vsechno spravne bezelo vzdycky na jednom node a nepsalo to zadny chyby. Jediny co mi zaboha nejde je resource-stickiness - jakmile jsou oba nody online, tak se to porad vraci na nod B - to nechci.

location tech dvou route mam pomoci -inf vzdycky na ten druhej node. Vsechny colocation jsou s inf, stejne tak order. default-resource-stickiness jsem zkousel s ruznyma hodnotama, ale nic nepomaha.

Nejaky napady?
« Poslední změna: 18. 04. 2016, 13:15:46 od Petr Krčmář »


Ondra Benes

Re:Pacemaker a resource-stickiness
« Odpověď #1 kdy: 01. 07. 2016, 14:57:26 »
Ahoj,

omluva, ze jdu asi s krizkem po funuse, ale myslim, ze jsem reprodukoval to, o cem mluvis a ze mam odpoved.

Nevim, jestli jsi zkousel spoustet

   
# pcs constraint --full


v dobe, kdy ti to porad delalo failback i pres nastaveny resource-stickiness. Na mem clusteru to vyhodilo

pcs constraint --full
Location Constraints:
  Resource: apache-res-group
    Enabled on: node1 (score:70) (id:location-apache-res-group-node1-70)
    Enabled on: node2 (score:50) (id:location-apache-res-group-node2-50)
    Enabled on: node3 (score:30) (id:location-apache-res-group-node3-30)
    Enabled on: node3 (score:INFINITY) (role: Started) (id:cli-prefer-apache-res-group)
  Resource: xvmfence1
    Enabled on: node3 (score:INFINITY) (role: Started) (id:cli-prefer-xvmfence1)
    Disabled on: node1 (score:-INFINITY) (id:location-xvmfence1-node1--INFINITY)
  Resource: xvmfence2
    Enabled on: node1 (score:INFINITY) (role: Started) (id:cli-prefer-xvmfence2)
    Disabled on: node3 (score:-INFINITY) (id:location-xvmfence2-node3--INFINITY)
  Resource: xvmfence20
    Disabled on: node2 (score:-INFINITY) (id:location-xvmfence20-node2--INFINITY)
Ordering Constraints:
  start dlm-clone then start clvmd-clone (kind:Mandatory) (id:order-dlm-clone-clvmd-clone-mandatory)
  start clvmd-clone then start apacheconfFS-clone (kind:Mandatory) (id:order-clvmd-clone-apacheconfFS-clone-mandatory)
  start apacheconfFS-clone then start apachecontentFS-clone (kind:Mandatory) (id:order-apacheconfFS-clone-apachecontentFS-clone-mandatory)
  start apachecontentFS-clone then start apache-res-group (kind:Mandatory) (id:order-apachecontentFS-clone-apache-res-group-mandatory)
Colocation Constraints:
  clvmd-clone with dlm-clone (score:INFINITY) (id:colocation-clvmd-clone-dlm-clone-INFINITY)
  apachecontentFS-clone with apacheconfFS-clone (score:INFINITY) (id:colocation-apachecontentFS-clone-apacheconfFS-clone-INFINITY)
  apacheconfFS-clone with clvmd-clone (score:INFINITY) (id:colocation-apacheconfFS-clone-clvmd-clone-INFINITY)
[root@centos7-1 ~]# pcs constraint
colocation  location    order       ref         remove      rule       
[root@centos7-1 ~]# pcs constraint remove cli-prefer-apache-res-group)
-bash: syntax error near unexpected token `)'
[root@centos7-1 ~]# pcs constraint remove cli-prefer-apache-res-group
[root@centos7-1 ~]# pcs constraint --full
Location Constraints:
  Resource: apache-res-group
    Enabled on: node1 (score:70) (id:location-apache-res-group-node1-70)
    Enabled on: node2 (score:50) (id:location-apache-res-group-node2-50)
    Enabled on: node3 (score:30) (id:location-apache-res-group-node3-30)
  Resource: xvmfence1
    Enabled on: node3 (score:INFINITY) (role: Started) (id:cli-prefer-xvmfence1)
    Disabled on: node1 (score:-INFINITY) (id:location-xvmfence1-node1--INFINITY)
  Resource: xvmfence2
    Enabled on: node1 (score:INFINITY) (role: Started) (id:cli-prefer-xvmfence2)
    Disabled on: node3 (score:-INFINITY) (id:location-xvmfence2-node3--INFINITY)
  Resource: xvmfence20
    Disabled on: node2 (score:-INFINITY) (id:location-xvmfence20-node2--INFINITY)
Ordering Constraints:
  start dlm-clone then start clvmd-clone (kind:Mandatory) (id:order-dlm-clone-clvmd-clone-mandatory)
  start clvmd-clone then start apacheconfFS-clone (kind:Mandatory) (id:order-clvmd-clone-apacheconfFS-clone-mandatory)
  start apacheconfFS-clone then start apachecontentFS-clone (kind:Mandatory) (id:order-apacheconfFS-clone-apachecontentFS-clone-mandatory)
  start apachecontentFS-clone then start apache-res-group (kind:Mandatory) (id:order-apachecontentFS-clone-apache-res-group-mandatory)
Colocation Constraints:
  clvmd-clone with dlm-clone (score:INFINITY) (id:colocation-clvmd-clone-dlm-clone-INFINITY)
  apachecontentFS-clone with apacheconfFS-clone (score:INFINITY) (id:colocation-apachecontentFS-clone-apacheconfFS-clone-INFINITY)
  apacheconfFS-clone with clvmd-clone (score:INFINITY) (id:colocation-apacheconfFS-clone-clvmd-clone-INFINITY)



Vsimni si toho

Enabled on: node3 (score:INFINITY) (role: Started) (id:cli-prefer-apache-res-group)


Proto, ze tenhle constraint ma INFIINITY, vzdy vyhral. Tim padem stacilo toto pravidlo vymazat...

   
# pcs constraint remove cli-prefer-apache-res-group


... a nastavit stickiness, jak ji potrebujes (dej si pozor, aby stickiness mela vyssi skore nez location pravidla, a zkus to.

U me to fungovalo: prelokoval jsem sluzbu na node 3, ten jsem fencnul, sluzba se presunula na node1 (podle pravidel location constraint, node1 ma nejvyssi skore, 70), a po tom, co se node3 dostal zpet do clusteru, sluzba zustala bezet na node1.

Je to to, cos myslel?

Dik,
Ondra