AWS CloudFormation启动Hyperledger Fabric失败,错误原因:无法创建:[EC2InstanceForDev],通常是由于以下原因之一导致的:
EC2实例类型不受支持:Hyperledger Fabric在AWS CloudFormation中需要使用支持HVM虚拟化的实例类型。确保在EC2实例配置中选择了支持HVM虚拟化的实例类型,例如t2.small。
EC2密钥对不存在:在AWS CloudFormation模板中,确保指定了存在的EC2密钥对。这可以通过在模板中的"EC2InstanceForDev"资源部分添加"KeyName"属性来完成,示例如下:
"EC2InstanceForDev": {
"Type": "AWS::EC2::Instance",
"Properties": {
"ImageId": "ami-xxxxxxxx",
"InstanceType": "t2.small",
"KeyName": "your-key-pair"
}
}
"EC2InstanceForDev": {
"Type": "AWS::EC2::Instance",
"Properties": {
"ImageId": "ami-xxxxxxxx",
"InstanceType": "t2.small",
"KeyName": "your-key-pair",
"IamInstanceProfile": "your-iam-instance-profile"
}
}
确保"your-iam-instance-profile"是存在且具有所需权限的IAM实例配置文件。
通过解决这些可能的问题,您应该能够成功启动Hyperledger Fabric。