#mysqlsh root@192.168.0.10:3306
Creating a session to 'root@192.168.0.10:3306'
Please provide the password for 'root@192.168.0.10:3306': ********
Save password for 'root@192.168.0.10:3306'? [Y]es/[N]o/Ne[v]er (default No): Y
.
.
.
MySQL 192.168.0.10:3306 ssl JS >
MySQL JS > dba.checkInstanceConfiguration('root@192.168.0.10:3306')
Validating local MySQL instance listening at port 3306 for use in an InnoDB cluster...
This instance reports its own address as 192.168.0.10:3306
Checking whether existing tables comply with Group Replication requirements...
WARNING: The following tables do not have a Primary Key or equivalent column:
customerDB.salesaccount, customerDB.salesdetails, customerDB.usermgmt
|
Group Replication requires tables to use InnoDB and have a PRIMARY KEY or PRIMARY KEY Equivalent (non-null unique key). Tables that do not follow these requirements will be readable but not updateable when used with Group Replication. If your applications make updates (INSERT, UPDATE or DELETE) to these tables, ensure they use the InnoDB storage engine and have a PRIMARY KEY or PRIMARY KEY Equivalent.
Checking instance configuration...
NOTE: Some configuration options need to be fixed:
+--------------------------+---------------+----------------+--------------------------------------------------+
| Variable | Current Value | Required Value | Note |
+--------------------------+---------------+----------------+--------------------------------------------------+
| binlog_checksum | CRC32 | NONE | Update the server variable |
| enforce_gtid_consistency | OFF | ON | Update read-only variable and restart the server |
| gtid_mode | OFF | ON | Update read-only variable and restart the server |
| server_id | 1 | <unique ID> | Update read-only variable and restart the server |
+--------------------------+---------------+----------------+--------------------------------------------------+
Some variables need to be changed, but cannot be done dynamically on the server.
NOTE: Please use the dba.configureInstance() command to repair these issues.
{
"config_errors": [
{
"action": "server_update",
"current": "CRC32",
"option": "binlog_checksum",
"required": "NONE"
},
{
"action": "server_update+restart",
"current": "OFF",
"option": "enforce_gtid_consistency",
"required": "ON"
},
{
"action": "server_update+restart",
"current": "OFF",
"option": "gtid_mode",
"required": "ON"
},
{
"action": "server_update+restart",
"current": "1",
"option": "server_id",
"required": "<unique ID>"
}
],
"status": "error"
}
#Our First Task is to ALTER TABLE and add primary key to required table.
ALTER TABLE usermgmt ADD PRIMARY KEY(userid);
ALTER TABLE salesaccount ADD PRIMARY KEY(salesid);
ALTER TABLE salesdetails ADD PRIMARY KEY(salesid);
Let’s Re-check the Instance
MySQL JS > dba.checkInstanceConfiguration('root@192.168.0.10:3306')
MySQL 192.168.0.10:3306 ssl JS > dba.checkInstanceConfiguration('root@192.168.0.10:3306')
Validating local MySQL instance listening at port 3306 for use in an InnoDB cluster...
This instance reports its own address as 192.168.0.10:3306
Checking whether existing tables comply with Group Replication requirements...
No incompatible tables detected
Checking instance configuration...
NOTE: Some configuration options need to be fixed:
+--------------------------+---------------+----------------+--------------------------------------------------+
| Variable | Current Value | Required Value | Note |
+--------------------------+---------------+----------------+--------------------------------------------------+
| binlog_checksum | CRC32 | NONE | Update the server variable |
| enforce_gtid_consistency | OFF | ON | Update read-only variable and restart the server |
| gtid_mode | OFF | ON | Update read-only variable and restart the server |
| server_id | 1 | <unique ID> | Update read-only variable and restart the server |
+--------------------------+---------------+----------------+--------------------------------------------------+
Some variables need to be changed, but cannot be done dynamically on the server.
NOTE: Please use the dba.configureInstance() command to repair these issues.
{
"config_errors": [
{
"action": "server_update",
"current": "CRC32",
"option": "binlog_checksum",
"required": "NONE"
},
{
"action": "server_update+restart",
"current": "OFF",
"option": "enforce_gtid_consistency",
"required": "ON"
},
{
"action": "server_update+restart",
"current": "OFF",
"option": "gtid_mode",
"required": "ON"
},
{
"action": "server_update+restart",
"current": "1",
"option": "server_id",
"required": "<unique ID>"
}
],
"status": "error"
}
MySQL 192.168.0.10:3306 ssl JS >
Above Output shows there is no primary key issue, But “Some configuration options need to be fixed:”“)
Now Next…
MySQL 192.168.0.10:3306 ssl JS >dba.configureInstance('root@192.168.0.10:3306')
MySQL 192.168.0.10:3306 ssl JS > dba.configureInstance('root@192.168.0.10:3306')
Configuring local MySQL instance listening at port 3306 for use in an InnoDB cluster...
This instance reports its own address as 192.168.0.10:3306
NOTE: Some configuration options need to be fixed:
+--------------------------+---------------+----------------+--------------------------------------------------+
| Variable | Current Value | Required Value | Note |
+--------------------------+---------------+----------------+--------------------------------------------------+
| binlog_checksum | CRC32 | NONE | Update the server variable |
| enforce_gtid_consistency | OFF | ON | Update read-only variable and restart the server |
| gtid_mode | OFF | ON | Update read-only variable and restart the server |
| server_id | 1 | <unique ID> | Update read-only variable and restart the server |
+--------------------------+---------------+----------------+--------------------------------------------------+
Some variables need to be changed, but cannot be done dynamically on the server.
Do you want to perform the required configuration changes? [y/n]: y
Do you want to restart the instance after configuring it? [y/n]: y
Configuring instance...
The instance '192.168.0.10:3306' was configured to be used in an InnoDB cluster.
Restarting MySQL...
NOTE: MySQL server at 192.168.0.10:3306 was restarted.
Repeat The Same Process in Machine 02 & Machine 03
On Machine 02
MySQL 192.168.0.11:3306 ssl JS > dba.checkInstanceConfiguration('root@192.168.0.11:3306')
MySQL 192.168.0.10:3306 ssl JS > dba.checkInstanceConfiguration('root@192.168.0.11:3306')
Please provide the password for 'root@192.168.0.11:3306': ********
Save password for 'root@192.168.0.11:3306'? [Y]es/[N]o/Ne[v]er (default No): Y
Validating MySQL instance at 192.168.0.11:3306 for use in an InnoDB cluster...
This instance reports its own address as 192.168.0.11:3306
Checking whether existing tables comply with Group Replication requirements...
No incompatible tables detected
Checking instance configuration...
NOTE: Some configuration options need to be fixed:
+--------------------------+---------------+----------------+--------------------------------------------------+
| Variable | Current Value | Required Value | Note |
+--------------------------+---------------+----------------+--------------------------------------------------+
| binlog_checksum | CRC32 | NONE | Update the server variable |
| enforce_gtid_consistency | OFF | ON | Update read-only variable and restart the server |
| gtid_mode | OFF | ON | Update read-only variable and restart the server |
| server_id | 1 | <unique ID> | Update read-only variable and restart the server |
+--------------------------+---------------+----------------+--------------------------------------------------+
Some variables need to be changed, but cannot be done dynamically on the server.
NOTE: Please use the dba.configureInstance() command to repair these issues.
{
"config_errors": [
{
"action": "server_update",
"current": "CRC32",
"option": "binlog_checksum",
"required": "NONE"
},
{
"action": "server_update+restart",
"current": "OFF",
"option": "enforce_gtid_consistency",
"required": "ON"
},
{
"action": "server_update+restart",
"current": "OFF",
"option": "gtid_mode",
"required": "ON"
},
{
"action": "server_update+restart",
"current": "1",
"option": "server_id",
"required": "<unique ID>"
}
],
"status": "error"
}
MySQL 192.168.0.10:3306 ssl JS >
MySQL 192.168.0.10:3306 ssl JS > dba.checkInstanceConfiguration('root@192.168.0.11:3306')
Validating MySQL instance at 192.168.0.11:3306 for use in an InnoDB cluster...
This instance reports its own address as 192.168.0.11:3306
Checking whether existing tables comply with Group Replication requirements...
No incompatible tables detected
Checking instance configuration...
Instance configuration is compatible with InnoDB cluster
The instance '192.168.0.11:3306' is valid to be used in an InnoDB cluster.
{
"status": "ok"
}
MySQL 192.168.0.10:3306 ssl JS >
On Machine 03
MySQL 192.168.0.10:3306 ssl JS > dba.checkInstanceConfiguration('root@192.168.0.9:3306')
MySQL 192.168.0.10:3306 ssl JS > dba.checkInstanceConfiguration('root@192.168.0.9:3306')
Please provide the password for 'root@192.168.0.9:3306': ********
Save password for 'root@192.168.0.9:3306'? [Y]es/[N]o/Ne[v]er (default No): Y
Validating MySQL instance at 192.168.0.9:3306 for use in an InnoDB cluster...
This instance reports its own address as 192.168.0.9:3306
Checking whether existing tables comply with Group Replication requirements...
No incompatible tables detected
Checking instance configuration...
NOTE: Some configuration options need to be fixed:
+--------------------------+---------------+----------------+--------------------------------------------------+
| Variable | Current Value | Required Value | Note |
+--------------------------+---------------+----------------+--------------------------------------------------+
| binlog_checksum | CRC32 | NONE | Update the server variable |
| enforce_gtid_consistency | OFF | ON | Update read-only variable and restart the server |
| gtid_mode | OFF | ON | Update read-only variable and restart the server |
| server_id | 1 | <unique ID> | Update read-only variable and restart the server |
+--------------------------+---------------+----------------+--------------------------------------------------+
Some variables need to be changed, but cannot be done dynamically on the server.
NOTE: Please use the dba.configureInstance() command to repair these issues.
{
"config_errors": [
{
"action": "server_update",
"current": "CRC32",
"option": "binlog_checksum",
"required": "NONE"
},
{
"action": "server_update+restart",
"current": "OFF",
"option": "enforce_gtid_consistency",
"required": "ON"
},
{
"action": "server_update+restart",
"current": "OFF",
"option": "gtid_mode",
"required": "ON"
},
{
"action": "server_update+restart",
"current": "1",
"option": "server_id",
"required": "<unique ID>"
}
],
"status": "error"
}
MySQL 192.168.0.10:3306 ssl JS > dba.configureInstance('root@192.168.0.9:3306')
Configuring MySQL instance at 192.168.0.9:3306 for use in an InnoDB cluster...
This instance reports its own address as 192.168.0.9:3306
NOTE: Some configuration options need to be fixed:
+--------------------------+---------------+----------------+--------------------------------------------------+
| Variable | Current Value | Required Value | Note |
+--------------------------+---------------+----------------+--------------------------------------------------+
| binlog_checksum | CRC32 | NONE | Update the server variable |
| enforce_gtid_consistency | OFF | ON | Update read-only variable and restart the server |
| gtid_mode | OFF | ON | Update read-only variable and restart the server |
| server_id | 1 | <unique ID> | Update read-only variable and restart the server |
+--------------------------+---------------+----------------+--------------------------------------------------+
Some variables need to be changed, but cannot be done dynamically on the server.
Do you want to perform the required configuration changes? [y/n]: y
Do you want to restart the instance after configuring it? [y/n]: y
Configuring instance...
The instance '192.168.0.9:3306' was configured to be used in an InnoDB cluster.
Restarting MySQL...
NOTE: MySQL server at 192.168.0.9:3306 was restarted.
MySQL 192.168.0.10:3306 ssl JS >
MySQL 192.168.0.9:3306 ssl JS > dba.checkInstanceConfiguration('root@192.168.0.9:3306')
MySQL 192.168.0.10:3306 ssl JS > dba.checkInstanceConfiguration('root@192.168.0.9:3306')
Validating MySQL instance at 192.168.0.9:3306 for use in an InnoDB cluster...
This instance reports its own address as 192.168.0.9:3306
Checking whether existing tables comply with Group Replication requirements...
No incompatible tables detected
Checking instance configuration...
Instance configuration is compatible with InnoDB cluster
The instance '192.168.0.9:3306' is valid to be used in an InnoDB cluster.
{
"status": "ok"
}
MySQL 192.168.0.10:3306 ssl JS >
|