amazon-redshiftHow do I set up Amazon RDS with Multi-AZ for high availability?
- Create an Amazon RDS instance in the AWS Management Console.
- Select the Multi-AZ option for high availability.
- Select the database engine and version that you need.
- Specify the instance type and storage capacity.
- Provide a database name, username and password.
- Create a new VPC security group and add the required inbound and outbound rules.
- Click Create Database button to launch the instance.
Example code
aws rds create-db-instance \
--db-instance-identifier mydbinstance \
--db-name mydbname \
--allocated-storage 5 \
--db-instance-class db.t2.micro \
--engine mysql \
--master-username admin \
--master-user-password mypassword \
--multi-az
Output example
{
"DBInstance": {
"DBInstanceIdentifier": "mydbinstance",
"DBInstanceClass": "db.t2.micro",
"Engine": "mysql",
"DBName": "mydbname",
"MultiAZ": true,
"AllocatedStorage": 5,
"MasterUsername": "admin"
}
}
Code explanation
aws rds create-db-instance
: Creates a new DB instance.
--db-instance-identifier mydbinstance
: Specifies the identifier for the DB instance.
--db-name mydbname
: Specifies the name of the database to be created when the DB instance is created.
--allocated-storage 5
: Specifies the allocated storage size specified in gigabytes.
--db-instance-class db.t2.micro
: Specifies the compute and memory capacity of the DB instance.
--engine mysql
: Specifies the database engine to be used for this DB instance.
--master-username admin
: Specifies the master user name for the DB instance.
--master-user-password mypassword
: Specifies the password for the master user.
--multi-az
: Specifies that the DB instance is a Multi-AZ deployment.
Helpful links
More of Amazon Redshift
- How do I use the Amazon Redshift YEAR function?
- How do I set up Amazon RDS with read replicas?
- How can I calculate the serverless pricing for Amazon Redshift?
- How do I use Amazon Redshift RSQL to query data?
- How do I use regular expressions with Amazon Redshift?
- How can I handle divide by zero errors when using Amazon Redshift?
- How do I convert an Amazon Redshift timestamp to a date?
- How can I use Amazon Redshift UNION to combine data from multiple tables?
- How do I use Amazon Redshift?
See more codes...