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 can I monitor Amazon RDS using Zabbix?
- How can I handle divide by zero errors when using Amazon Redshift?
- How do I use the Amazon Redshift YEAR function?
- How can I calculate the serverless pricing for Amazon Redshift?
- How do I use Amazon Redshift RSQL to query data?
- How do I use Amazon Redshift window functions?
- How do I use Amazon Redshift to store data in an S3 bucket?
- How do I replace a table in Amazon Redshift?
- How can I use Amazon Redshift external tables?
- How do I use regular expressions with Amazon Redshift?
See more codes...