Skip to content

Instantly share code, notes, and snippets.

@inokappa
Last active November 21, 2018 00:37
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save inokappa/124b1ee5f3e3fbe6b172 to your computer and use it in GitHub Desktop.
Save inokappa/124b1ee5f3e3fbe6b172 to your computer and use it in GitHub Desktop.
corosync.conf の設定メモ

corosync.conf の各種項目を調べた(使うやつを中心に)

参考


各種ディレクティブ

corosync.conf の設定は compatibility ディレクティブにて whitetank を指定することで OpenAIS 0.80.z の設定パラメータと互換性を持たせることが出来るので man corosync.conf を叩くと、ディレクティブは totemlogging と event` しか出力されないので注意する。

totem {}

  • クラスタ間の通信プロトコル、バージョン、各種オプションを指定する
  • ハートビート方法なども指定する

loggin {}

  • ログ周りの設定を記述する

event {}

  • クラスタの挙動に合わせたイベントに関する設定を記述する
  • 今回は利用しない

service {}

  • 使用するクラスタに関する情報を指定する
  • 今回は pacemaker を使用する

aisexec {}

  • クラスタを実行するユーザーとグループを指定する
  • クラスタの子プロセスがリソースエージェントを実行する為に必要な権限を持っているユーザーを設定する

設定例

以下の設定例を元に各ディレクティブ毎の設定をメモる。

compatibility: whitetank

service {
    name: pacemaker
    ver: 0
    use_mgmtd: yes
}

totem {
        version: 2
        secauth: off
        interface {
                member {
                        memberaddr: ${LB_IP01}
                }
                member {
                        memberaddr: ${LB_IP02}
                }
                ringnumber: 0
                bindnetaddr: ${LB_IP01_network_address} or ${LB_IP02_network_address}
                mcastport: 5405
                ttl: 1
        }
        transport: udpu
}

logging {
        fileline: off
        to_logfile: yes
        to_syslog: yes
        debug: on
        logfile: /var/log/cluster/corosync.log
        debug: off
        timestamp: on
        logger_subsys {
                subsys: AMF
                debug: off
        }
}

compatibility

It is also possible to specify the top level parameter compatibility. This directive indicates the level of compatibility requested by the user. The option whitetank can be specified to remain backward compatable with openais-0.80.z. The option none can be specified to only be compatable with corosync-1.Y.Z. Extra processing during configuration changes is required to remain backward compatable.

Powered by google 翻訳をさらに意訳すると以下のようになる。

  • 設定項目の互換性を指定出来る
  • whitetankopenais-0.80.z の設定と互換性がある
  • デフォルトは whitetank となる

totem

version

  • 設定ファイルのバージョンを指定
  • 現在、有効なバージョンは 2 のみ

secauth

  • クラスタ間でやりとりされるメッセージの暗号化について指定
  • デフォルトは on
  • This specifies that HMAC/SHA1 authentication should be used to authenticate all messages. と言っているが...
  • 有効な場合には CPU に負荷が掛かる

interface

  • サブディレクティブの一つ
  • member にはクラスタメンバーの IP アドレスまたはホスト名を指定する
  • ringnumber は冗長リングプロトコル使用時に各インターフェースが所属するリング番号
  • ringnumber はユニークで且つ 0 から開始する必要がある
  • bindnetaddrmember が属するネットワークアドレスを指定する
  • mcastport はクラスタ間通信で利用する UDP ポートを指定する
  • ttl は読んで時の如く Time To Live でマルチキャスト transport 利用時のみ有効

transport

  • udpuUDP ユニキャスト通信でクラスタ間の通信を行う

logging

ログにまつわるオプション諸々。

fileline

  • ファイル名や行をログに出力する

to_logfile

  • 個別のログファイルにログを出力する

to_syslog

  • syslog 経由でログを出力する

debug

  • デバッグの設定

logfile

  • ログファイルのパスを指定する

timestamp

  • ログにタイムスタンプを記録する

logger_subsys

  • logger_subsys の設定で上書きする
  • subsyssubsys 名を指定する
  • AMFOpenAIS を利用する場合は有効にする

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment