起動/停止/再起動#

ここではアプリケーションの起動、停止、再起動の方法を説明します。操作は、サーバーをどのように構築したかによって異なります。

アプリケーションの起動#

アプリケーションの起動方法について示します。

docker compose を使用します。 deployment.zip を使用している場合は、起動したいサービスがある docker-compose ファイルを指定します。

# コンテナの構築と起動
docker compose up -d

# サービス名を使用したコンテナの構築と起動
docker compose up -d <サービス名>

systemctl を使用します。次のコマンドですべてのサービスが起動します。

sudo systemctl start nginx.service
sudo systemctl start intdash-api-auth.service
sudo systemctl start intdash-api-broker.service
sudo systemctl start intdash-api-gateway.service
sudo systemctl start intdash-api-measurement.service
sudo systemctl start intdash-api-media.service
sudo systemctl start intdash-api-tenant.service
sudo systemctl start intdash-api-webhook.service
sudo systemctl start intdash-api-license.service
sudo systemctl start intdash-web-admin-console.service
sudo systemctl start intdash-web-authentication.service
sudo systemctl start intdash-web-device-management-console.service
sudo systemctl start intdash-web-client-auth-redirector.service
sudo systemctl start intdash-web-client-auth.service
sudo systemctl start intdash-web-edge-finder.service
sudo systemctl start intdash-web-meas-hub.service
sudo systemctl start intdash-web-media-explorer.service
sudo systemctl start intdash-web-my-page.service
sudo systemctl start intdash-web-project-console.service
sudo systemctl start intdash-web-tenants.service
sudo systemctl start vm2m-data-viz-backend.service

特定のサービスのみを開始する場合は次のようにします。

sudo systemctl start <サービス名>

デプロイメントの設定でレプリカ数を 1 以上にすることで起動できます。レプリカ数の変更はHelmチャートの values.yaml で指定します。 詳細は Kubernetes(Helm チャート) を参照してください。

values.yaml の変更後は、次の helm upgrade コマンドを実行してください。

helm upgrade intdash oci://<Dockerレジストリ名>/charts/intdash \
--version <チャートのバージョン> \
-f ./values.yaml

注釈

-f オプションは複数個指定できます。環境に応じたファイルがある場合は適宜読み替えてください。

アプリケーションの停止#

アプリケーションの停止方法について示します。

docker compose を使用します。 deployment.zip を使用している場合は停止したいサービスがある docker-compose ファイルを指定します。

# コンテナの削除
docker compose down

# コンテナの停止
docker compose stop

systemctl を使用します。次のコマンドですべてのサービスが停止します。

sudo systemctl stop nginx.service
sudo systemctl stop intdash-api-auth.service
sudo systemctl stop intdash-api-broker.service
sudo systemctl stop intdash-api-gateway.service
sudo systemctl stop intdash-api-measurement.service
sudo systemctl stop intdash-api-media.service
sudo systemctl stop intdash-api-tenant.service
sudo systemctl stop intdash-api-webhook.service
sudo systemctl stop intdash-api-license.service
sudo systemctl stop intdash-web-admin-console.service
sudo systemctl stop intdash-web-authentication.service
sudo systemctl stop intdash-web-device-management-console.service
sudo systemctl stop intdash-web-client-auth-redirector.service
sudo systemctl stop intdash-web-client-auth.service
sudo systemctl stop intdash-web-edge-finder.service
sudo systemctl stop intdash-web-meas-hub.service
sudo systemctl stop intdash-web-media-explorer.service
sudo systemctl stop intdash-web-my-page.service
sudo systemctl stop intdash-web-project-console.service
sudo systemctl stop intdash-web-tenants.service
sudo systemctl stop vm2m-data-viz-backend.service

特定のサービスのみを停止する場合は次のようにします。

sudo systemctl stop <サービス名>

デプロイメントの設定でレプリカ数を 0 にすることで停止できます。レプリカ数の設定と実行するコマンドは 「 アプリケーションの起動 」と同じなので省略します。

アプリケーションの再起動#

アプリケーションの再起動方法について示します。サービスの再起動は主にアプリケーションの設定変更を行ったときに実施します。

docker compose を使用します。 deployment.zip を使用している場合は再起動したいサービスがある docker-compose ファイルを指定します。

docker compose restart <サービス名...>

systemctl を使用します。次のコマンドですべてのサービスが再起動します。

sudo systemctl restart nginx.service
sudo systemctl restart intdash-api-auth.service
sudo systemctl restart intdash-api-broker.service
sudo systemctl restart intdash-api-gateway.service
sudo systemctl restart intdash-api-measurement.service
sudo systemctl restart intdash-api-media.service
sudo systemctl restart intdash-api-tenant.service
sudo systemctl restart intdash-api-webhook.service
sudo systemctl restart intdash-api-license.service
sudo systemctl restart intdash-web-admin-console.service
sudo systemctl restart intdash-web-authentication.service
sudo systemctl restart intdash-web-device-management-console.service
sudo systemctl restart intdash-web-client-auth-redirector.service
sudo systemctl restart intdash-web-client-auth.service
sudo systemctl restart intdash-web-edge-finder.service
sudo systemctl restart intdash-web-meas-hub.service
sudo systemctl restart intdash-web-media-explorer.service
sudo systemctl restart intdash-web-my-page.service
sudo systemctl restart intdash-web-project-console.service
sudo systemctl restart intdash-web-tenants.service
sudo systemctl restart vm2m-data-viz-backend.service

特定のサービスのみを再起動する場合は次のようにします。

sudo systemctl restart <サービス名>

kubectlを使用します。次のコマンドですべてのデプロイメントが再起動します。

kubectl rollout restart -n <名前空間> deployment

特定のサービスのみを再起動する場合は次のようにします。

kubectl rollout restart -n <名前空間> deployment/<デプロイメント名>

デプロイメント名は kubectl get deployment で確認できます。