Unable to Demote SQL Cloud Master to act as Slave

262 views
Skip to first unread message

Shazad Saleem

unread,
Oct 29, 2021, 6:00:47 AM10/29/21
to Google Cloud SQL discuss
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

Shazad Saleem

Javier Merida Morales

unread,
Nov 2, 2021, 5:08:35 AM11/2/21
to Google Cloud SQL discuss
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]?
- What do you see on the replication status [3]?

________
[1] 

[2]

[3]

Shazad Saleem

unread,
Nov 2, 2021, 7:15:00 AM11/2/21
to google-cloud...@googlegroups.com

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? 

 

 

- 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...@googlegroups.com>
Sent: Tuesday, 2 November 2021 9:51 pm
To: Google Cloud SQL discuss <google-cloud...@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.

 

--
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-d...@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.

Javier Merida Morales

unread,
Nov 4, 2021, 6:36:54 AM11/4/21
to Google Cloud SQL discuss
According to the documentation you are following, and the error message, it seems to be a matter of a wrong user and/or password. Could you please double check if you are using the correct credentials?

Please, remember to NOT SHARE any private information that might lead to potential security risks, such as PASSWORDS, TOKENS or IDs.  
Reply all
Reply to author
Forward
0 new messages