Database Replication and Clustering
6.5.4. Changing Amazon RDS Instance Configurations | ||
---|---|---|
Prev | 6.5. Deploying MySQL to Amazon RDS Replication | Next |
The configuration of RDS instances can be modified to change the
parameters for MySQL instances, the Amazon equivalent of modifying the
my.cnf
file.
These parameters can be set internally by connecting to the instance and using the configuration function within the instance. For example:
mysql> call mysql.rds_set_configuration('binlog retention hours', 48);
An RDS command-line interface is available which enables modifying these parameters. To enable the command-line interface:
shell>wget http://s3.amazonaws.com/rds-downloads/RDSCli.zip
shell>unzip RDSCli.zip
shell>export AWS_RDS_HOME=/home/tungsten/RDSCli-1.13.002
shell>export PATH=$PATH:$AWS_RDS_HOME/bin
The current RDS instances can be listed by using rds-describe-db-instances:
shell> rds-describe-db-instances --region=us-east-1
To change parameters, a new parameter group must be created, and then applied to a running instance or instances before restarting the instance:
Create a new custom parameter group:
shell> rds-create-db-parameter-group repgroup
-d 'Parameter group for DB Slaves' -f mysql5.1
Where repgroup
is the
replicator group name.
Set the new parameter value:
shell> rds-modify-db-parameter-group repgroup
--parameters \
"name=max_allowed_packet,value=67108864, method=immediate"
Apply the parameter group to your instance:
shell> rds-modify-db-instance instancename
--db-parameter-group-name=repgroup
Where instancename
is the
name given to your instance.
Restart the instance:
shell> rds-reboot-db-instance instancename