LoginSignup
2
1

More than 5 years have passed since last update.

corosync.confでのノード名の指定

Posted at

概要

corosync、Pacemaker環境では、通常クラスタの認識するノード名はuname値から設定されます。
(ただし、pcs環境で構築した場合には異なる。)
古めのcorosyncではunofficial(マニュアルなどに記載なし、knet対応している新しめのmanには記載有)ですが、ノード名をcorosync.confで設定出来ます。

内容

ノード名をcorosync.confで設定する場合、nodelistを利用した記載が必要になります。
この場合、nodelistを利用しない場合と異なりcorosyncの制御メッセージがucast通信になるので注意が必要です。
2台のRHEL7.2のゲストで確認してみることにします。

設定

nodelistのnodeにnameでノード名を設定します。

[root@rh74-01 ~]# cat /etc/corosync/corosync.conf                                                                                                                                                           
totem {
        version: 2
        rrp_mode: active
        token: 1000
        crypto_hash: sha512
        rrp_problem_count_timeout: 2000
        transport: udpu
}

nodelist {
        node {
                name: nodeA
                ring0_addr: 192.168.10.100
                ring1_addr: 192.168.20.100
                nodeid: 1
        }
        node {
                name: nodeB
                ring0_addr: 192.168.10.110
                ring1_addr: 192.168.20.110
                nodeid: 2
        }
}

logging {
        syslog_facility: local1
        debug: off
}

quorum {
        provider: corosync_votequorum
        expected_votes: 2
}

動作

本来、2ノードは、rh74-01,rh74-02というノード名ですが。。。corosync.confの設定が有効になって認識されます。

[root@rh74-01 ~]# crm_mon -1 -Af
Stack: corosync
Current DC: nodeB (version 1.1.19-c3c624ea3d) - partition with quorum
Last updated: Fri Oct 19 12:56:46 2018
Last change: Fri Oct 19 12:56:43 2018 by hacluster via crmd on nodeB

2 nodes configured
0 resources configured

Online: [ nodeA nodeB ]

No active resources


Node Attributes:
* Node nodeA:
* Node nodeB:

Migration Summary:
* Node nodeB:
* Node nodeA:


[root@rh74-01 ~]# corosync-cmapctl  | grep name
internal_configuration.service.0.name (str) = corosync_cmap                                                                                                                                                 
internal_configuration.service.1.name (str) = corosync_cfg                                                                                                                                                  
internal_configuration.service.2.name (str) = corosync_cpg                                                                                                                                                  
internal_configuration.service.3.name (str) = corosync_quorum                                                                                                                                               
internal_configuration.service.4.name (str) = corosync_pload                                                                                                                                                
internal_configuration.service.5.name (str) = corosync_votequorum                                                                                                                                           
nodelist.node.0.name (str) = nodeA                                                                                                                                                                          
nodelist.node.1.name (str) = nodeB                                                                                                                                                                          
runtime.connections.attrd:3911:0x55a582e56450.name (str) = attrd    
(snip)

以上です。

2
1
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
2
1