Replication

Understanding – Group Replication and InnoDB Cluster – Select All From MySQL

 

mysqljs> cluster.addInstance(‘admin@gr128:3306’);

A new instance will be added to the InnoDB cluster. Depending on the amount of

data on the cluster this might take from a few seconds to several hours.

Please provide the password for ‘admin@gr128:3306’:

Adding instance to the cluster ...

The instance ‘admin@gr128:3306’ was successfully added to the cluster.

mysqljs> cluster.addInstance(‘admin@gr129:3306’);

A new instance will be added to the InnoDB cluster. Depending on the amount of

data on the cluster this might take from a few seconds to several hours.

Please provide the password for ‘admin@gr129:3306’:

Adding instance to the cluster ...

The instance ‘admin@gr129:3306’ was successfully added to the cluster.

mysqljs> cluster.describe()

{

    “clusterName”: “icBlog”,

    “defaultReplicaSet”: {

        “instances”: [

            {

                “host”: “gr127:3306”,

                “label”: “gr127:3306”,

                “role”: “HA”

            },

            {

                “host”: “gr128:3306”,

                “label”: “gr128:3306”,

                “role”: “HA”

            },

            {

                “host”: “gr129:3306”,

                “label”: “gr129:3306”,

                “role”: “HA”

            }

        ],

        “name”: “default”

    }

}

mysqljs> cluster.status()

{

    “clusterName”: “icBlog”,

    “defaultReplicaSet”: {

        “name”: “default”,

        “primary”: “gr127:3306”,

        “status”: “OK”,

        “statusText”: “Cluster is ONLINE and can tolerate up to ONE failure.”,

        “topology”: {

            “gr127:3306”: {

                “address”: “gr127:3306”,

                “mode”: “R/W”,

                “readReplicas”: {},

                “role”: “HA”,

                “status”: “ONLINE”

            },

            “gr128:3306”: {

                “address”: “gr128:3306”,

                “mode”: “R/O”,

                “readReplicas”: {},

                “role”: “HA”,

                “status”: “ONLINE”

            },

            “gr129:3306”: {

                “address”: “gr129:3306”,

                “mode”: “R/O”,

                “readReplicas”: {},

                “role”: “HA”,

                “status”: “ONLINE”

            }

        }

    }

}

mysqljs>

Source link

Leave a Reply

Your email address will not be published. Required fields are marked *