当我尝试经营一份工作时,#hellojob.sh'在cfncluster中,多个计算节点旋转起来。这是一个非常简单的工作。请在下面找到我的脚本。
hellojob.sh
#!/bin/bash
sleep 30
echo "Hello World from $(hostname)"
任何人都可以请告诉我如何避免自动调节旋转到多个计算节点。
请在下面找到我的配置文件:
[root@ip-00-00-0-1000 .cfncluster]# cat config
[aws]
aws_region_name = us-east-1
aws_access_key_id = ***************
aws_secret_access_key = *******************
[cluster default]
vpc_settings = testdev-dev
key_name = testdev-developers
initial_queue_size = 0
s3_read_write_resource =*
pre_install = s3://cfncluster/pre_install_script.sh
[vpc testdev-dev]
master_subnet_id = subnet-*****
vpc_id = vpc-*****
additional_sg=sg-*****
vpc_security_group_id =sg-*****
use_public_ips=false
[global]
update_check = true
sanity_check = true
cluster_template = default
[scaling]
scaling_cooldown = 2000
答案 0 :(得分:1)
您应该能够通过在缩放配置中包含scaling_threshold(和可选的scaling_threshold2)参数来解决此问题。 scaling_threshold参数确定触发自动缩放ScaleUp事件时要添加的实例数。请参阅下面的配置片段作为示例
## Scaling settings
#[scaling custom]
# Threshold for triggering CloudWatch ScaleUp action
# (defaults to 4 for default template)
scaling_threshold = 1
# Number of instances to add when called CloudWatch ScaleUp action
# (defaults to 2 for default template)
scaling_adjustment = 1
# Threshold for triggering CloudWatch ScaleUp2 action
# (defaults to 4 for default template)
scaling_threshold2 = 10
# Number of instances to add when called CloudWatch ScaleUp2 action
# (defaults to 20 for default template)
scaling_adjustment2 = 2