---
schema_version: "1"
id: 328ea4f7d01a787d0865934b536e16187063eea5cc5bbf34de44df23b1dd23f6
title: Mule の起動と停止
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/mule-runtime/4.4/starting-and-stopping-mule-esb.md
canonical_url: https://docs.mulesoft.com/jp/mule-runtime/4.4/starting-and-stopping-mule-esb
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 6d97782f76a1c4d30b3cf59406e913322408e33fcb54d42433b7be3bf6786434
description: MuleSoft Documentation Site
release: "4.4"
latest: false
---
# Mule の起動と停止

Mule Runtime Engine を起動および停止して Mule アプリケーションをデプロイする方法を説明します。管理機能および監視機能を最大限に活用するために、Anypoint Runtime Manager を使用して同じ Mule インスタンスにデプロイできます。

Mule は Java サービスラッパーを使用してネイティブ OS から Java 仮想マシン (JVM) を制御します。ラッパーには Mule を Unix デーモンとして実行する機能や Mule を Windows サービスとしてインストールまたは削除する機能を含めて、多くのオプションと機能があります。ラッパーはシステムシグナルを処理してパラメーターを開始するため、全体的に JVM と基礎となる OS 間のインタラクションが大幅に向上します。

## [](#スクリプトの起動とシャットダウン)スクリプトの起動とシャットダウン

ラッパーは ​`$MULE_HOME/bin`​ のスクリプトによってコールされます。

次の表に、スクリプトが受け入れるすべてのパラメーターを示します。

<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 30%;">
<col style="width: 70%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">パラメーター</th>
<th class="tableblock halign-left valign-top">説明</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>start</code></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>ターミナルのバックグラウンドで Mule を起動します。</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>stop</code></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>Mule を停止します。インバウンドエンドポイントは Mule がシャットダウンする前にインフライトメッセージを処理します。ただし、タイムアウト期間後に、完了していないインフライトメッセージが破棄され、Mule がシャットダウンします。</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>restart</code></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>Mule を再起動します。</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>status</code></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><strong>(Linux/Unix のみ)</strong>​。Mule サーバー (​<code>running</code>​ または ​<code>not running</code>​) および実行している場合はプロセスの PID の状況を表示します。</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>dump</code></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><strong>(Linux/Unix のみ)</strong>​。Mule ラッパーのコアを ​<code>$MULE_HOME/log/mule_ee.log</code>​ にダンプします。</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>console</code></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>ターミナルのフォアグラウンドで Mule を起動します (コンソールモード)。パラメーターを指定せずに ​<code>mule</code>​ を実行するのと同じです。</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>install</code></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>Mule を Windows サービスまたは Linux/Unix デーモンとしてインストールします。</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>remove</code></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>Mule を Windows サービスまたは Linux/Unix デーモンから削除します。</p>
</div></div></td>
</tr>
</tbody>
</table>

## [](#mule-の起動)Mule の起動

Mule ソフトウェア配布物を展開した場所にディレクトリを変更してから bin ディレクトリに変更して、コマンドラインから Mule を起動します。次のコマンドを実行します。

- Windows 環境:
    
    ```powershell
    $ $MULE_HOME\bin\mule.bat
    ```
- Linux/Unix 環境:
    
    ```console
    $ $MULE_HOME/bin/mule
    ```

これらのコマンドは、Mule をフォアグラウンドで実行し、起動スクリプトによってターミナルの標準出力に情報が表示されます。Mule の動作中は、他のコマンドを実行することはできません。

Mule を停止するには、スクリプトが動作しているターミナルで ​`CTRL-C`​ を押します。

## [](#windows-サービスとしての-mule-の起動)Windows サービスとしての Mule の起動

Windows サービスとして Mule を実行するには、まず次のように実行して Mule をインストールします。

```powershell
$ $MULE_HOME\bin\mule.bat install
```

インストール後、Mule をサービスとして実行することができます。

```powershell
$ $MULE_HOME\bin\mule.bat start
```

<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
<div class="paragraph">
<p>Windows が再起動すると、​<code>mule stop</code>​ コマンドを使用した場合と同じように Mule サービスが停止します。
唯一異なる状況は、Windows がタイムアウトによってプロセスをキルした場合です。</p>
</div>
</td>
</tr>
</tbody></table>

## [](#linuxunix-デーモンとしての-mule-の起動)Linux/Unix デーモンとしての Mule の起動

Mule を Linux/Unix デーモンとして実行するには、まず次のように実行して Mule をインストールします。

```console
$ $MULE_HOME/bin/mule install
```

インストール後、Mule をデーモンとして実行することができます。

```console
$ $MULE_HOME/bin/mule start
```

<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
<div class="paragraph">
<p>現在のユーザーセッションのバックグラウンドで Mule を起動するこのインストールステップを実行せずに Mule を起動することもできます。</p>
</div>
</td>
</tr>
</tbody></table>

次の例では、Mule を Unix コンソールから起動しています。

```console
$ $MULE_HOME/bin/mule start
MULE_HOME is set to ~/Downloads/mule-enterprise-standalone-4.3.0
MULE_BASE is set to ~/Downloads/mule-enterprise-standalone-4.3.0
Starting Mule Enterprise Edition...
Waiting for Mule Enterprise Edition.................
running: PID:87318
```

## [](#スクリプトからの-mule-の起動)スクリプトからの Mule の起動

Java サービスラッパーを使用せずに Mule をスクリプトまたは IDE から起動するために、​`org.mule.MuleServer`​ クラスを使用できます。このクラスはいくつかのパラメーターを受け入れます。

org.mule.MuleServer -config mule-config.xml

または

org.mule.MuleServer -builder <fully qualified classname> -config appContext.xml

- **\-config**​ は使用する 1 つ以上の設定ファイルを指定します。この引数を省略した場合、​`mule-config.xml`​ が存在する場合はこれを探して使用します。
- **\-builder**​ は使用する設定ビルダーの完全修飾されたクラス名です。この引数を設定しなかった場合、デフォルトの ​`org.mule.config.builders.AutoConfigurationBuilder`​ が使用され、使用可能なビルダーに基づいて設定ファイルの自動検出を試みます。最も一般的なシナリオでは、これは ​`org.mule.config.spring.SpringXmlConfigurationBuilder`​ に解決されます。

クラスパスを設定する最も簡単な方法は、配布の ​`./lib/mule`​ ディレクトリと ​`./lib/opt`​ ディレクトリにすべての JAR を含めることです。サーバーと各モジュールの連動関係レポートを確認して、どの JAR が特定のモジュールに必要かを正確に把握できます。

## [](#mule-の停止)Mule の停止

Mule を停止するには ​`stop`​ コマンドを実行します。

次の例では、Mule を Unix コンソールから停止しています。

```console
$ $MULE_HOME/bin/mule stop
MULE_HOME is set to /Applications/mule-enterprise-standalone-4.3.0
MULE_BASE is set to /Applications/mule-enterprise-standalone-4.3.0
Stopping Mule Enterprise Edition...
Stopped Mule Enterprise Edition.
```

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

- [Mule のダウンロード、インストール、設定、アップグレード](https://docs.mulesoft.com/on-premises/latest/runtime-installation-task)
- [Mule アプリケーションのデプロイ](https://docs.mulesoft.com/mule-runtime/latest/deploying)
- [Anypoint Monitoring](https://docs.mulesoft.com/jp/monitoring/am-installing)
- [Runtime Manager](https://docs.mulesoft.com/jp/runtime-manager/)
- [デプロイメント戦略](https://docs.mulesoft.com/jp/runtime-manager/deployment-strategies)
- [Mule を開始するときにシステムプロパティを設定する](https://docs.mulesoft.com/jp/mule-runtime/4.4/mule-app-properties-system#set-properties)