コンテンツにスキップ

16.4.7 machclusterctl

machclusterctlは、Machbase Cluster Editionのクラスター全体を単一のコマンドで管理するツールです。YAML設定の検証、新規インストール、稼働中の構成変更、アップグレード、起動/終了、状態確認などを行います。

主なコマンド

コマンド説明
validatecluster.yamlの検証
installcluster.yamlに基づく新規クラスターのインストール
apply稼働中のクラスターに設定変更を反映
upgradeパッケージのアップグレード(--online--full-stop
export稼働中のクラスター構成をフラットなYAMLでエクスポート
statusクラスター全ノードの状態確認
connectBroker/Warehouseのエイリアスへmachsqlで接続
startクラスター全ノードの起動
stopクラスター全ノードの正常終了
destroyクラスターの削除(データを含む)

使用方法

machclusterctl <command> [options]

コマンドの詳細

validate

YAML設定ファイルを検証します。

machclusterctl validate -f cluster.yaml

install

YAML設定ファイルを読み込み、新規クラスターをインストールします。

machclusterctl install -f cluster.yaml

apply

稼働中のクラスターに設定変更を反映します。

machclusterctl apply -f cluster.yaml

upgrade

パッケージをアップグレードします。

machclusterctl upgrade --online broker
machclusterctl upgrade --full-stop

start

Coordinator → Deployer → Broker → Warehouseの順にクラスター全体を起動します。

machclusterctl start
machclusterctl start -f cluster.yaml

stop

クラスター全体を正常終了します。

machclusterctl stop

destroy

クラスターを完全に削除します。データベースファイルも削除するため、注意して使用してください。

machclusterctl destroy

status

クラスターの各ノードの現在の状態を表示します。

machclusterctl status

connect

Brokerノードへmachsqlで接続します。

machclusterctl connect

export

現在のクラスター構成をYAMLファイルへエクスポートします。

machclusterctl export -o cluster_backup.yaml

YAML設定ファイルの構造

machclusterctl validateinstallapplyで使用するYAML設定ファイルの基本構造です。

cluster:
  coordinator:
    host: 192.168.0.32
    port: 5101
    http_port: 5102
    home: /home/machbase/coordinator1

  deployer:
    - host: 192.168.0.32
      port: 5201
      home: /home/machbase/deployer1

  broker:
    - host: 192.168.0.32
      port: 5301
      http_port: 5302
      home: /home/machbase/broker1
      service_port: 5757

  warehouse:
    - group: Group1
      host: 192.168.0.32
      port: 5401
      http_port: 5402
      home: /home/machbase/warehouse_a1
      service_port: 5400

オプション

オプション説明
-f, --fileクラスター設定YAMLファイルのパス
-s, --silent進行ログの出力を削減
-v, --verbose詳細な進行ログを表示
--nodestart/stopの対象ノードのエイリアスを指定
--typestart/stopの対象ノードタイプを指定
-o, --output出力ファイルのパス(exportで使用)
-h, --helpヘルプを表示

使用例

# YAMLの検証
machclusterctl validate -f my_cluster.yaml

# クラスターの新規インストール
machclusterctl install -f my_cluster.yaml

# 稼働中のクラスターに変更を反映
machclusterctl apply -f my_cluster.yaml

# クラスターの起動
machclusterctl start

# 特定タイプまたはノードのみ停止/起動
machclusterctl stop --node broker-1
machclusterctl start --type warehouse

# 状態確認
machclusterctl status

# Brokerに接続してSQLを実行
machclusterctl connect

# クラスターの終了
machclusterctl stop

# 設定のエクスポート
machclusterctl export -o cluster_config_backup.yaml
最終更新日