- Più recenti
- Maggior numero di voti
- Maggior numero di commenti
The intermittent errors when connecting to the Aurora MySQL cluster endpoints are likely occurring due to your application connecting to reader instances instead of the primary writer instance.
Some things to check:
Verify that your application connection string is using the cluster endpoint URL, which will always route to the primary writer instance.
If using individual instance endpoints, there is a chance of connecting to readers which could result in errors for write operations.
Check the value of the @@innodb_read_only variable after connecting to determine if it's a reader (value 1) or writer (value 0).
You can run the following query to identify which instance you are connected to:
select concat( 'You are connected to ', server_id, ', which is a ',
if(SESSION_ID='MASTER_SESSION_ID', 'Writer', 'Reader'))
as CONNECTION_STATUS
from information_schema.replica_host_status
where SERVER_ID in (select @@aurora_server_id);
Using the cluster endpoint is recommended to take advantage of Aurora's high availability and auto-scaling features in a transparent manner.
Thank you for your answer, I will check on that, however connecting to only the the cluster instance, routes everything to the writer instance instead of routing reads only to the readers and thus overloading the writer.
Contenuto pertinente
- AWS UFFICIALEAggiornata 2 anni fa
- AWS UFFICIALEAggiornata 3 anni fa
- AWS UFFICIALEAggiornata 2 anni fa