我正在尝试使用 Java API 和以下代码在 Amazon RDS 上启动一个新的 MySql 实例:
CreateDBInstanceRequest createDBInstanceRequest = new CreateDBInstanceRequest();
createDBInstanceRequest.setEngine("MySQL");
createDBInstanceRequest.setLicenseModel("general-public-license");
createDBInstanceRequest.setEngineVersion("5.5.25a");
createDBInstanceRequest.setDBInstanceClass("db.t1.micro");
createDBInstanceRequest.setMultiAZ(false);
createDBInstanceRequest.setAutoMinorVersionUpgrade(true);
createDBInstanceRequest.setAllocatedStorage(5);
createDBInstanceRequest.setDBInstanceIdentifier("mydbinstance");
createDBInstanceRequest.setMasterUsername("master");
createDBInstanceRequest.setMasterUserPassword("password");
createDBInstanceRequest.setDBName("dbname");
createDBInstanceRequest.setPort(3306);
createDBInstanceRequest.setDBParameterGroupName("default.mysql5.5");
createDBInstanceRequest.setDBSubnetGroupName("dev");
createDBInstanceRequest.setBackupRetentionPeriod(1);
DBInstance dbInstance = RDS.createDBInstance(createDBInstanceRequest);
问题是这总是会导致以下错误:
AWS 错误代码:InsufficientDBInstanceCapacity,AWS 错误消息:无法创建数据库实例,因为没有具有足够容量的可用区。请稍后再试您的请求。
正如建议的那样,我稍后尝试过,但从未能够以编程方式启动新实例,但是当我尝试使用 Amazon Mgmt 控制台启动实例时,使用完全相同的参数,它会立即启动。
我还注意到这个问题只发生在数据库实例类“db.t1.micro”上。这个实例类不能通过 API 获得吗?