Spot 实例可用于数据管道中的 EC2 和 EMR 资源。
对于 ec2 实例,您需要在资源上设置 bidPrice 属性。 ec2 资源的管道定义应如下所示。
{
"id": "EC2Instance",
"type": "Ec2Resource",
"terminateAfter": "1 Hour",
"spotBidPrice": "<my bid price from 0 to 20.0>"
}
对于 emr 集群,您需要在资源上设置 taskInstanceBidPrice 属性。 emr 资源的管道定义应如下所示。
{
"id" : "MyEmrCluster",
"type" : "EmrCluster",
"taskInstanceBidPrice": "<my bid price from 0 to 20.0>",
"keypair" : "my-key-pair",
"masterInstanceType" : "m3.xlarge",
"coreInstanceType" : "m3.xlarge",
"coreInstanceCount" : "10",
"taskInstanceType" : "m3.xlarge",
"taskInstanceCount": "10",
"releaseLabel": "emr-4.1.0",
"applications": ["spark", "hive", "pig"],
"configuration": {"ref":"myConfiguration"}
}