代码之家  ›  专栏  ›  技术社区  ›  Gezim Tarang

如何设置ECS服务的desiredCount?

  •  0
  • Gezim Tarang  · 技术社区  · 6 年前

    我启动服务的方式如下:

    ecs-cli compose -f docker-compose-base.yml -f docker-compose-prod.yml --ecs-profile root service up --create-log-groups

    在我的 ecs-params.yml 我指定的文件 desiredCount: 2 :

    version: 1
    task_definition:
      services:
        api:
          desiredCount: 2
    

    但是,它总是得到一个默认的期望计数1:

    INFO[0000] Using ECS task definition                     TaskDefinition="api:5"
    WARN[0000] No log groups to create; no containers use 'awslogs'
    INFO[0016] (service api) has started 1 tasks: (task decf9405-63b1-4ddf-ba12-69018299e157).  timestamp="2020-05-16 12:03:46 +0000 UTC"
    INFO[0077] Service status                                desiredCount=1 runningCount=1 serviceName=api
    

    如何在不必运行的情况下更改所需的默认计数 service scale N

    0 回复  |  直到 6 年前
        1
  •  0
  •   Ali    6 年前

    ecs-cli compose service scale 此命令将所需的服务计数设置为指定的计数。下面是完整的语法,其中n是所需的计数:

    ecs cli compose服务规模[--deployment max percent n][--deployment min health percent n][--timeout value]n[--help]

    ecs cli compose--项目名称hello world--文件hello-world.yml service scale 2