Hi Merida,
- Are you using an external replica?
No I am using External Master. The replica was in GCP and I am unable to demote it
- What database engine (MySQL or PostgreSQL) are you working on?
I am using MySQL
- Are you following this guide [1]? If so, at which step are you facing issues? Could you share us the given error message?
https://cloud.google.com/sql/docs/mysql/replication/custom-import-replication-from-external#performing_a_custom_dump_and_import
- Do you see any other message related to it on your logs [2]?
Below is the error message when I am trying to demote it
VerifyExternalSyncSettings returned user error: [type: CONNECTION_FAILURE detail: "generic::unavailable: Unable to connect to source database server: unable to connect to source database server after 5s: generic::permission_denied: \"Error 1045: Access denied for user \'ib4trepl\'@\'35.244.108.34\' (using password: YES)\". Check if MySQL replication user and password are correct. Not attempting further retries." externally_reportable: true ]
- What do you see on the replication status [3]?
Replica in not running as I can't demote it. That was the replica before but because replication was stopped so I am to promote it as master to reimport and I am unable to demote it.
Further details
We did the reimport because the replication was stopped.
I followed the steps on this page "using mysql dump".
https://cloud.google.com/sql/docs/mysql/replication/custom-import-replication-from-external#performing_a_custom_dump_and_import
when running the following command.
ACCESS_TOKEN="$(gcloud auth print-access-token curl --header "Authorization: Bearer ${ACCESS_TOKEN}" --header 'Content-Type: application/json' --data @./demote.json -X POST https://sqladmin.googleapis.com/sql/v1beta4/projects/data-dev-234501/instances/inspire-v25/demoteMaster
cat demote.json
{"demoteMasterContext":{"masterInstanceName":"inspire-global-ext","skipReplicationSetup":true,}}
we get the following error on operation tab of
instances= inspire-v25
project=data-dev-234501
VerifyExternalSyncSettings returned user error: [type: CONNECTION_FAILURE detail: "generic::unavailable: Unable to connect to source database server: unable to connect to source database server after 5s: generic::permission_denied: \"Error 1045: Access denied for user \'ib4trepl\'@\'35.244.108.34\' (using password: YES)\". Check if MySQL replication user and password are correct. Not attempting further retries." externally_reportable: true ]
This is before we can set the replication information which is the next step in the process.
It looks like the database has replication information in it while it is not a replica therefore it cannot be demoted to become a replica.
Instance information
instances= inspire-v25
project=data-dev-234501
Shazad Saleem
From: 'Javier Merida Morales' via Google Cloud SQL discuss <google-cloud-sql-discuss@googlegroups.com>
Sent: Tuesday, 2 November 2021 9:51 pm
To: Google Cloud SQL discuss <google-cloud-sql-discuss@googlegroups.com>
Subject: [google-cloud-sql-discuss] Re: Unable to Demote SQL Cloud Master to act as Slave
CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
Hello,
We will need more information on what have you done so far for further troubleshooting. Please see the following questions:
- Are you using an external replica?
- What database engine (MySQL or PostgreSQL) are you working on?
- Are you following this guide [1]? If so, at which step are you facing issues? Could you share us the given error message?
- Do you see any other message related to it on your logs [2]?
On Friday, October 29, 2021 at 12:00:47 PM UTC+2 ssa...@ib4t.co wrote:
I have a SQL Cloud which was working as Slave and then the replication was broken and to resync It is must to import and then demote.
I can't demote after importing.
Thank you for your support in advance
--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/0f95aa02-453d-474b-bd23-e4510269d333n%40googlegroups.com.