switchover#

新しい書き込みリーダーに切り替えます。

概要#

新しい書き込みリーダーに切り替えます。即時スイッチオーバーには、スイッチオーバー方法’fast’を使用します。 ’strict’を使用して、指定されたターゲットノードで遅延が’route_writer_max_lag’より小さくなるまで待機します。タイムアウトまたはその他の問題のためにスイッチオーバーが失敗した場合、 BDRは特定のターゲットノードとは異なる書き込みリーダーを選択する場合があります。

pgd switchover [flags]

例#

Example 1 (with required arguments, default method is strict and default
timeout is 10s)

$ pgd switchover --group-name group_a --node-name bdr-a1
switchover is complete

Example 2 (with optional arguments)

$ pgd switchover --group-name group_a --node-name bdr-a1 --method strict --timeout 15s
switchover is complete

Example 3 (immediate switchover)

$ pgd switchover --group-name group_a --node-name bdr-a1 --method fast
switchover is complete

オプション#

    --group-name string   group name
-h, --help                help for switchover
    --method string       switchover method (strict, fast)
                          strict - waits until lag on given node is less than route_writer_max_lag
                          fast - immediate switchover, route_writer_max_lag is ignored (default "strict")
    --node-name string    node name
    --timeout duration    timeout period when switchover method is strict (default 10s)

親コマンドから継承したオプション#

-f, --config-file string   config file; ignored if
                           --dsn flag is present (default "/etc/edb/pgd-cli/pgd-cli-config.yml")
    --dsn string           database connection string
                           e.g."host=bdr-a1 port=5432 dbname=bdrdb user=postgres "
-L, --log-level string     logging level: debug, info, warn, error (default "error")
-o, --output string        output format: json, yaml