Method: instances.demoteMaster

Demotes the stand-alone instance to be a Cloud SQL read replica for an external database server.

HTTP request

POST https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/demoteMaster

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
project

string

ID of the project that contains the instance.

instance

string

Cloud SQL instance name.

Request body

The request body contains an instance of InstancesDemoteMasterRequest.

Response body

If successful, the response body contains an instance of Operation.

Authorization Scopes

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.

InstancesDemoteMasterRequest

Database demote master request.

JSON representation
{
  "demoteMasterContext": {
    object (DemoteMasterContext)
  }
}
Fields
demoteMasterContext

object (DemoteMasterContext)

Contains details about the demoteMaster operation.

DemoteMasterContext

Database instance demote master context.

JSON representation
{
  "kind": string,
  "verifyGtidConsistency": boolean,
  "masterInstanceName": string,
  "replicaConfiguration": {
    object (DemoteMasterConfiguration)
  }
}
Fields
kind

string

This is always

sql#demoteMasterContext

.

verifyGtidConsistency

boolean

Verify GTID consistency for demote operation. Default value:

True

. Second Generation instances only. Setting this flag to false enables you to bypass GTID consistency check between on-premises master 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 master in the replication setup.

replicaConfiguration

object (DemoteMasterConfiguration)

Configuration specific to read-replicas replicating from the on-premises master.

DemoteMasterConfiguration

Read-replica configuration for connecting to the on-premises master.

JSON representation
{
  "kind": string,
  "mysqlReplicaConfiguration": {
    object (DemoteMasterMySqlReplicaConfiguration)
  }
}
Fields
kind

string

This is always

sql#demoteMasterConfiguration

.

mysqlReplicaConfiguration

object (DemoteMasterMySqlReplicaConfiguration)

MySQL specific configuration when replicating from a MySQL on-premises master. 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.

DemoteMasterMySqlReplicaConfiguration

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 slave's private key. The corresponsing public key is encoded in the client's certificate. The format of the slave's private key can be either PKCS #1 or PKCS #8.

clientCertificate

string

PEM representation of the slave's x509 certificate.

caCertificate

string

PEM representation of the trusted CA's x509 certificate.

หน้านี้มีประโยชน์ไหม โปรดแสดงความคิดเห็น

ส่งความคิดเห็นเกี่ยวกับ...

หากต้องการความช่วยเหลือ ให้ไปที่หน้าการสนับสนุน