LoginSignup
0
0

More than 5 years have passed since last update.

attrd_updaterコマンドのクエリーオプションによる属性の確認

Posted at

Pacemakerで処理される属性(attrd_updaterコマンドや、内部処理などで設定される値)は、通常cib上のセクションに保存されます。
この属性値を利用して、Pacemakerやリソースエージェントはリソースなどの制御を行います。

たとえば、属性としてprivate(そのノードのみの属性でcibに反映しない属性)も管理することが出来ます。
この場合、cibには属性は反映されないので、cibを対象として処理するcrm_attributeの-Gオプションなどでは確認出来ません。

[root@rh75-rex01 ~]# attrd_updater -n test4 -v 100 -p ★-pオプションでrh75-rex01ノード用のプライベートな属性をセットします

★crm_monコマンドで確認しても、プライベートな属性はcibに反映されない為、確認することが出来ません。
[root@rh75-rex01 ~]# crm_mon -1 -Af
Stack: corosync
Current DC: rh75-rex01 (version 1.1.19-c3c624ea3d) - partition with quorum
Last updated: Wed Oct 31 11:28:59 2018
Last change: Wed Oct 31 11:28:48 2018 by root via crm_attribute on rh75-rex01

2 nodes configured
11 resources configured

Online: [ rh75-rex01 rh75-rex02 ]

Active resources:

 vipCheckMaster (ocf::heartbeat:VIPcheck):      Started rh75-rex01
 Resource Group: master-group
     vip-master (ocf::heartbeat:IPaddr2):       Started rh75-rex01
     vip-rep    (ocf::heartbeat:IPaddr2):       Started rh75-rex01
 Master/Slave Set: msPostgresql [pgsql]
     Masters: [ rh75-rex01 ]
     Slaves: [ rh75-rex02 ]
 Clone Set: clnDiskd1 [prmDiskd1]
     Started: [ rh75-rex01 rh75-rex02 ]
 Clone Set: clnDiskd2 [prmDiskd2]
     Started: [ rh75-rex01 rh75-rex02 ]
 Clone Set: clnPing [prmPing]
     Started: [ rh75-rex01 rh75-rex02 ]

Node Attributes:
* Node rh75-rex01:
    + default_ping_set                  : 100       
    + diskcheck_status                  : normal    
    + diskcheck_status_internal         : normal    
    + master-pgsql                      : 1000      
    + pgsql-data-status                 : LATEST    
    + pgsql-master-baseline             : 0000000014000178
    + pgsql-status                      : PRI       
* Node rh75-rex02:
    + default_ping_set                  : 100       
    + diskcheck_status                  : normal    
    + diskcheck_status_internal         : normal    
    + master-pgsql                      : 100       
    + pgsql-data-status                 : STREAMING|SYNC
    + pgsql-status                      : HS:sync   

Migration Summary:
* Node rh75-rex01:
* Node rh75-rex02:

★念の為、cibの中身も確認(空なので結果はなし)
[root@rh75-rex01 ~]# cibadmin -Q | grep test4

★crm_attributeでも確認(cibに値がないので取れない)
[root@rh75-rex01 ~]# crm_attribute -G -l reboot -n test4           
scope=status  name=test4 value=(null)
Error performing operation: No such device or address
★privateでない属性は取れる。
[root@rh75-rex01 ~]# crm_attribute -G -l reboot -n default_ping_set
scope=status  name=default_ping_set value=100      

また、crm_attributeコマンドによるクエリーでの属性確認は、CIBに反映された内容のみを確認する事になる為、attrdプロセスが生で持っている属性も確認出来ません。
(例えば、属性値を更新したはずなのにcibに反映されていない場合のデバックなど)

しかし、attrd_updaterコマンドのクエリーであれば、crm_attributeコマンドと異なり、attrdがクラスタ内の属性として持っている全ての属性(プライベート属性も)も確認することが出来ます。
(全てのクエリーで取得された属性が必ずしも、cibに反映されている保障はないので、使い方には注意が必要です)

★プライベートな属性も取れる
[root@rh75-rex01 ~]# attrd_updater -Q -n test4
name="test4" host="rh75-rex01" value="100"

★相手ノードでもrh75-rex01で設定されたプライベートな属性はattrd間で同期されているので取れる
[root@rh75-rex02 ~]# attrd_updater -Q -n test4
name="test4" host="rh75-rex01" value="100"

★プライベートでないattrdの保持属性も取れる
[root@rh75-rex01 ~]# attrd_updater -Q -n default_ping_set
name="default_ping_set" host="rh75-rex01" value="100"
name="default_ping_set" host="rh75-rex02" value="100"

以上です。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0