---
schema_version: "1"
id: 6e382e75bf28ee7335f48e3d29135ec1ae675fd9fc6373057e3c2e9c21bc4534
title: 自己管理 Flex Gateway の登録の更新
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/gateway/1.9/flex-gateway-renew-certificate.md
canonical_url: https://docs.mulesoft.com/jp/gateway/1.9/flex-gateway-renew-certificate
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 2d7b39d5d2798a196f8560a679d0afd8755ef3777ddb40a03c2bf0152fd4dfb0
description: MuleSoft Documentation Site
release: "1.9"
latest: false
---
# 自己管理 Flex Gateway の登録の更新

Anypoint Flex Gateway では、管理された PKI 証明書を使用して Anypoint Platform と通信します。この証明書は、Flex Gateway を接続モードまたはローカルモードで登録すると生成されます。証明書を更新すると、確実にアプリケーションを運用し続けることができます。

証明書の更新は、​`flexctl registration renew`​ コマンドを使用して登録を更新することで行います。

- `renew`​ コマンドにより、Runtime Manager を使用して既存の Flex Gateway 登録が更新されます。
- 認証では、ユーザー証明書または接続アプリケーションのログイン情報を使用して ​`renew`​ コマンドを実行します。ユーザーログイン情報を使用した認証には、​`--username`​ フラグと ​`--password`​ フラグが必要です。接続アプリケーションのログイン情報を使用した認証には、​`--client-id`​ フラグと ​`--client-secret`​ フラグが必要です。

`flexctl registration inspect`​ コマンドを使用して更新プロセスを確認します。

- `inspect`​ コマンドでは、​`renew`​ コマンドが成功したかどうかを確認するために使用できる登録情報が抽出されます。
- `inspect`​ コマンドを使用して、登録の更新が実際に必要かどうかを最初に判断することもできます。​`inspect`​ コマンドでは、証明書の有効期限が返されます。
- デフォルトの方法を使用して更新を確認 (調査) することも、既存の登録ファイルを指定することもできます。フラグを付けずに ​`inspect`​ コマンドを実行すると、このコマンドでデフォルトの方法を使用して登録状況が調査されます。

中断を回避する手順は、次のとおりです。

1. [最新バージョンの Flex Gateway をダウンロードします。](#before-you-begin)
2. Flex Gateway の登録を更新します。
    
    2 つの方法のいずれかを選択します。
    
    - [Anypoint Platform ユーザーログイン情報](#renew-with-user-password)
    - [接続アプリケーションのログイン情報](#renew-with-conn-app)
3. 更新プロセスが成功したことを確認します。
    
    2 つの方法のいずれかを選択します。
    
    - [デフォルトの方法](#inspect-with-custom-url)
    - [登録ファイル](#inspect-with-reg-file)

## [](#before-you-begin)始める前に

登録更新 ​`flexctl`​ コマンドを呼び出すには、最新バージョンの Flex Gateway をダウンロードしてください。このバージョンのゲートウェイを登録して実行する必要はありません。

- [Flex Gateway のダウンロード](https://docs.mulesoft.com/jp/gateway/1.9/flex-install)

## [](#renew-with-user-password)Anypoint Platform ユーザーログイン情報を使用して登録を更新する

1. `flex-renew-registration`​ という名前 (または同様の名前) の新しいディレクトリを作成します。この新しいディレクトリで ​`renew`​ コマンドを実行します。このコマンドは、新しい登録ファイルを作成します。
    
    <table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
<div class="paragraph">
<p>既存の登録ファイルが含まれているディレクトリで ​<code>renew</code>​ コマンドが実行されると、登録更新に失敗します。</p>
</div>
</td>
</tr>
</tbody></table>
2. 次のコマンドを使用します。
    
    - Linux
    - Docker
    - Podman
    
    ```ssh
    flexctl registration renew --username=<your-username> --password=<your-password> \
     <path-to-registration-file>
    ```
    
    `<your-username>`​ と ​`<your-password>`​ は Anypoint Platform ユーザーログイン情報に置き換えます。
    
    `<path-to-registration-file>`​ は既存の ​`registration.yaml`​ ファイルのパスとファイル名に置き換えます。
    
    このコマンドの実行時にファイル権限の問題が発生した場合は、​`sudo`​ を使用してください。
    
    コンテナで実行されている Flex Gateway の場合、コンテナの ​`run`​ コマンドの一部として ​`renew`​ を呼び出します。
    
    ```ssh
    docker run --entrypoint flexctl \
    -v "$(pwd)":/renew \
    -v <path-to-registration-directory>:/registration \
    -u $UID mulesoft/flex-gateway \
    registration renew \
    --username=<your-username> \
    --password=<your-password> \
    --output-directory=/renew \
    <path-to-registration-file-in-container>
    ```
    
    `<your-username>`​ と ​`<your-password>`​ は Anypoint Platform ユーザーログイン情報に置き換えます。
    
    `<path-to-registration-file-in-container>`​ は既存の ​`registration.yaml`​ ファイルのパスとファイル名に置き換えます。コンテナファイルシステムでファイルを指定する必要があります。この場合は ​`/registration/registration.yaml`​ です。
    
    たとえば、​`/home/user/flex/registration.yaml`​ に現在の登録ファイルが含まれている場合は、​`/home/user/flex/`​ に移動して Anypoint Platform ログイン情報を使用して次のコマンドを実行します。
    
    ```ssh
    docker run --entrypoint flexctl \
    -u $UID -v "$(pwd)":/registration  \
    mulesoft/flex-gateway \
    registration renew \
    --username=<your-username> \
    --password=<your-password> \
    --output-directory=/registration/new \
    /registration/registration.yaml
    ```
    
    このコマンドでは、新しい登録ファイル ​`/home/user/flex/new/registration.yaml`​ が作成されます。
    
    コンテナで実行されている Flex Gateway の場合、コンテナの ​`run`​ コマンドの一部として ​`renew`​ を呼び出します。
    
    ```ssh
    podman run --entrypoint flexctl --userns=keep-id \
    -v "$(pwd)":/renew:Z \
    -v <path-to-registration-directory>:/registration:Z \
    -u $UID docker.io/mulesoft/flex-gateway \
    registration renew \
    --username=<your-username> \
    --password=<your-password> \
    --output-directory=/renew \
    <path-to-registration-file-in-container>
    ```
    
    `<your-username>`​ と ​`<your-password>`​ は Anypoint Platform ユーザーログイン情報に置き換えます。
    
    `<path-to-registration-file-in-container>`​ は既存の ​`registration.yaml`​ ファイルのパスとファイル名に置き換えます。コンテナファイルシステムでファイルを指定する必要があります。この場合は ​`/registration/registration.yaml`​ です。
    
    <table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
<div class="paragraph">
<p>ユーザーログイン情報を使用して ​<code>renew</code>​ コマンドを実行する前に、Anypoint Platform アカウントの MFA を無効にします。</p>
</div>
</td>
</tr>
</tbody></table>
3. コマンドを実行します。
    
    出力には次のメッセージが含まれます。
    
    ```text
    Registration renewal completed
    ```
4. 新規作成された登録ファイルを実行時の登録ファイルの場所にコピーします。例:
    
    `/usr/local/share/mulesoft/flex-gateway/conf.d/registration.yaml`
5. Flex Gateway レプリカがすでに実行されている場合は、再起動します。

## [](#renew-with-conn-app)接続アプリケーションのログイン情報を使用して登録を更新する

1. Anypoint Platform のユーザー名またはパスワードがない場合は、Anypoint アクセス管理から​[接続アプリケーションを設定](https://docs.mulesoft.com/jp/access-management/connected-apps-developers#create-a-connected-app)​できます。
    
    1. 以下のスコープを含めます。
        
        - Read Servers (サーバーの参照)
        - Manage Servers (サーバーの管理)
        - View Organization (組織の表示)
    2. 設定する接続アプリケーションの ​**ID**​ と​**シークレット**​を保存してから、​`renew`​ コマンドでこれらのログイン情報を使用します。
2. `flex-renew-registration`​ という名前 (または同様の名前) の新しいディレクトリを作成します。この新しいディレクトリで ​`renew`​ コマンドを実行します。このコマンドは、新しい登録ファイルを作成します。
    
    <table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
<div class="paragraph">
<p>既存の登録ファイルが含まれているディレクトリで ​<code>renew</code>​ コマンドが実行されると、登録更新に失敗します。</p>
</div>
</td>
</tr>
</tbody></table>
3. 次のコマンドを使用します。
    
    - Linux
    - Docker
    - Podman
    
    ```ssh
    flexctl registration renew --client-id=<your-client-id> --client-secret=<your-client-secret> \
     <path-to-registration-file>
    ```
    
    `<your-client-id>`​ と ​`<your-client-secret>`​ は接続アプリケーションのログイン情報に置き換えます。
    
    `<path-to-registration-file>`​ は既存の ​`registration.yaml`​ ファイルのパスとファイル名に置き換えます。
    
    このコマンドの実行時にファイル権限の問題が発生した場合は、​`sudo`​ を使用してください。
    
    コンテナで実行されている Flex Gateway の場合、コンテナの ​`run`​ コマンドの一部として ​`renew`​ を呼び出します。
    
    ```ssh
    docker run --entrypoint flexctl \
    -v "$(pwd)":/renew \
    -v <path-to-registration-directory>:/registration \
    -u $UID mulesoft/flex-gateway \
    registration renew \
    --client-id=<your-client-id> \
    --client-secret=<your-client-secret> \
    --output-directory=/renew \
    <path-to-registration-file-in-container>
    ```
    
    `<your-client-id>`​ と ​`<your-client-secret>`​ は接続アプリケーションのログイン情報に置き換えます。
    
    `<path-to-registration-file-in-container>`​ は既存の ​`registration.yaml`​ ファイルのパスとファイル名に置き換えます。コンテナファイルシステムでファイルを指定する必要があります。この場合は ​`/registration/registration.yaml`​ です。
    
    たとえば、​`/home/user/flex/registration.yaml`​ に現在の登録ファイルが含まれている場合は、​`/home/user/flex/`​ に移動して接続アプリケーションのログイン情報を使用して次のコマンドを実行します。
    
    ```ssh
    docker run --entrypoint flexctl \
    -u $UID -v "$(pwd)":/registration  \
    mulesoft/flex-gateway \
    registration renew \
    --client-id=<your-client-id> \
    --client-secret=<your-client-secret> \
    --output-directory=/registration/new \
    /registration/registration.yaml
    ```
    
    このコマンドでは、新しい登録ファイル ​`/home/user/flex/new/registration.yaml`​ が作成されます。
    
    コンテナで実行されている Flex Gateway の場合、コンテナの ​`run`​ コマンドの一部として ​`renew`​ を呼び出します。
    
    ```ssh
    podman run --entrypoint flexctl --userns=keep-id \
    -v "$(pwd)":/renew:Z \
    -v <path-to-registration-directory>:/registration:Z \
    -u $UID docker.io/mulesoft/flex-gateway \
    registration renew \
    --client-id=<your-client-id> \
    --client-secret=<your-client-secret> \
    --output-directory=/renew \
    <path-to-registration-file-in-container>
    ```
    
    `<your-client-id>`​ と ​`<your-client-secret>`​ は接続アプリケーションのログイン情報に置き換えます。
    
    `<path-to-registration-file-in-container>`​ は既存の ​`registration.yaml`​ ファイルのパスとファイル名に置き換えます。コンテナファイルシステムでファイルを指定する必要があります。この場合は ​`/registration/registration.yaml`​ です。
4. コマンドを実行します。
    
    出力には次のメッセージが含まれます。
    
    ```text
    Registration renewal completed
    ```
5. 新規作成された登録ファイルを実行時の登録ファイルの場所にコピーします。例:
    
    `/usr/local/share/mulesoft/flex-gateway/conf.d/registration.yaml`
6. Flex Gateway レプリカがすでに実行されている場合は、再起動します。

## [](#inspect-with-custom-url)デフォルトの方法を使用した登録状況の確認

登録を調査するには、次のコマンドを実行します。

- Linux
- Docker
- Podman

```ssh
flexctl registration inspect
```

このコマンドの実行時にファイル権限の問題が発生した場合は、​`sudo`​ を使用してください。

コンテナで実行されている Flex Gateway の場合、コンテナの ​`exec`​ コマンドの一部として ​`inspect`​ を実行します。​`<container-name-or-id>`​ は実行中のコンテナ参照に置き換えます。

```ssh
docker exec -u $UID <container-name-or-id> flexctl registration inspect
```

コンテナで実行されている Flex Gateway の場合、コンテナの ​`exec`​ コマンドの一部として ​`inspect`​ を実行します。​`<container-name-or-id>`​ は実行中のコンテナ参照に置き換えます。

```ssh
podman exec -u $UID <container-name-or-id> flexctl registration inspect
```

出力には証明書の有効期限の日付が含まれます。次に例を示します。

```text
{“expiration_date”: “2025-09-25 19:27:32 +0000 UTC”}
```

## [](#inspect-with-reg-file)登録ファイルを使用した登録状況の確認

`registration.yaml`​ ファイルから情報を抽出して、登録を調査できます。パスとファイル名を指定します。

登録を調査するには、次のコマンドを実行します。

- Linux
- Docker
- Podman

```ssh
flexctl registration inspect --file=<path-to-registration-file>
```

このコマンドの実行時にファイル権限の問題が発生した場合は、​`sudo`​ を使用してください。

コンテナで実行されている Flex Gateway の場合、コンテナの ​`run`​ コマンドの一部として ​`inspect`​ を呼び出します。

```ssh
docker run --entrypoint flexctl \
-v <path-to-registration-directory>:/registration \
-u $UID mulesoft/flex-gateway \
registration inspect --file=<path-to-registration-file>
```

コンテナで実行されている Flex Gateway の場合、コンテナの ​`run`​ コマンドの一部として ​`inspect`​ を呼び出します。

```ssh
podman run --entrypoint flexctl --userns=keep-id \
-v <path-to-registration-directory>:/registration:Z \
-u $UID docker.io/mulesoft/flex-gateway \
registration inspect --file=<path-to-registration-file>
```

出力には証明書の有効期限の日付が含まれます。

```text
{“expiration_date”: “2025-09-25 19:27:32 +0000 UTC”}
```

たとえば、現在のディレクトリに登録ファイルが含まれている場合は、次のコマンドを実行します。

```ssh
docker run --entrypoint flexctl \
-v "$(pwd)":/registration \
-u $UID mulesoft/flex-gateway \
registration inspect --file=/registration/registration.yaml
```

## [](#kubernetes-で実行されている-flex-gateway-の登録を確認する)Kubernetes で実行されている Flex Gateway の登録を確認する

次の例では、Flex Gateway が ​`ingress`​ リリース名を使用して ​`gateway`​ 名前空間にインストールされていて、登録が Kubernetes データベースに保存されているシナリオについて説明します。

1. 次の ​`kubectl`​ コマンドを使用して ​`registration.yaml`​ ファイルを復元します。
    
    ```ssh
    kubectl -n gateway get secret "$(kubectl -n gateway get deployment ingress -o=jsonpath='{.spec.template.spec.volumes[?(@.name=="registration")].secret.secretName}')" -o=jsonpath='{.data.registration\.yaml}' | base64 --decode > registration.yaml
    ```
    
    このコマンドにより、登録ファイルが ​`./registration.yaml`​ に保存されます。
2. 前のセクションで Docker について説明しているように、​`flexctl registration renew`​ コマンドを実行します。
    
    - [Anypoint Platform ユーザーログイン情報を使用して更新する](#renew-with-user-password)
    - [接続アプリケーションのログイン情報を使用して更新する](#renew-with-conn-app)
3. 次の ​`helm`​ コマンドを使用して Flex Gateway をアップグレードします。
    
    ```ssh
    helm get values -n gateway ingress > values.yaml \
    && helm upgrade -n gateway ingress flex-gateway/flex-gateway --wait -f values.yaml --set-file registration.content=new/registration.yaml
    ```

## [](#更新コマンドと検証コマンドを使用したヘルプの取得)更新コマンドと検証コマンドを使用したヘルプの取得

次の ​`help`​ コマンドを実行して使用方法に関する情報を確認できます。

- 更新
    
    - Linux
    - Docker
    - Podman
    
    ```ssh
    flexctl registration renew --help
    ```
    
    このコマンドの実行時にファイル権限の問題が発生した場合は、​`sudo`​ を使用してください。
    
    コンテナで実行されている Flex Gateway の場合、コンテナの ​`run`​ コマンドの一部として ​`help`​ を呼び出します。
    
    ```ssh
    docker run --entrypoint flexctl mulesoft/flex-gateway registration renew --help
    ```
    
    コンテナで実行されている Flex Gateway の場合、コンテナの ​`run`​ コマンドの一部として ​`help`​ を呼び出します。
    
    ```ssh
    podman run --entrypoint flexctl docker.io/mulesoft/flex-gateway registration renew --help
    ```
- 検証
    
    - Linux
    - Docker
    - Podman
    
    ```ssh
    flexctl registration inspect --help
    ```
    
    このコマンドの実行時にファイル権限の問題が発生した場合は、​`sudo`​ を使用してください。
    
    コンテナで実行されている Flex Gateway の場合、コンテナの ​`run`​ コマンドの一部として ​`help`​ を呼び出します。
    
    ```ssh
    docker run --entrypoint flexctl mulesoft/flex-gateway registration inspect --help
    ```
    
    コンテナで実行されている Flex Gateway の場合、コンテナの ​`run`​ コマンドの一部として ​`help`​ を呼び出します。
    
    ```ssh
    podman run --entrypoint flexctl docker.io/mulesoft/flex-gateway registration inspect --help
    ```

## [](#期限切れの登録の更新)期限切れの登録の更新

接続モードで期限切れの証明書を使用して Flex Gateway を実行しようとすると、次の結果になります。

- 新規のレプリカは Anypoint Platform から API 設定のダウンロードに失敗するため、使用できなくなります。既存のクラスターは再読み込みに失敗します。
- ログとメトリクスは Anypoint Platform へのアップロードに失敗します。Anypoint Platform を使用したトラブルシューティングはできません。
- 測定情報 Anypoint Platform へのアップロードに失敗します。MuleSoft では使用量メトリクスの収集やレポートができません。

ローカルモードで期限切れの証明書を使用して Flex Gateway を実行しようとすると、次の結果になります。

- 測定情報 Anypoint Platform へのアップロードに失敗します。MuleSoft では使用量メトリクスの収集やレポートができません。

証明書の期限が切れていても ​`flexctl registration renew`​ を呼び出すことはでき、これによって期限切れの証明書が更新されます。

## [](#関連情報)関連情報

- [Flex Gateway のダウンロード](https://docs.mulesoft.com/jp/gateway/1.9/flex-install)
- [接続モードでの Flex Gateway の登録と実行](https://docs.mulesoft.com/jp/gateway/1.9/flex-conn-reg-run)
- [ローカルモードでの Flex Gateway の登録と実行](https://docs.mulesoft.com/jp/gateway/1.9/flex-local-reg-run)