> For the complete documentation index, see [llms.txt](https://docs.plura.io/ja/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.plura.io/ja/iaas/aws/ec2_scaling.md).

# EC2 Auto Scaling 支援

### 1. [Amazon EC2 Auto Scaling](https://docs.aws.amazon.com/ko_kr/autoscaling/ec2/userguide/what-is-amazon-ec2-auto-scaling.html) とは? <a href="#id-1" id="id-1"></a>

> "Amazon EC2 Auto Scalingを使用すると、アプリケーションのロードを処理できる正確な数のAmazon EC2インスタンスを維持することができます。 Auto ScalingグループというEC2インスタンス集を生成します。
>
> 各Auto Scalingグループの最小インスタンス数を指定することができ、Amazon EC2 Auto Scalingではグループの大きさがこの値を下回りません。
>
> 各Auto Scalingグループの最大インスタンス数を指定することができ、Amazon EC2 Auto Scalingではグループの大きさがこの値を超えません。
>
> 希望する容量を指定した場合、グループを生成した後はいつでもAmazon EC2 Auto Scalingで当該グループでこれだけのインスタンスを保有することができます。
>
> 調整ポリシーを指定した場合、Amazon EC2 Auto Scalingではアプリケーションの増減によってインスタンスを立ち上げたり、解約したりすることができます。"

### 2. Amazon EC2 Auto Scaling 環境の構成例 <a href="#id-2" id="id-2"></a>

* 図のような環境でインスタンスにPLURAエージェントをインストールして使用することができます。
* インスタンスがグループから分離されたり、Standby状態になってもホストが終了するのではなく、Auto Scalingグループと接続された弾力的ロードバランサーから該当インスタンスが削除され、トラフィックがロードバランサーからこれらのインスタンスにルートされないだけなので、PLURAエージェントは引き続きログを収集します。

<figure><img src="/files/M4XA933jMuJWNfxJiXIL" alt=""><figcaption><p>[ <a href="https://docs.aws.amazon.com/ja_jp/autoscaling/ec2/userguide/what-is-amazon-ec2-auto-scaling.html">オリジナルソース</a> ]</p></figcaption></figure>

### 3. PLURA エージェント設定 <a href="#id-3" id="id-3"></a>

* PLURAエージェントで次のようにAutoScalingで活用する機能を設定することができます。

```bash
vi /etc/plura/conf/plura.conf

# ホスト起動時にエージェントログイン遅延設定、 単位秒
login_delay_sec = 0

# Auto Scaling使用時にインスタンス固有の識別子をホストに転送する設定(値が1のときに転送)
login_with_machine_id = 0

# 複数のネットワーク インターフェイスを使用するときにウェブに表示されるIP アドレス設定
#（システム > システム管理リストに表示される代表IPアドレスを指定）
interface = eth1
#（システム > リソース モニタリング > ネットワーク トラフィックを収集するインターフェイスの設定）
interface_mon = eth1

# ホスト起動時のhostname変更によるログイン遅延設定
login_hostname_check=0 (default = 0)
# 0 > 指定された遅延時間まで絶対に待つ
# 1 > hostname変更が1回検出されると遅延中断
# 2 > hostname変更が2回検出されたら遅延中断
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.plura.io/ja/iaas/aws/ec2_scaling.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
