Stay organized with collections Save and categorize content based on your preferences.
Demotes the stand-alone instance to be a Cloud SQL read replica for an external database server.
HTTP requestPOST https://sqladmin.googleapis.com/v1/projects/{project}/instances/{instance}/demoteMaster
The URL uses gRPC Transcoding syntax.
Path parameters Parametersproject
string
ID of the project that contains the instance.
instance
string
Cloud SQL instance name.
Request bodyThe request body contains an instance of InstancesDemoteMasterRequest
.
If successful, the response body contains an instance of Operation
.
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/cloud-platform
https://www.googleapis.com/auth/sqlservice.admin
For more information, see the Authentication Overview.
InstancesDemoteMasterRequestDatabase demote primary instance request.
FieldsdemoteMasterContext
object (
DemoteMasterContext
)
Contains details about the demoteMaster operation.
DemoteMasterContextDatabase instance demote primary instance context.
JSON representation{
"kind": string,
"verifyGtidConsistency": boolean,
"masterInstanceName": string,
"replicaConfiguration": {
object (DemoteMasterConfiguration
)
},
"skipReplicationSetup": boolean
}
Fields kind
string
This is always sql#demoteMasterContext
.
verifyGtidConsistency
boolean
Verify the GTID consistency for demote operation. Default value: True
. Setting this flag to false
enables you to bypass the GTID consistency check between on-premises primary instance and Cloud SQL instance during the demotion operation but also exposes you to the risk of future replication failures. Change the value only if you know the reason for the GTID divergence and are confident that doing so will not cause any replication issues.
masterInstanceName
string
The name of the instance which will act as on-premises primary instance in the replication setup.
replicaConfiguration
object (
DemoteMasterConfiguration
)
Configuration specific to read-replicas replicating from the on-premises primary instance.
skipReplicationSetup
boolean
Flag to skip replication setup on the instance.
DemoteMasterConfigurationRead-replica configuration for connecting to the on-premises primary instance.
Fieldskind
string
This is always sql#demoteMasterConfiguration
.
mysqlReplicaConfiguration
object (
DemoteMasterMySqlReplicaConfiguration
)
MySQL specific configuration when replicating from a MySQL on-premises primary instance. Replication configuration information such as the username, password, certificates, and keys are not stored in the instance metadata. The configuration information is used only to set up the replication connection and is stored by MySQL in a file named master.info
in the data directory.
Read-replica configuration specific to MySQL databases.
JSON representation{ "kind": string, "username": string, "password": string, "clientKey": string, "clientCertificate": string, "caCertificate": string }Fields
kind
string
This is always sql#demoteMasterMysqlReplicaConfiguration
.
username
string
The username for the replication connection.
password
string
The password for the replication connection.
clientKey
string
PEM representation of the replica's private key. The corresponsing public key is encoded in the client's certificate. The format of the replica's private key can be either PKCS #1 or PKCS #8.
clientCertificate
string
PEM representation of the replica's x509 certificate.
caCertificate
string
PEM representation of the trusted CA's x509 certificate.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-05-30 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-05-30 UTC."],[],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4