

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 管理代理
<a name="managing-agent"></a>

 AWS Ground Station 代理提供以下功能，用于使用内置的 Linux 命令工具配置、启动、停止、升级、降级和卸载代理。

**主题**
+ [AWS Ground Station 代理配置](#gs-agent-configuration)
+ [AWS Ground Station 代理启动](#gs-agent-start)
+ [AWS Ground Station 代理停止](#gs-agent-stop)
+ [AWS Ground Station 代理升级](#gs-agent-upgrade)
+ [AWS Ground Station 代理降级](#gs-agent-downgrade)
+ [AWS Ground Station 代理卸载](#gs-agent-uninstall)
+ [AWS Ground Station 代理状态](#gs-agent-status)
+ [AWS Ground Station 代理 RPM 信息](#gs-agent-rpm-info)

## AWS Ground Station 代理配置
<a name="gs-agent-configuration"></a>

 导航到`/opt/aws/groundstation/etc`，其中应包含一个名为 aws-gs-agent-config .json 的文件。请参阅 [代理配置文件](configuring-agent.md#agent-config-file)。

## AWS Ground Station 代理启动
<a name="gs-agent-start"></a>

```
#start
sudo systemctl start aws-groundstation-agent

#check status
systemctl status aws-groundstation-agent
```

应生成显示座席处于**活动状态**的输出。

```
aws-groundstation-agent.service - aws-groundstation-agent
Loaded: loaded (/usr/lib/systemd/system/aws-groundstation-agent.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2023-03-14 00:39:08 UTC; 1 day 13h ago
Docs: https://aws.amazon.com/ground-station/
Main PID: 8811 (aws-gs-agent)
CGroup: /system.slice/aws-groundstation-agent.service
└─8811 /opt/aws/groundstation/bin/aws-gs-agent production
```

## AWS Ground Station 代理停止
<a name="gs-agent-stop"></a>

```
#stop
sudo systemctl stop aws-groundstation-agent

#check status
systemctl status aws-groundstation-agent
```

 应生成显示座席处于**非活动状态**（已停止）的输出。

```
aws-groundstation-agent.service - aws-groundstation-agent
Loaded: loaded (/usr/lib/systemd/system/aws-groundstation-agent.service; enabled; vendor preset: disabled)
Active: inactive (dead) since Thu 2023-03-09 15:35:08 UTC; 6min ago
Docs: https://aws.amazon.com/ground-station/
Process: 84182 ExecStart=/opt/aws/groundstation/bin/launch-aws-gs-agent (code=exited, status=0/SUCCESS)
Main PID: 84182 (code=exited, status=0/SUCCESS)
```

## AWS Ground Station 代理升级
<a name="gs-agent-upgrade"></a>

1. 下载最新版本座席。请参阅[下载座席](installing-the-agent.md#download-agent)。

1. 停止座席。

   ```
   #stop
   sudo systemctl stop aws-groundstation-agent
   
   #confirm inactive (stopped) state
   systemctl status aws-groundstation-agent
   ```

1. 更新座席。

   ```
   sudo yum update ${MY_RPM_FILE_PATH}
   
   # check the new version has been installed correctly by comparing the agent version with the starting agent version
   yum info aws-groundstation-agent
   
   # reload the systemd configuration
   sudo systemctl daemon-reload
   
   # restart the agent
   sudo systemctl restart aws-groundstation-agent
   
   # check agent status
   systemctl status aws-groundstation-agent
   ```

## AWS Ground Station 代理降级
<a name="gs-agent-downgrade"></a>

1. 下载您需要的座席版本。请参阅[下载座席](installing-the-agent.md#download-agent)。

1. 降级座席

   ```
   # get the starting agent version
   yum info aws-groundstation-agent
   
   # stop the agent service
   sudo systemctl stop aws-groundstation-agent
   
   # downgrade the rpm
   sudo yum downgrade ${MY_RPM_FILE_PATH}
   
   # check the new version has been installed correctly by comparing the agent version with the starting agent version
   yum info aws-groundstation-agent
   
   # reload the systemd configuration
   sudo systemctl daemon-reload
   
   # restart the agent
   sudo systemctl restart aws-groundstation-agent
   
   # check agent status
   systemctl status aws-groundstation-agent
   ```

## AWS Ground Station 代理卸载
<a name="gs-agent-uninstall"></a>

 卸载代理将重命名/ opt/aws/groundstation/etc/aws-gs-agent-config.json to /opt/aws/groundstation/etc/aws-gs-agent-config .json.rpmsave。再次在同一个实例上安装代理会为 aws-gs-agent-config .json 写入默认值，并且需要使用与您的 AWS 资源对应的正确值进行更新。请参阅[代理配置文件](configuring-agent.md#agent-config-file)。

```
sudo yum remove aws-groundstation-agent
```

## AWS Ground Station 代理状态
<a name="gs-agent-status"></a>

 座席状态为**活动**（座席正在运行）或**非活动**（座席已停止）。

```
systemctl status aws-groundstation-agent
```

 示例输出显示座席处于已安装**状态、非活动状态**（已停止）和**已启用**（开机时启动服务）。

```
aws-groundstation-agent.service - aws-groundstation-agent
Loaded: loaded (/usr/lib/systemd/system/aws-groundstation-agent.service; enabled; vendor preset: disabled)
Active: inactive (dead) since Thu 2023-03-09 15:35:08 UTC; 6min ago
Docs: https://aws.amazon.com/ground-station/
Process: 84182 ExecStart=/opt/aws/groundstation/bin/launch-aws-gs-agent (code=exited, status=0/SUCCESS)
Main PID: 84182 (code=exited, status=0/SUCCESS)
```

## AWS Ground Station 代理 RPM 信息
<a name="gs-agent-rpm-info"></a>

```
yum info aws-groundstation-agent
```

 您可以在一个 (扩展) 代码行中执行所有这些操作：

**注意**  
“版本”可能会有所不同，具体取决于座席发布的最新版本。

```
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
Installed Packages
Name        : aws-groundstation-agent
Arch        : x86_64
Version     : 1.0.2677.0
Release     : 1
Size        : 51 M
Repo        : installed
Summary     : Client software for AWS Ground Station
URL         : https://aws.amazon.com/ground-station/
License     : Proprietary
Description : This package provides client applications for use with AWS Ground Station
```