Skip to main content

将地理处理服务的目录迁移到 Amazon S3 存储段

在 ArcGIS Server 10.7 版本中,管理员可以将作业目录以及输入和输出目录从磁盘位置更改为 Amazon S3 存储段。 如果地理处理服务始终具有较大的输出,则可以使用 Amazon S3 存储段来扩展存储资源。 使用此配置,您的地理处理服务可能会变慢。

注:

使用此配置无法使用地理处理服务的结果地图图像图层。

您可以按照以下步骤使用访问密钥或 IAM 角色设置此云存储配置。

准备 Amazon Web Services (AWS) 环境

对于同步地理处理服务,仅需要 Amazon S3 服务。 对于异步服务,您需要为 ArcGIS Server 提供访问 DynamoDB 和简单队列服务的权限。 您的 Amazon S3 存储段、DynamoDB 表和简单队列服务队列必须在同一地区。

  1. 在 Amazon S3 中创建存储段。

    有关详细信息,请参见创建第一个 S3 存储段。

  2. 或者,创建一个表,其中 serviceId 为分区键,jobId 为排序键。

    两个密钥均为字符串格式。 如果未提供键,则 ArcGIS Server 将自动创建一个表。

  3. 对于每个异步地理处理服务,在简单队列服务中创建一个唯一的标准类型队列。

使用访问密钥

要使用访问密钥连接到 Amazon S3 存储段,请完成以下步骤:

注:

如果地理处理服务生成文件或栅格输出,则访问密钥将成为结果文件或栅格输出、JSON 模式文件和帮助 URL 的一部分。 您必须确定这是否符合您组织的安全策略。

在数据存储项注册过程中,ArcGIS Server 还需要访问密钥的保密密钥。 但是,ArcGIS Server 将始终加密您的保密密钥。

  1. 登录 ArcGIS Server Administrator Directory,然后浏览到注册项目。

  2. 提供有关 Amazon S3 存储段和 DynamoDB 的连接信息,包括访问密钥和保密密钥。

    在 ArcGIS REST API 中注册数据项目的示例 JSON

    {
        "path": "/cloudStores/<name of your cloud store>",
        "type": "cloudStore",
        "provider": "amazon",
        "info": {
            "isManaged": false,
            "connectionString": {
                "accessKeyId":"<your access key>",
                 "secretAccessKey":"<your secret key>",
                 "region":"<your region>",
                 "defaultEndpointsProtocol":"https",
                 "credentialType":"accesskey"
                 },
            "objectStore": "<name of your S3 bucket>/<optional folder name>",
            "dynamoDbTable":"<dynamoDB table name>"
        }
    }
    
  3. 返回管理员目录的主页,然后单击服务。

  4. 查找要在 AWS 环境中使用的地理处理服务,单击服务名称,然后单击编辑。

  5. 在服务的 JSON 表示中,添加具有新的唯一 serviceId 值、云存储名称和服务队列的以下键值对:

    异步地理处理配置

    {
      "serviceId": "<a unique service ID>",
      "jobQueueStore":"/cloudStores/<name of your cloud store>",
      "jobTableStore": "/cloudStores/<name of your cloud store>",
      "outputStore": "/cloudStores/<name of your cloud store>",
      "jobObjectStore": "/cloudStores/<name of your cloud store>",
      "jobsStoreQueue": "<name of the queue>"
    }
    

    同步地理处理配置

    {
      "serviceId": "<a unique service ID>",
      "outputStore": "/cloudStores/<name of your cloud store>",
      "jobObjectStore": "/cloudStores/<name of your cloud store>"
    }
    
    提示:

    <name of the cloud store> 值将位于管理员目录中其数据项目 URL 端点的末尾。

  6. 单击保存编辑以确认配置。

    地理处理服务会自动重新启动,这需要一段时间。

  7. 对于任何其他服务,请重复步骤 4 到步骤 6。

JSON 示例

通过添加上述步骤 5 所需的键值对来更改地理处理服务的服务属性 JSON。

编辑 GPServer。 以下是异步地理处理服务配置的缩略 JSON。

{
"serviceName": "myGPService1",
"resultMapServer": "false",
"maximumRecords": "1000",
"virtualOutputDir": "/rest/directories/arcgisoutput",
"serviceId": "<this_is_a_unique_serviceid>",
"jobQueueStore":"/cloudStores/<name of your cloud store>",
"jobTableStore": "/cloudStores/<name of your cloud store>",
"outputStore": "/cloudStores/<name of your cloud store>",
"jobObjectStore": "/cloudStores/<name of your cloud store>",
"jobsStoreQueue": "<this_is_a_unique_queue_name>",
"portalURL": "https://domain/webadaptor/"
},
"portalProperties": "",
"extensions": "",
"frameworkProperties": {},
"datasets": []
}

使用 IAM 角色设置

要使用 AWS IAM 角色,您必须在与 Amazon S3 存储段、 DynamoDB 表和简单队列服务相同的区域中进行部署。 有关详细信息,请参阅 ArcGIS Enterprise on Amazon Web Services。

确保您的 IAM 角色具有简单队列服务策略,以及 ArcGIS Enterprise on Amazon Web Services 的 IAM 策略。

配置步骤与上述相同,除了步骤 2 中的数据存储注册。 请在步骤 2 中使用以下示例 JSON。

使用 IAM 角色在 ArcGIS REST API 中注册数据项目的示例 JSON

{
 "path": "/cloudStores/<name of your cloud store>",
 "type": "cloudStore",
 "provider": "amazon",
 "info": {
     "isManaged": false,
     "connectionString": {
          "region":"<your region>",
          "defaultEndpointsProtocol":"https",
          "credentialType":"iamrole"
          },
     "objectStore": "<name of your S3 bucket>/<optional folder name>",
     "dynamoDbTable":"<dynamoDB table name>"
 }
}