

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 安裝 代理程式
<a name="installing-the-agent"></a>

 AWS Ground Station 代理程式的安裝方式如下：

1. CloudFormation 範本 （建議）。

1. 在 Amazon EC2 上手動安裝。

## 使用 CloudFormation 範本
<a name="using-cloudformation-template"></a>

EC2 資料交付 CloudFormation 範本會建立必要的 AWS 資源，以將資料交付至 EC2 執行個體。此 CloudFormation 範本使用預先安裝 AWS Ground Station 代理程式的 AWS Ground Station 受管 AMI。然後，建立的 EC2 執行個體的開機指令碼會填入代理程式組態檔案，並套用必要的效能調校 ([調校 EC2 執行個體的效能](ec2-instance-performance-tuning.md))。

### 步驟 1：建立 AWS 資源
<a name="create-aws-resources"></a>

 使用範本建立 AWS 資源堆疊 [ 使用 AWS Ground Station Agent （寬頻） 公有廣播衛星 ](https://docs.aws.amazon.com/ground-station/latest/ug/examples.pbs-agent.html)。

### 步驟 2：檢查客服人員狀態
<a name="check-agent-status"></a>

根據預設，代理程式已設定並處於作用中狀態 （已啟動）。若要檢查代理程式狀態，您可以連線至 EC2 執行個體 (SSH 或 SSM Session Manager) 並參閱 [AWS Ground Station 客服人員狀態](managing-agent.md#gs-agent-status)。

## 在 EC2 上手動安裝
<a name="manually-install-ec2"></a>

 雖然 Ground Station 建議使用 CloudFormation 範本來佈建 AWS 資源，但可能會有標準範本可能不足的使用案例。在這種情況下，我們建議您自訂範本以符合您的需求。如果仍然不符合您的需求，您可以手動建立 AWS 資源並安裝代理程式。

### 步驟 1：建立 AWS 資源
<a name="create-aws-resources"></a>

 如需手動設定聯絡所需的 AWS 資源的說明，請參閱[範例任務描述檔組態](https://docs.aws.amazon.com/ground-station/latest/ug/examples.html)。

**AwsGroundStationAgentEndpoint** 資源定義了透過 AWS Ground Station 客服人員接收 DigIF 資料流程的端點，對於成功聯絡至關重要。當 API 文件位於 [API 參考](https://docs.aws.amazon.com/ground-station/latest/APIReference/Welcome.html)中時，本節將簡短討論與 AWS Ground Station 代理程式相關的概念。

 端點的 `ingressAddress`是 AWS Ground Station 代理程式將從天線接收 AWS KMS 加密 UDP 流量的位置。`socketAddress` `name` 是 EC2 執行個體的公有 IP （來自連接的 EIP)。`portRange` 應為範圍中至少 300 個連續連接埠，這些連接埠已從任何其他用途保留。如需說明，請參閱 [預留輸入連接埠 - 影響網路](ec2-instance-performance-tuning.md#reserve-ingress-ports)。這些連接埠必須設定為允許接收者執行個體執行所在 VPC 之安全群組上的 UDP 輸入流量。

 端點的 `egressAddress`是 代理程式將 DigIF 資料流程交給您的位置。您應該讓應用程式 （例如 SDR) 在此位置透過 UDP 通訊端接收資料。

### 步驟 2：建立 EC2 執行個體
<a name="create-ec2-instance"></a>

支援下列 AMIs：

1. AWS Ground Station AMI – `groundstation-al2-gs-agent-ami-*`其中 \* 是 AMI 建置的日期 – 隨附已安裝的代理程式 （建議）。

1. `amzn2-ami-kernel-5.10-hvm-x86_64-gp2`.

### 步驟 3：下載並安裝代理程式
<a name="download-install-agent"></a>

**注意**  
 如果您**未在**上一個步驟中選擇 AWS Ground Station 客服人員 AMI，則必須完成本節中的步驟。

#### 下載代理程式
<a name="download-agent"></a>

 AWS Ground Station 代理程式可從區域特定的 S3 儲存貯體取得，並且可以使用 AWS 命令列 (CLI) 下載到支援的 EC2 執行個體。我們建議您一律從 `latest` 路徑下載 ，以確保您執行的是最新版本的代理程式。下載路徑是 ${AWS：：Region} 參考其中一個支援的 [ AWS Ground Station 主控台和資料交付區域](https://docs.aws.amazon.com/ground-station/latest/ug/aws-ground-station-antenna-locations.html)`s3://groundstation-wb-digif-software-${AWS::Region}/aws-groundstation-agent/latest/amazon_linux_2_x86_64/aws-groundstation-agent.rpm`。

**注意**  
 一律使用 `latest` 路徑，而不是硬式編碼下載指令碼中的特定版本編號。使用 `latest` 路徑可確保您的執行個體在佈建時自動接收安全修補程式和錯誤修正。

 範例：將最新的 rpm 版本從 AWS 區域 us-east-2 本機下載至 /tmp 資料夾。

```
aws s3 --region us-east-2 cp s3://groundstation-wb-digif-software-us-east-2/aws-groundstation-agent/latest/amazon_linux_2_x86_64/aws-groundstation-agent.rpm /tmp
```

 如果您需要下載特定版本的 AWS Ground Station 代理程式以進行故障診斷或復原，您可以從 S3 儲存貯體中的版本特定資料夾下載。這不建議用於正常操作。

 範例：將版本 1.0.2716.0 的 rpm 從 AWS region us-east-2 本機下載至 /tmp 資料夾。

```
aws s3 --region us-east-2 cp s3://groundstation-wb-digif-software-us-east-2/aws-groundstation-agent/1.0.2716.0/amazon_linux_2_x86_64/aws-groundstation-agent.rpm /tmp
```

**注意**  
如果您想要確認您下載的 RPM 是由 提供 AWS Ground Station，請遵循 的指示[RPM 安裝驗證](rpm-install-validation.md)。

#### 安裝代理程式
<a name="install-agent"></a>

```
sudo yum install ${MY_RPM_FILE_PATH}

Example: Assumes agent is in the "/tmp" directory
sudo yum install /tmp/aws-groundstation-agent.rpm
```

### 步驟 4：設定代理程式
<a name="configure-agent"></a>

 安裝代理程式後，您必須更新代理程式組態檔案。請參閱 [設定代理程式](configuring-agent.md)。

### 步驟 5：套用效能調校
<a name="apply-performance-tuning"></a>

 **AWS Ground Station 客服人員 AMI**：如果您在上一個步驟中選擇 AWS Ground Station 了客服人員 AMI，請套用下列效能調校。
+  [調校硬體中斷和接收佇列 - 影響 CPU 和網路](ec2-instance-performance-tuning.md#tune-hardware-interrupts) 
+ [預留輸入連接埠 - 影響網路](ec2-instance-performance-tuning.md#reserve-ingress-ports)
+ [重新啟動](ec2-instance-performance-tuning.md#reboot)

 **其他 AMIs**：如果您在上一個步驟中選擇任何其他 AMI，請套用 下列出的所有調校，[調校 EC2 執行個體的效能](ec2-instance-performance-tuning.md)然後重新啟動執行個體。

### 步驟 6：管理代理程式
<a name="manage-agent"></a>

 若要啟動，請停止並檢查客服人員狀態，請參閱 [管理代理程式](managing-agent.md)。