【问题标题】:gcloud managed vm starts too many instancesgcloud managed vm 启动了太多实例
【发布时间】:2015-10-06 14:24:38
【问题描述】:

通过quickstart for Node.js 工作,然后将应用部署到生产环境:

gcloud preview app deploy app.yaml --set-default

部署后,我的仪表板中有大约 12 个实例。每次部署尝试的确切数字似乎有所不同。

我杀死了所有这些,删除了它们,然后再次部署。又创造了约 12 个。我尝试了 manual_scaling 和 automatic_scaling 都没有改善。

我的 app.yaml:

# [START runtime]
runtime: nodejs
vm: true
api_version: 1
# [END runtime]

# [START resources]
resources:
  cpu: .5
  memory_gb: 1.3
  disk_size_gb: 10
# [END resources]

# [START scaling]
manual_scaling:
  instances: 1
#automatic_scaling:
#  min_num_instances: 1
#  max_num_instances: 1
#  cool_down_period_sec: 60
#  cpu_utilization:
#    target_utilization: 0.5
# [END scaling]

env_variables:
  NODE_ENV: 'production'

# Temporary workaround for a Cloud SDK bug.
# Ensures that node_modules directory and any .log files are not uploaded (the
# other entries are the default values for skip_files). This will skip any Unix
# hidden files (such as the .git directory)
skip_files:
 - ^(.*/)?#.*#$
 - ^(.*/)?.*~$
 - ^(.*/)?.*\.py[co]$
 - ^(.*/)?.*/RCS/.*$
 - ^(.*/)?\..*$
 - ^(.*/)?.*/node_modules/.*$
 - ^(.*/)?.*\.log$

为简洁起见,我粘贴了output of the deploy command, version info, and other non-essentials here

我在这里做错了什么?我需要做什么才能启动一个实例?

【问题讨论】:

    标签: google-app-engine google-compute-engine google-cloud-platform


    【解决方案1】:

    您的屏幕截图显示已部署了十二个不同版本的应用程序。实例名称yyyymmddtxxxxxx 的数字部分对于同一版本将是相同的。

    在 Developers Console 上,转到 Compute > App Engine > Versions,然后删除您不再需要的应用程序版本。

    【讨论】:

    • 确实,即使我在Compute Engine > Managed VM 工作,也有在App Engine > Versions 下创建的版本。删除托管 VM 中的实例并不会删除它们(它们只是重新创建)。但是在Versions 下删除它们确实会阻止它们回来。这就引出了一个问题:如何部署才能避免一开始就创建它们?
    • 事实上,您正在使用App Engine Managed VMs,但是如果您想从Google-managed 切换到user-managed 模式,这些实例在Compute Engine > VM instances 下可见。您可以在 gcloud 命令中使用 --version VERSION 标志来明确定义要部署或替换的版本。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-10-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-17
    • 1970-01-01
    相关资源
    最近更新 更多