【发布时间】:2016-07-27 02:00:06
【问题描述】:
我正在尝试根据我的自定义指标自动平衡计算引擎上的实例组。 google 监控/api/v3 示例 github source 创建自定义指标,我可以在 Stackdriver 中看到它。太好了!
但是,当我想在我的实例组中使用该指标时,该组不会自动缩放。仅显示 1 个实例。
我是否正确设置了自动缩放器?
gcloud compute instance-groups managed set-autoscaling $MY_GROUP \
--max-num-replicas 2 --min-num-replicas 1 \
--custom-metric-utilization metric=custom.googleapis.com/custom_measurement,utilization-target=3,utilization-target-type=GAUGE \
--zone us-central1-f
注意:在 custom_metric.py 中,我已将 INSTANCE_ID 设置为我的第一个 VM 实例的 id,并多次运行 custom_metric.py 来模拟一些数据,因为我的测试 VM 实例没有做任何实际操作。
【问题讨论】:
标签: load-balancing google-compute-engine metrics