CloudSQL

Available Operations

Scale Cluster

What is it?

It enables user to modify the capacity of the cluster by changing the count of instances and/or the type of the instance that are already part of the cluster.

When to use?

This operation can be run only when the cluster is in running state or when an existing operation is success. User need to wait if any existing operation is already running on the same cluster and can check its status via odin.

Options

Option
Type
Description
Example

writer

json

The instance type required for the writer to be passed as a parameter to the json.

"writer": { "instance_type": "db-custom-1-6656" }

reader

json

The instance type required along with instance count for the reader to be passed as a parameter to the json. Multiple instance types and their counts can be passed as comma separated values.

"readers": [{ "instance_type": "db-custom-2-3840", "instance_count":2, }, { "instance_type": "db-custom-1-6656", "instance_count":1, }

Please note:

  1. The count of writer is fixed as 1 and is not required to be passed.

  2. The total number of readers across various instance types can be maximum 15. E.g: If you are adding 3 instance types in readers, the total number of instance count across those 3 cannot exceed 15.

Command

odin operate component --name [YOUR_COMPONENT_NAME] --service [YOUR_SERVICE_NAME] --operation scale 
--options '{
    "writer": {
      "instance_type": "[YOUR_INSTANCE_TYPE]"
    },
    "readers": [{
      "instance_type": "[YOUR_INSTANCE_TYPE]",
      "instance_count":[DESIRED_COUNT]
    }, {
      "instance_type": "[YOUR_INSTANCE_TYPE]",
      "instance_count":[DESIRED_COUNT]
    }]
}' --env [YOUR_ENV_NAME]

Reboot

What is it?

Reboot operation can be used by the user in case of changes in parameter, pushing new changes or even in case of observed higher latency.

When to use?

This operation can be run only when the cluster is in running state or when an existing operation is success. User need to wait if any existing operation is already running on the same cluster and can check its status via odin provided Jenkins.

Options

Option
Type
Description
Example

instance_name

text

This is a reader identifier and value can be found as instance identifier in gcp cloudsql console. The same value will be used as input.

--options '{"instance_name": "INSTANCE_NAME_TO_REBOOT"}'

Command

odin operate component --name [YOUR_COMPONENT_NAME] --service [YOUR_SERVICE_NAME] --operation reboot 
--options '{"instance_name": "<INSTANCE_NAME_TO_REBOOT>"}' --env [YOUR_ENV_NAME]

Add Reader

What is it?

Adding a reader is a subset of the operation "Scale". Using this operation a user can scale up the cluster.

When to use?

This operation can be run only when the cluster is in running state or when an existing operation is success. User need to wait if any existing operation is already running on the same cluster and can check its status via odin provided Jenkins.

How to use ?

Insert the instance count to be added for the cluster in number_of_reader . E.g: If you have 5 instances and you want to add 5 more, the value of number_of_reader will be 5.

Options

Option
Type
Description
Example

instance_type

text

Instance type that you want to add

--options '{"instance_name": "INSTANCE_NAME_TO_ADD_READER", "instance_type": "db-custom-2-6656", "number_of_reader": 12}

number_of_reader

integer

Number of readers that you want to add for the said instance type

--options '{"instance_name": "INSTANCE_NAME_TO_ADD_READER", "instance_type": "db-custom-2-6656", "number_of_reader": 12}

Command

odin operate component --name [YOUR_COMPONENT_NAME] --service [YOUR_SERVICE_NAME] 
--operation add_reader 
--options '{"instance_type": "INSTANCE_TYPE_TO_ADD", "number_of_reader": "NO_OF_READERS_TO_ADD"}'  
--env [YOUR_ENV_NAME]

Example:

odin operate component --name deadpool-kafka --service deadpool-service --operation add_reader 
--options '{"instance_type": "db-custom-2-6656", "number_of_reader": 12} --env sr001

Remove Reader

What is it?

Removing a reader is a subset of the operation "Scale". Using this operation a user can scale down the cluster.

When to use?

This operation can be run only when the cluster is in running state or when an existing operation is success. User need to wait if any existing operation is already running on the same cluster and can check its status via odin provided Jenkins.

How to use ?

The user can provide either the number of readers to be removed or the instance id that the user wants to remove as a parameter for remove reader operation.

Options

Option
Type
Description
Example

number_of_readers

Integer

Number of readers that you want to remove

--options '{"number_of_readers": 12}'

Command

odin operate component --name [YOUR_COMPONENT_NAME] --service [YOUR_SERVICE_NAME] 
--operation remove_reader 
--options '{"number_of_readers": "NO_OF_READERS_TO_REMOVE"}'
--env [YOUR_ENV_NAME]

Example:

odin operate component --name deadpool-kafka --service deadpool-service --operation remove_reader 
--options '{"number_of_reader": 12} --env sr001

Last updated