
{"id":1915,"date":"2017-05-11T08:40:50","date_gmt":"2017-05-11T07:40:50","guid":{"rendered":"http:\/\/dasini.net\/blog\/?p=1915"},"modified":"2018-08-21T09:38:15","modified_gmt":"2018-08-21T08:38:15","slug":"tutoriel-deployer-mysql-innodb-cluster","status":"publish","type":"post","link":"https:\/\/dasini.net\/blog\/2017\/05\/11\/tutoriel-deployer-mysql-innodb-cluster\/","title":{"rendered":"Tutoriel &#8211; D\u00e9ployer MySQL innoDB Cluster"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/dasini.net\/blog\/2018\/08\/21\/tutoriel-deployer-mysql-5-7-innodb-cluster\/\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignleft\" src=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/warning.png?resize=200%2C200\" alt=\"Warning\" width=\"200\" height=\"200\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>L&rsquo; article que tu t\u2019appr\u00eates \u00e0 lire est maintenant obsol\u00e8te \ud83d\ude41 Ohhhhhh !<\/p>\n<p>Mais rassure toi, il est remplac\u00e9 par un nouvel article, tout nouveau, tout beau et surtout plus complet et \u00e0 jour \ud83d\ude42 Ahhhhh !!<\/p>\n<p><span style=\"color: #ff0000;\"><a style=\"color: #ff0000;\" href=\"http:\/\/dasini.net\/blog\/2018\/08\/21\/tutoriel-deployer-mysql-5-7-innodb-cluster\/\">C&rsquo;est par ici.<\/a><\/span><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Dans les \u00e9pisodes pr\u00e9c\u00e9dents on a vu comment \u00a0<a href=\"http:\/\/dasini.net\/blog\/2016\/11\/08\/deployer-un-cluster-mysql-group-replication\/\" target=\"_blank\" rel=\"noopener noreferrer\">d\u00e9ployer \u00ab\u00a0manuellement\u00a0\u00bb MySQL Group Replication<\/a>, \u00a0<a href=\"http:\/\/dasini.net\/blog\/2017\/03\/13\/tester-mysql-innodb-cluster\/\" target=\"_blank\" rel=\"noopener noreferrer\">comprendre et tester MySQL InnoDB Cluster<\/a>\u00a0 ainsi que comment \u00a0<a href=\"http:\/\/dasini.net\/blog\/2017\/04\/10\/adopte-un-cluster-mysql-group-replication\/\" target=\"_blank\" rel=\"noopener noreferrer\">g\u00e9rer ais\u00e9ment un cluster Group Replication d\u00e9ja d\u00e9ploy\u00e9<\/a> avec MySQL Shell.<\/p>\n<p>Aujourd&rsquo;hui, dans la s\u00e9rie\u00a0<strong>Haute Disponibilit\u00e9 avec MySQL<\/strong>\u00a0on va voir comment d\u00e9ployer et g\u00e9rer un cluster <em>from scratch<\/em>\u00a0, sous la forme d&rsquo;un tutoriel, gr\u00e2ce \u00e0 la solution tout en un : <strong>MySQL InnoDB Cluster<\/strong>.<\/p>\n<p><em>Note:\u00a0<\/em><br \/>\n<em>L&rsquo;article traite de MySQL InnoDB Cluster, HA natif de MySQL Server (plugin GRoup Replication) avec pour moteur de stockage <a href=\"https:\/\/dev.mysql.com\/doc\/refman\/5.7\/en\/innodb-storage-engine.html\" target=\"_blank\" rel=\"noopener noreferrer\">InnoDB<\/a>, solution \u00e0 ne pas confondre avec <a href=\"https:\/\/dev.mysql.com\/doc\/refman\/5.7\/en\/mysql-cluster.html\" target=\"_blank\" rel=\"noopener noreferrer\">MySQL NDB Cluster<\/a>\u00a0(moteur de stockage NDB).<\/em><\/p>\n<p>&nbsp;<\/p>\n<h2>Le contexte<\/h2>\n<p>3 instances MySQL autonomes, &lt;spoil altert&gt; qui vont gr\u00e2ce au plugin <a href=\"https:\/\/dev.mysql.com\/doc\/refman\/5.7\/en\/group-replication.html\" target=\"_blank\" rel=\"noopener noreferrer\">MySQL Group Replication<\/a> se transformer en une base de donn\u00e9es distribu\u00e9e.&lt;\/spoil altert&gt;<\/p>\n<ul>\n<li>Instance MySQL 1 : 192.168.1.22; N\u0153ud num\u00e9ro 1 du cluster<\/li>\n<li>Instance MySQL 2 : 192.168.1.50; N\u0153ud num\u00e9ro 2 du cluster<\/li>\n<li>Instance MySQL 3 : 192.168.1.48; N\u0153ud num\u00e9ro 3 du cluster<\/li>\n<\/ul>\n<p>1 instance applicative :\u00a0192.168.1.11; MySQL Router + mon application.<\/p>\n<p>MySQL Shell est install\u00e9 sur toutes les instances.<\/p>\n<p>En ce qui concerne les versions des logiciels:<\/p>\n<ul>\n<li><a href=\"https:\/\/dev.mysql.com\/downloads\/mysql\/\" target=\"_blank\" rel=\"noopener noreferrer\">MySQL Server 5.7.18 GA<\/a><\/li>\n<li><a href=\"https:\/\/dev.mysql.com\/downloads\/router\/\" target=\"_blank\" rel=\"noopener noreferrer\">MySQL Router 2.1.3 GA<\/a><\/li>\n<li><a href=\"https:\/\/dev.mysql.com\/downloads\/shell\/\" target=\"_blank\" rel=\"noopener noreferrer\">MySQL Shell 1.0.9 GA<\/a><\/li>\n<\/ul>\n<p><span style=\"color: #ff0000;\"><em>&#8212;<br \/>\nUpdate 08-08-2018<\/em><\/span><\/p>\n<p><span style=\"color: #ff0000;\"><em><span style=\"text-decoration: underline;\">Note<\/span>: <strong>TOUJOURS<\/strong> prendre la <strong>derni\u00e8re<\/strong> version du <a style=\"color: #ff0000;\" href=\"https:\/\/dev.mysql.com\/downloads\/router\/\" target=\"_blank\" rel=\"noopener\">Router<\/a> <strong>et<\/strong> du <a style=\"color: #ff0000;\" href=\"https:\/\/dev.mysql.com\/downloads\/shell\/\" target=\"_blank\" rel=\"noopener\">Shell<\/a>. C&rsquo;est actuellement la branche <strong>8.0<\/strong>.x qui est bien \u00e9videmment <span style=\"text-decoration: underline;\">compatible<\/span> avec MySQL<strong> 5.7<\/strong> InnoDB Cluster.<\/em><\/span><\/p>\n<p><span style=\"color: #ff0000;\"><em>ex: MySQL Router 8.0.12 + MySQL Shell 8.0.12 avec MySQL 5.7.23<br \/>\n&#8212;<\/em><\/span><\/p>\n<p>&nbsp;<\/p>\n<p>Avec un sch\u00e9ma sa donne (\u00e0 peu pr\u00e8s) \u00e7a :<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/MySQL_InnoDB_Cluster_Production_post.png?resize=600%2C837\" alt=\"MySQL InnoDB Cluster PoC Architecture\" width=\"600\" height=\"837\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2>V\u00e9rifier la configuration des instances<\/h2>\n<p>La premi\u00e8re \u00e9tape consiste \u00e0 s&rsquo;assurer que les instances MySQL sont correctement configur\u00e9es pour l&rsquo;utilisation de <a href=\"https:\/\/dev.mysql.com\/doc\/refman\/5.7\/en\/group-replication.html\" target=\"_blank\" rel=\"noopener noreferrer\">MySQL Group Replication<\/a>, la couche <strong>haute disponibilit\u00e9<\/strong> de notre architecture. A noter qu&rsquo;il est pr\u00e9f\u00e9rable de provisionner ses instances d\u00e9j\u00e0 correctement configur\u00e9es (<a href=\"http:\/\/dasini.net\/blog\/2016\/11\/08\/deployer-un-cluster-mysql-group-replication\/\" target=\"_blank\" rel=\"noopener noreferrer\">comme d\u00e9taill\u00e9 dans cet article<\/a>) pour MySQL Group Replication.<\/p>\n<p>La v\u00e9rification de la configuration se fait gr\u00e2ce \u00e0 MySQL Shell et la m\u00e9thode <em><strong>checkInstanceConfiguration()<\/strong><\/em>\u00a0:<\/p>\n<pre class=\"lang:sh decode:true\">$ mysqlsh\r\nWelcome to MySQL Shell 1.0.9\r\n\r\nCopyright (c) 2016, 2017, Oracle and\/or its affiliates. All rights reserved.\r\n\r\nOracle is a registered trademark of Oracle Corporation and\/or its\r\naffiliates. Other names may be trademarks of their respective\r\nowners.\r\n\r\nType '\\help', '\\h' or '\\?' for help, type '\\quit' or '\\q' to exit.\r\n\r\nCurrently in JavaScript mode. Use \\sql to switch to SQL mode and execute queries.\r\n\r\n\r\n\r\nmysql-js&gt; dba.checkInstanceConfiguration('root@192.168.1.22:3306')\r\nPlease provide the password for 'root@192.168.1.22:3306': \r\nValidating instance...\r\n\r\nThe instance '192.168.1.22:3306' is not valid for Cluster usage.\r\n\r\nThe following issues were encountered:\r\n\r\n - Some configuration options need to be fixed.\r\n\r\n+----------------------------------+---------------+----------------+--------------------------------------------------+\r\n| Variable                         | Current Value | Required Value | Note                                             |\r\n+----------------------------------+---------------+----------------+--------------------------------------------------+\r\n| binlog_checksum                  | CRC32         | NONE           | Update the server variable or restart the server |\r\n| enforce_gtid_consistency         | OFF           | ON             | Restart the server                               |\r\n| gtid_mode                        | OFF           | ON             | Restart the server                               |\r\n| log_bin                          | 0             | 1              | Restart the server                               |\r\n| log_slave_updates                | 0             | ON             | Restart the server                               |\r\n| master_info_repository           | FILE          | TABLE          | Restart the server                               |\r\n| relay_log_info_repository        | FILE          | TABLE          | Restart the server                               |\r\n| transaction_write_set_extraction | OFF           | XXHASH64       | Restart the server                               |\r\n+----------------------------------+---------------+----------------+--------------------------------------------------+\r\n\r\n\r\nPlease fix these issues , restart the serverand try again.\r\n\r\n{\r\n    \"config_errors\": [\r\n        {\r\n            \"action\": \"server_update\", \r\n            \"current\": \"CRC32\", \r\n            \"option\": \"binlog_checksum\", \r\n            \"required\": \"NONE\"\r\n        },\r\n        {\r\n            \"action\": \"restart\", \r\n            \"current\": \"OFF\", \r\n            \"option\": \"enforce_gtid_consistency\", \r\n            \"required\": \"ON\"\r\n        },\r\n        {\r\n            \"action\": \"restart\", \r\n            \"current\": \"OFF\", \r\n            \"option\": \"gtid_mode\", \r\n            \"required\": \"ON\"\r\n        },\r\n        {\r\n            \"action\": \"restart\", \r\n            \"current\": \"0\", \r\n            \"option\": \"log_bin\", \r\n            \"required\": \"1\"\r\n        },\r\n        {\r\n            \"action\": \"restart\", \r\n            \"current\": \"0\", \r\n            \"option\": \"log_slave_updates\", \r\n            \"required\": \"ON\"\r\n        },\r\n        {\r\n            \"action\": \"restart\", \r\n            \"current\": \"FILE\", \r\n            \"option\": \"master_info_repository\", \r\n            \"required\": \"TABLE\"\r\n        },\r\n        {\r\n            \"action\": \"restart\", \r\n            \"current\": \"FILE\", \r\n            \"option\": \"relay_log_info_repository\", \r\n            \"required\": \"TABLE\"\r\n        },\r\n        {\r\n            \"action\": \"restart\", \r\n            \"current\": \"OFF\", \r\n            \"option\": \"transaction_write_set_extraction\", \r\n            \"required\": \"XXHASH64\"\r\n        }\r\n    ], \r\n    \"errors\": [], \r\n    \"restart_required\": true, \r\n    \"status\": \"error\"\r\n}<\/pre>\n<p>Dans mon cas, avec l&rsquo;installation par d\u00e9faut sous Ubuntu, niveau configuration j&rsquo;ai tout \u00e0 faire \ud83d\ude42<\/p>\n<p>La m\u00e9thode renvoie un document JSON (pratique pour l&rsquo;automatisation) avec la liste des t\u00e2ches \u00e0 effectuer pour \u00eatre conforme&#8230; Configurons donc !<\/p>\n<p>&nbsp;<\/p>\n<p>J&rsquo;ai deux solutions :<\/p>\n<ul>\n<li>1\/ je pr\u00e9pare mes instances \u00ab\u00a0manuellement\u00a0\u00bb (cette t\u00e2che peut bien \u00e9videmment s&rsquo;automatiser) comme expliqu\u00e9 dans l&rsquo;article\u00a0<a href=\"http:\/\/dasini.net\/blog\/2016\/11\/08\/deployer-un-cluster-mysql-group-replication\/\" target=\"_blank\" rel=\"noopener noreferrer\">comment configurer un groupe<\/a>.<\/li>\n<li>2\/ je me connecte \u00e0 chaque instance en local, et j&rsquo;utilise la m\u00e9thode : <em><strong>configureLocalInstance()<\/strong><\/em><\/li>\n<\/ul>\n<p>Soyons fou ! allons y\u00a0pour la m\u00e9thode 2 :<\/p>\n<pre class=\"lang:mysql decode:true\">mysql-js&gt; dba.configureLocalInstance('root@192.168.1.22:3306')\r\nDba.configureLocalInstance: This function only works with local instances (RuntimeError)<\/pre>\n<p>Ouppss!!!\u00a0<em>dba.configureLocalInstance<\/em>\u00a0ne fonctionne qu&rsquo;en local, c&rsquo;est-\u00e0-dire, si je suis connect\u00e9 sur la machine h\u00f4te de l&rsquo;instance MySQL (ce qui est une bonne chose). Du coup apr\u00e8s m&rsquo;\u00eatre connect\u00e9 \u00e0 l&rsquo;h\u00f4te 192.168.1.22 :<\/p>\n<pre class=\"lang:mysql decode:true\">sudo mysqlsh\r\nWelcome to MySQL Shell 1.0.9\r\n...\r\n\r\nmysql-js&gt; dba.configureLocalInstance('root@localhost:3306')\r\nPlease provide the password for 'root@localhost:3306': \r\n\r\nDetecting the configuration file...\r\nFound configuration file at standard location: \/etc\/mysql\/mysql.conf.d\/mysqld.cnf\r\nDo you want to modify this file? [Y|n]: Y\r\nValidating instance...\r\n\r\nThe configuration has been updated but it is required to restart the server.\r\n\r\n{\r\n    \"config_errors\": [\r\n        {\r\n            \"action\": \"restart\", \r\n            \"current\": \"OFF\", \r\n            \"option\": \"enforce_gtid_consistency\", \r\n            \"required\": \"ON\"\r\n        },\r\n        {\r\n            \"action\": \"restart\", \r\n            \"current\": \"OFF\", \r\n            \"option\": \"gtid_mode\", \r\n            \"required\": \"ON\"\r\n        },\r\n        {\r\n            \"action\": \"restart\", \r\n            \"current\": \"0\", \r\n            \"option\": \"log_bin\", \r\n            \"required\": \"1\"\r\n        },\r\n        {\r\n            \"action\": \"restart\", \r\n            \"current\": \"0\", \r\n            \"option\": \"log_slave_updates\", \r\n            \"required\": \"ON\"\r\n        },\r\n        {\r\n            \"action\": \"restart\", \r\n            \"current\": \"FILE\", \r\n            \"option\": \"master_info_repository\", \r\n            \"required\": \"TABLE\"\r\n        },\r\n        {\r\n            \"action\": \"restart\", \r\n            \"current\": \"FILE\", \r\n            \"option\": \"relay_log_info_repository\", \r\n            \"required\": \"TABLE\"\r\n        },\r\n        {\r\n            \"action\": \"restart\", \r\n            \"current\": \"OFF\", \r\n            \"option\": \"transaction_write_set_extraction\", \r\n            \"required\": \"XXHASH64\"\r\n        }\r\n    ], \r\n    \"errors\": [], \r\n    \"restart_required\": true, \r\n    \"status\": \"error\"\r\n}<\/pre>\n<p><em><span style=\"text-decoration: underline;\">Note<\/span>: Assure toi d&rsquo;avoir les droits n\u00e9cessaires\u00a0pour mettre \u00e0 jour le fichier de configuration de MySQL.<\/em><\/p>\n<p>Les informations ajout\u00e9es dans le fichier de configuration se trouvent en fin de fichier :<\/p>\n<pre class=\"lang:sh decode:true\"># cat \/etc\/mysql\/mysql.conf.d\/mysqld.cnf\r\n\r\n[mysqld]\r\n... &lt;data previously in the file&gt; ...\r\n\r\nlog_slave_updates = ON\r\nserver_id = 2323701546\r\nrelay_log_info_repository = TABLE\r\nmaster_info_repository = TABLE\r\ntransaction_write_set_extraction = XXHASH64\r\nbinlog_format = ROW\r\ndisabled_storage_engines = MyISAM,BLACKHOLE,FEDERATED,CSV,ARCHIVE\r\nreport_port = 3306\r\nbinlog_checksum = NONE\r\nenforce_gtid_consistency = ON\r\nlog_bin\r\ngtid_mode = ON<\/pre>\n<p>192.168.1.22 est configur\u00e9e. Apr\u00e8s red\u00e9marrage de l&rsquo;instance MySQL, la sortie de\u00a0<em>checkInstanceConfiguration<\/em> est beaucoup moins anxiog\u00e8ne :<\/p>\n<pre class=\"lang:mysql decode:true\">mysql-js&gt; dba.checkInstanceConfiguration('root@192.168.1.22:3306')\r\nPlease provide the password for 'root@192.168.1.22:3306': \r\nValidating instance...\r\n\r\nThe instance '192.168.1.22:3306' is valid for Cluster usage\r\n{\r\n    \"status\": \"ok\"\r\n}<\/pre>\n<p>OK ! Le membre est pr\u00eat pour faire parti d&rsquo;un groupe.<\/p>\n<p>La m\u00eame proc\u00e9dure doit \u00eatre appliqu\u00e9e sur les autres instances MySQL.<\/p>\n<p>&#8230;<\/p>\n<pre class=\"lang:mysql decode:true\">mysql-js&gt; dba.checkInstanceConfiguration('root@192.168.1.50:3306')\r\nPlease provide the password for 'root@192.168.1.50:3306': \r\nValidating instance...\r\n\r\nThe instance '192.168.1.50:3306' is valid for Cluster usage\r\n{\r\n    \"status\": \"ok\"\r\n}\r\nmysql-js&gt; dba.checkInstanceConfiguration('root@192.168.1.48:3306')\r\nPlease provide the password for 'root@192.168.1.48:3306': \r\nValidating instance...\r\n\r\nThe instance '192.168.1.48:3306' is valid for Cluster usage\r\n{\r\n    \"status\": \"ok\"\r\n}<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h2>Cr\u00e9er le cluster<\/h2>\n<p>Une fois les 3 instances correctement configur\u00e9es, l&rsquo;\u00e9tape suivante consiste \u00e0 cr\u00e9er le cluster avec\u00a0<strong><em>createCluster<\/em><\/strong>. Cette m\u00e9thode va \u00eatre jou\u00e9e sur le premier membre, l&rsquo;instance MySQL sur \u00a0192.168.1.22, \u00a0elle va permettre de bootstrapper le cluster:<\/p>\n<pre class=\"lang:mysql decode:true\">mysql-js&gt; \\c root@192.168.1.22\r\nCreating a Session to 'root@192.168.1.22'\r\nEnter password: \r\nClassic Session successfully established. No default schema selected.\r\n\r\n\r\nmysql-js&gt; var cluster = dba.createCluster('pocCluster', {ipWhitelist: \"192.168.1.0\/16\"});\r\nA new InnoDB cluster will be created on instance 'root@192.168.1.22:3306'.\r\n\r\nCreating InnoDB cluster 'pocCluster' on 'root@192.168.1.22:3306'...\r\nAdding Seed Instance...\r\n\r\nCluster successfully created. Use Cluster.addInstance() to add MySQL instances.\r\nAt least 3 instances are needed for the cluster to be able to withstand up to\r\none server failure.<\/pre>\n<p><em><strong>createCluster()<\/strong><\/em> prend comme param\u00e8tre le nom du cluster (pocCluster). Je peux lui passer \u00e9galement quelques information optionnelles comme la <a href=\"https:\/\/dev.mysql.com\/doc\/refman\/5.7\/en\/group-replication-ip-address-whitelisting.html\" target=\"_blank\" rel=\"noopener noreferrer\">whitelist<\/a>.<\/p>\n<p>On peut v\u00e9rifier l&rsquo;\u00e9tat du n\u0153ud dans le cluster avec\u00a0<strong>status<em>()<\/em><\/strong> :<\/p>\n<pre class=\"lang:mysql decode:true\">mysql-js&gt; cluster.status()\r\n{\r\n    \"clusterName\": \"pocCluster\", \r\n    \"defaultReplicaSet\": {\r\n        \"name\": \"default\", \r\n        \"primary\": \"192.168.1.22:3306\", \r\n        \"status\": \"OK_NO_TOLERANCE\", \r\n        \"statusText\": \"Cluster is NOT tolerant to any failures.\", \r\n        \"topology\": {\r\n            \"192.168.1.22:3306\": {\r\n                \"address\": \"192.168.1.22:3306\", \r\n                \"mode\": \"R\/W\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"ONLINE\"\r\n            }\r\n        }\r\n    }\r\n}<\/pre>\n<p><em><span style=\"text-decoration: underline;\">Notes<\/span> : Assure toi que ton\u00a0DNS (ou \/etc\/hosts) est\u00a0correctement configur\u00e9, sinon tu vas avoir des soucis de connections&#8230;<\/em><\/p>\n<p>&nbsp;<\/p>\n<p>L&rsquo;ajouts des\u00a0n\u0153uds suivant se fait avec <strong>addInstance()<\/strong>, il est n\u00e9anmoins conseill\u00e9 d&rsquo;ex\u00e9cuter <strong>checkInstanceState()<\/strong>\u00a0au pr\u00e9alable pour s&rsquo;assurer de la compatibilit\u00e9 des GTID sets :<\/p>\n<p><span style=\"text-decoration: underline;\">N\u0153ud 2<\/span><\/p>\n<pre class=\"lang:mysql decode:true\">mysql-js&gt; cluster.checkInstanceState('root@192.168.1.50:3306')\r\nPlease provide the password for 'root@192.168.1.50:3306': \r\nAnalyzing the instance replication state...\r\n\r\nThe instance '192.168.1.50:3306' is valid for the cluster.\r\nThe instance is new to Group Replication.\r\n\r\n{\r\n    \"reason\": \"new\", \r\n    \"state\": \"ok\"\r\n}\r\n\r\n\r\nmysql-js&gt; cluster.addInstance(\"root@192.168.1.50:3306\", {ipWhitelist: \"192.168.1.0\/16\"})\r\nA new instance will be added to the InnoDB cluster. Depending on the amount of\r\ndata on the cluster this might take from a few seconds to several hours.\r\n\r\nPlease provide the password for 'root@192.168.1.50:3306': \r\nAdding instance to the cluster ...\r\n\r\nThe instance 'root@192.168.1.50:3306' was successfully added to the cluster.\r\n\r\n\r\nmysql-js&gt; cluster.status();\r\n{\r\n    \"clusterName\": \"pocCluster\", \r\n    \"defaultReplicaSet\": {\r\n        \"name\": \"default\", \r\n        \"primary\": \"192.168.1.22:3306\", \r\n        \"status\": \"OK_NO_TOLERANCE\", \r\n        \"statusText\": \"Cluster is NOT tolerant to any failures.\", \r\n        \"topology\": {\r\n            \"192.168.1.22:3306\": {\r\n                \"address\": \"192.168.1.22:3306\", \r\n                \"mode\": \"R\/W\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"ONLINE\"\r\n            }, \r\n            \"192.168.1.50:3306\": {\r\n                \"address\": \"192.168.1.50:3306\", \r\n                \"mode\": \"R\/O\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"ONLINE\"\r\n            }\r\n        }\r\n    }\r\n}<\/pre>\n<p>Au cas o\u00f9 l&rsquo;instance ajout\u00e9e contient plus de transactions que le groupe <em>checkInstanceState<\/em>\u00a0le fait savoir :<\/p>\n<pre class=\"lang:mysql decode:true\">mysql-js&gt; cluster.checkInstanceState('root@192.168.1.50:3306')\r\nPlease provide the password for 'root@192.168.1.50:3306': \r\nAnalyzing the instance replication state...\r\n\r\nThe instance '192.168.1.50:3306' is invalid for the cluster.\r\nThe instance contains additional transactions in relation to the cluster.\r\n\r\n{\r\n    \"reason\": \"diverged\", \r\n    \"state\": \"error\"\r\n}<\/pre>\n<p>En fonction du contexte, il faut alors soit restaurer une sauvegarde d&rsquo;un membre du cluster sur l&rsquo;instance probl\u00e9matique (celle qui diverge) ou alors si <a href=\"https:\/\/dev.mysql.com\/doc\/refman\/5.7\/en\/replication-gtids-failover.html\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"text-decoration: underline;\">tu sais ce que tu fais<\/span><\/a>, une <a href=\"https:\/\/dev.mysql.com\/doc\/refman\/5.7\/en\/replication-gtids-failover.html#replication-gtids-failover-empty\" target=\"_blank\" rel=\"noopener noreferrer\">synchronisation des GTIDs<\/a> est toujours possible, voir un <a href=\"https:\/\/dev.mysql.com\/doc\/refman\/5.7\/en\/reset-master.html\" target=\"_blank\" rel=\"noopener noreferrer\">reset master<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"text-decoration: underline;\">N\u0153ud 3<\/span><\/p>\n<pre class=\"lang:mysql decode:true\">mysql-js&gt; cluster.checkInstanceState('root@192.168.1.48:3306')\r\nPlease provide the password for 'root@192.168.1.48:3306': \r\nAnalyzing the instance replication state...\r\n\r\nThe instance '192.168.1.48:3306' is valid for the cluster.\r\nThe instance is new to Group Replication.\r\n\r\n{\r\n    \"reason\": \"new\", \r\n    \"state\": \"ok\"\r\n}\r\n\r\n\r\nmysql-js&gt; cluster.addInstance(\"root@192.168.1.48:3306\", {ipWhitelist: \"192.168.1.0\/16\"})\r\nA new instance will be added to the InnoDB cluster. Depending on the amount of\r\ndata on the cluster this might take from a few seconds to several hours.\r\n\r\nPlease provide the password for 'root@192.168.1.48:3306': \r\nAdding instance to the cluster ...\r\n\r\nThe instance 'root@192.168.1.48:3306' was successfully added to the cluster.\r\n\r\n\r\nmysql-js&gt; cluster.status();\r\n{\r\n    \"clusterName\": \"pocCluster\", \r\n    \"defaultReplicaSet\": {\r\n        \"name\": \"default\", \r\n        \"primary\": \"192.168.1.22:3306\", \r\n        \"status\": \"OK\", \r\n        \"statusText\": \"Cluster is ONLINE and can tolerate up to ONE failure.\", \r\n        \"topology\": {\r\n            \"192.168.1.22:3306\": {\r\n                \"address\": \"192.168.1.22:3306\", \r\n                \"mode\": \"R\/W\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"ONLINE\"\r\n            }, \r\n            \"192.168.1.48:3306\": {\r\n                \"address\": \"192.168.1.48:3306\", \r\n                \"mode\": \"R\/O\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"ONLINE\"\r\n            }, \r\n            \"192.168.1.50:3306\": {\r\n                \"address\": \"192.168.1.50:3306\", \r\n                \"mode\": \"R\/O\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"ONLINE\"\r\n            }\r\n        }\r\n    }\r\n}\r\n<\/pre>\n<p>Et voil\u00e0!<\/p>\n<p>Cluster MySQL Group Replication de 3 n\u0153uds d\u00e9ploy\u00e9 gr\u00e2ce \u00e0 MySQL Shell !<\/p>\n<ul>\n<li>N\u0153ud 1\u00a0: 192.168.1.22 : Primaire (lecture\/\u00e9criture)<\/li>\n<li>N\u0153ud 2 : 192.168.1.50 : Secondaire (lecture seule)<\/li>\n<li>N\u0153ud 3 : 192.168.1.48 : Secondaire (lecture seule)<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>Pour rendre la configuration persistante ie l&rsquo;\u00e9crire dans le fichier de configuration, il faut ex\u00e9cuter, apr\u00e8s que le noeud soit configur\u00e9, la m\u00e9thode\u00a0dba.<strong>configureLocalInstance()<\/strong> :<\/p>\n<pre class=\"lang:mysql decode:true\">daz@192.168.1.50:~$ grep -c group_replication \/etc\/mysql\/mysql.conf.d\/mysqld.cnf\r\n0\r\n\r\n\r\ndaz@192.168.1.50:~$ sudo mysqlsh --uri=root@localhost\r\nCreating a Session to 'root@localhost'\r\nEnter password: \r\nClassic Session successfully established. No default schema selected.\r\nWelcome to MySQL Shell 1.0.9\r\n...\r\n\r\n\r\nmysql-js&gt; dba.configureLocalInstance(\"root@localhost:3306\")  \r\nPlease provide the password for 'root@localhost:3306': \r\n\r\nDetecting the configuration file...\r\nFound configuration file at standard location: \/etc\/mysql\/mysql.conf.d\/mysqld.cnf\r\nDo you want to modify this file? [Y|n]: Y\r\nValidating instance...\r\n\r\nThe instance 'localhost:3306' is valid for Cluster usage\r\nYou can now use it in an InnoDB Cluster.\r\n\r\n{\r\n    \"status\": \"ok\"\r\n}\r\n\r\n\r\n\r\ndaz@192.168.1.50:~$ grep -c group_replication \/etc\/mysql\/my.cnf\r\n32\r\n<\/pre>\n<p>A noter que cette op\u00e9ration ne peut se faire qu&rsquo;en local.<\/p>\n<p>La suite ?<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h2>Configuration de MySQL Router<\/h2>\n<p>Les recommandations de MySQL sont d&rsquo;installer MySQL Router sur la machine h\u00f4te de l&rsquo;application, je vais donc l&rsquo;installer sur la machine\u00a0192.168.1.11.<\/p>\n<p>&nbsp;<\/p>\n<p><em><span style=\"text-decoration: underline;\">Note<\/span>: Si tu ne peux (veux) pas mettre MySQL Router sur l&rsquo;application, il va alors te falloir g\u00e9rer le HA du Router. Plusieurs solutions sont envisageables comme :<\/em><\/p>\n<ul>\n<li><em><a href=\"https:\/\/lefred.be\/content\/mysql-router-ha-with-pacemaker\/\" target=\"_blank\" rel=\"noopener\">Pacemaker<\/a><\/em><\/li>\n<li><em><a href=\"https:\/\/lefred.be\/content\/mysql-router-ha-with-keepalived\/\" target=\"_blank\" rel=\"noopener\">Keepalived<\/a><\/em><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3>Bootstrap MySQL Router<\/h3>\n<pre class=\"lang:sh decode:true\">daz@192.168.1.11 ~ $ mysqlrouter --bootstrap root@192.168.1.22:3306 --directory RouterPoC\r\nPlease enter MySQL password for root: \r\n\r\nBootstrapping MySQL Router instance at \/home\/daz\/RouterPoC...\r\nMySQL Router  has now been configured for the InnoDB cluster 'pocCluster'.\r\n\r\nThe following connection information can be used to connect to the cluster.\r\n\r\nClassic MySQL protocol connections to cluster 'pocCluster':\r\n- Read\/Write Connections: localhost:6446\r\n- Read\/Only Connections: localhost:6447\r\n\r\nX protocol connections to cluster 'pocCluster':\r\n- Read\/Write Connections: localhost:64460\r\n- Read\/Only Connections: localhost:64470<\/pre>\n<p>4 ports TCP ont \u00e9t\u00e9 configur\u00e9s, dont 2 pour les connexions MySQL traditionnelles:<\/p>\n<p>6446 : lectures \/ \u00e9critures pour le noeud primaire<br \/>\n6447 : lectures seules pour les n\u0153uds secondaires (Round-Robin)<br \/>\nEt le pendant pour les connexions avec le protocole X (64460 &amp; 64470), pour une utilisation <a href=\"https:\/\/dev.mysql.com\/doc\/refman\/5.7\/en\/document-store.html\" target=\"_blank\" rel=\"noopener noreferrer\">NoSQL Document Store<\/a> de MySQL.<\/p>\n<p>&nbsp;<\/p>\n<p>Le fichier de configuration du Router contient quelques informations importantes, tel que le(s) port(s) \u00e0 utiliser par l&rsquo;application :<\/p>\n<pre class=\"lang:sh decode:true\">daz@192.168.1.11 ~ $ cat ~\/RouterPoC\/mysqlrouter.conf\r\n# File automatically generated during MySQL Router bootstrap\r\n[DEFAULT]\r\nlogging_folder=\/home\/daz\/RouterPoC\/log\r\nruntime_folder=\/home\/daz\/RouterPoC\/run\r\ndata_folder=\/home\/daz\/RouterPoC\/data\r\nkeyring_path=\/home\/daz\/RouterPoC\/data\/keyring\r\nmaster_key_path=\/home\/daz\/RouterPoC\/mysqlrouter.key\r\n\r\n[logger]\r\nlevel = INFO\r\n\r\n[metadata_cache:pocCluster]\r\nrouter_id=3\r\nbootstrap_server_addresses=mysql:\/\/192.168.1.22:3306,mysql:\/\/192.168.1.50:3306,mysql:\/\/192.168.1.48:3306\r\nuser=mysql_router3_qeteek4wi41s\r\nmetadata_cluster=pocCluster\r\nttl=300\r\n\r\n[routing:pocCluster_default_rw]\r\nbind_address=0.0.0.0\r\nbind_port=6446\r\ndestinations=metadata-cache:\/\/pocCluster\/default?role=PRIMARY\r\nmode=read-write\r\nprotocol=classic\r\n\r\n[routing:pocCluster_default_ro]\r\nbind_address=0.0.0.0\r\nbind_port=6447\r\ndestinations=metadata-cache:\/\/pocCluster\/default?role=SECONDARY\r\nmode=read-only\r\nprotocol=classic\r\n\r\n[routing:pocCluster_default_x_rw]\r\nbind_address=0.0.0.0\r\nbind_port=64460\r\ndestinations=metadata-cache:\/\/pocCluster\/default?role=PRIMARY\r\nmode=read-write\r\nprotocol=x\r\n\r\n[routing:pocCluster_default_x_ro]\r\nbind_address=0.0.0.0\r\nbind_port=64470\r\ndestinations=metadata-cache:\/\/pocCluster\/default?role=SECONDARY\r\nmode=read-only\r\nprotocol=x<\/pre>\n<p>Il est \u00e9videmment possible de modifier ce fichier. Par exemple, souvent les applications se connectent au port <strong>3306<\/strong>, \u00e7a peut donc avoir du sens de modifier le port du noeud primaire en le passant de 6446 \u00e0 3306 :<\/p>\n<pre class=\"lang:sh decode:true\">daz@192.168.1.11 ~ $ grep -A6 pocCluster_default_rw ~\/RouterPoC\/mysqlrouter.conf\r\n[routing:pocCluster_default_rw]\r\nbind_address=0.0.0.0\r\nbind_port=3306\r\ndestinations=metadata-cache:\/\/pocCluster\/default?role=PRIMARY\r\nmode=read-write\r\nprotocol=classic<\/pre>\n<p>Ton application va donc (continuer \u00e0) se connecter au port 3306, sauf que maintenant ce n&rsquo;est pas 1 instance, mais bel et bien 3 instances qui sont en <em>backend<\/em>, et ceci en toute transparence.<\/p>\n<p>&nbsp;<\/p>\n<p>Ensuite, il faut d\u00e9marrer MySQL Router avec le script <strong>start.sh<\/strong><\/p>\n<pre class=\"lang:sh decode:true\">daz@192.168.1.11 ~ $ ~\/RouterPoC\/start.sh<\/pre>\n<p>L&rsquo;arr\u00eat du Router se fait avec le script <strong>stop.sh<\/strong>\u00a0(mais tu l&rsquo;avais devin\u00e9)<\/p>\n<pre class=\"lang:sh decode:true\">daz@192.168.1.11 ~ $ ~\/RouterPoC\/stop.sh<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h2>Gestion des n\u0153uds<\/h2>\n<p>Quelques commandes qui vont te simplifier la vie&#8230;<\/p>\n<p>&nbsp;<\/p>\n<h3>R\u00e9cup\u00e9rer les m\u00e9ta-donn\u00e9es d&rsquo;un cluster<\/h3>\n<p>Les m\u00e9ta-donn\u00e9es du cluster sont stock\u00e9es sur les membres dans le sch\u00e9ma\u00a0<strong><em>mysql_innodb_cluster_metadata<\/em><\/strong> :<\/p>\n<pre class=\"lang:mysql decode:true\">mysql&gt; SHOW SCHEMAS;\r\n+-------------------------------+\r\n| Database                      |\r\n+-------------------------------+\r\n| information_schema            |\r\n| mysql                         |\r\n| mysql_innodb_cluster_metadata |\r\n| performance_schema            |\r\n| sys                           |\r\n+-------------------------------+\r\n5 rows in set (0,00 sec)\r\n\r\n\r\nmysql&gt; SHOW TABLES IN mysql_innodb_cluster_metadata;\r\n+-----------------------------------------+\r\n| Tables_in_mysql_innodb_cluster_metadata |\r\n+-----------------------------------------+\r\n| clusters                                |\r\n| hosts                                   |\r\n| instances                               |\r\n| replicasets                             |\r\n| routers                                 |\r\n| schema_version                          |\r\n+-----------------------------------------+\r\n6 rows in set (0,01 sec)\r\n\r\n\r\nmysql&gt; SELECT cluster_name FROM mysql_innodb_cluster_metadata.clusters;\r\n+--------------+\r\n| cluster_name |\r\n+--------------+\r\n| pocCluster   |\r\n+--------------+<\/pre>\n<p>Pour r\u00e9cup\u00e9rer ces informations dans une nouvelle session il faut utiliser la m\u00e9thode\u00a0<strong><em>getCluster<\/em><\/strong> :<\/p>\n<pre class=\"lang:mysql decode:true\">mysql-js&gt; cluster.status()\r\nReferenceError: cluster is not defined\r\n\r\n\r\nmysql-js&gt; var cluster = dba.getCluster('pocCluster')\r\n\r\n\r\nmysql-js&gt; cluster.status()\r\n{\r\n    \"clusterName\": \"pocCluster\", \r\n    \"defaultReplicaSet\": {\r\n        \"name\": \"default\", \r\n        \"primary\": \"192.168.1.22:3306\", \r\n        \"status\": \"OK\", \r\n        \"statusText\": \"Cluster is ONLINE and can tolerate up to ONE failure.\", \r\n        \"topology\": {\r\n            \"192.168.1.22:3306\": {\r\n                \"address\": \"192.168.1.22:3306\", \r\n                \"mode\": \"R\/W\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"ONLINE\"\r\n            }, \r\n            \"192.168.1.48:3306\": {\r\n                \"address\": \"192.168.1.48:3306\", \r\n                \"mode\": \"R\/O\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"ONLINE\"\r\n            }, \r\n            \"192.168.1.50:3306\": {\r\n                \"address\": \"192.168.1.50:3306\", \r\n                \"mode\": \"R\/O\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"ONLINE\"\r\n            }\r\n        }\r\n    }\r\n}<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3>Failover<\/h3>\n<p>Le basculement niveau base de donn\u00e9es (changement de primaire) est automatiquement g\u00e9r\u00e9 par les membres du cluster entre eux.<\/p>\n<pre class=\"lang:mysql decode:true\">mysql-js&gt; cluster.status()\r\n{\r\n    \"clusterName\": \"pocCluster\", \r\n    \"defaultReplicaSet\": {\r\n        \"name\": \"default\", \r\n        \"primary\": \"192.168.1.22:3306\", \r\n        \"status\": \"OK\", \r\n        \"statusText\": \"Cluster is ONLINE and can tolerate up to ONE failure.\", \r\n        \"topology\": {\r\n            \"192.168.1.22:3306\": {\r\n                \"address\": \"192.168.1.22:3306\", \r\n                \"mode\": \"R\/W\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"ONLINE\"\r\n            }, \r\n            \"192.168.1.48:3306\": {\r\n                \"address\": \"192.168.1.48:3306\", \r\n                \"mode\": \"R\/O\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"ONLINE\"\r\n            }, \r\n            \"192.168.1.50:3306\": {\r\n                \"address\": \"192.168.1.50:3306\", \r\n                \"mode\": \"R\/O\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"ONLINE\"\r\n            }\r\n        }\r\n    }\r\n}\r\n<\/pre>\n<p>Crash du noeud primaire (192.168.1.22)&#8230;<\/p>\n<pre class=\"lang:mysql decode:true\">mysql-js&gt; cluster.status()\r\n{\r\n    \"clusterName\": \"pocCluster\", \r\n    \"defaultReplicaSet\": {\r\n        \"name\": \"default\", \r\n        \"primary\": \"192.168.1.48:3306\", \r\n        \"status\": \"OK_NO_TOLERANCE\", \r\n        \"statusText\": \"Cluster is NOT tolerant to any failures. 1 member is not active\", \r\n        \"topology\": {\r\n            \"192.168.1.22:3306\": {\r\n                \"address\": \"192.168.1.22:3306\", \r\n                \"mode\": \"R\/O\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"(MISSING)\"\r\n            }, \r\n            \"192.168.1.48:3306\": {\r\n                \"address\": \"192.168.1.48:3306\", \r\n                \"mode\": \"R\/W\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"ONLINE\"\r\n            }, \r\n            \"192.168.1.50:3306\": {\r\n                \"address\": \"192.168.1.50:3306\", \r\n                \"mode\": \"R\/O\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"ONLINE\"\r\n            }\r\n        }\r\n    }\r\n}<\/pre>\n<p>Nouveau primaire \u00e9lu par le groupe :\u00a0192.168.1.48.<\/p>\n<p>Et 192.168.1.22 est port\u00e9 disparu (MIA).<\/p>\n<p>&nbsp;<\/p>\n<p>Un <em><strong>rejoinInstance()<\/strong><\/em> est n\u00e9cessaire pour remettre le membre dans le cluster. Il aura un r\u00f4le de secondaire (voir paragraphe suivant\u00a0<strong><span style=\"text-decoration: underline;\">Remettre un membre dans le groupe<\/span><\/strong>).<\/p>\n<pre class=\"lang:mysql decode:true\">mysql-js&gt; cluster.status()\r\n{\r\n    \"clusterName\": \"pocCluster\", \r\n    \"defaultReplicaSet\": {\r\n        \"name\": \"default\", \r\n        \"primary\": \"192.168.1.48:3306\", \r\n        \"status\": \"OK\", \r\n        \"statusText\": \"Cluster is ONLINE and can tolerate up to ONE failure.\", \r\n        \"topology\": {\r\n            \"192.168.1.22:3306\": {\r\n                \"address\": \"192.168.1.22:3306\", \r\n                \"mode\": \"R\/O\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"ONLINE\"\r\n            }, \r\n            \"192.168.1.48:3306\": {\r\n                \"address\": \"192.168.1.48:3306\", \r\n                \"mode\": \"R\/W\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"ONLINE\"\r\n            }, \r\n            \"192.168.1.50:3306\": {\r\n                \"address\": \"192.168.1.50:3306\", \r\n                \"mode\": \"R\/O\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"ONLINE\"\r\n            }\r\n        }\r\n    }\r\n}<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3>Remettre un membre dans le groupe<\/h3>\n<p>Un membre avec son instance MySQL qui\u00a0tourne et qui est correctement configur\u00e9 peut \u00eatre remis (apr\u00e8s un red\u00e9marrage de l&rsquo;instance par exemple) dans le groupe avec la commande <em><strong>rejoinInstance()<\/strong><\/em> :<\/p>\n<pre class=\"lang:mysql decode:true\">mysql-js&gt; cluster.status()\r\n{\r\n    \"clusterName\": \"pocCluster\", \r\n    \"defaultReplicaSet\": {\r\n        \"name\": \"default\", \r\n        \"primary\": \"192.168.1.22:3306\", \r\n        \"status\": \"OK_NO_TOLERANCE\", \r\n        \"statusText\": \"Cluster is NOT tolerant to any failures. 1 member is not active\", \r\n        \"topology\": {\r\n            \"192.168.1.22:3306\": {\r\n                \"address\": \"192.168.1.22:3306\", \r\n                \"mode\": \"R\/W\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"ONLINE\"\r\n            }, \r\n            \"192.168.1.48:3306\": {\r\n                \"address\": \"192.168.1.48:3306\", \r\n                \"mode\": \"R\/O\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"ONLINE\"\r\n            }, \r\n            \"192.168.1.50:3306\": {\r\n                \"address\": \"192.168.1.50:3306\", \r\n                \"mode\": \"R\/O\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"(MISSING)\"\r\n            }\r\n        }\r\n    }\r\n}\r\n\r\n\r\nmysql-js&gt; cluster.checkInstanceState('root@192.168.1.50:3306')\r\nPlease provide the password for 'root@192.168.1.50:3306': \r\nAnalyzing the instance replication state...\r\n\r\nThe instance '192.168.1.50:3306' is valid for the cluster.\r\nThe instance is fully recoverable.\r\n\r\n{\r\n    \"reason\": \"recoverable\", \r\n    \"state\": \"ok\"\r\n}\r\n\r\n\r\nmysql-js&gt; cluster.rejoinInstance(\"root@192.168.1.50:3306\", {ipWhitelist: \"192.168.1.0\/16\"})\r\nRejoining the instance to the InnoDB cluster. Depending on the original\r\nproblem that made the instance unavailable, the rejoin operation might not be\r\nsuccessful and further manual steps will be needed to fix the underlying\r\nproblem.\r\n\r\nPlease monitor the output of the rejoin operation and take necessary action if\r\nthe instance cannot rejoin.\r\n\r\nPlease provide the password for 'root@192.168.1.50:3306': \r\nRejoining instance to the cluster ...\r\n\r\nThe instance 'root@192.168.1.50:3306' was successfully rejoined on the cluster.\r\n\r\nThe instance '192.168.1.50:3306' was successfully added to the MySQL Cluster.\r\n\r\n\r\nmysql-js&gt; cluster.status()\r\n{\r\n    \"clusterName\": \"pocCluster\", \r\n    \"defaultReplicaSet\": {\r\n        \"name\": \"default\", \r\n        \"primary\": \"192.168.1.22:3306\", \r\n        \"status\": \"OK\", \r\n        \"statusText\": \"Cluster is ONLINE and can tolerate up to ONE failure.\", \r\n        \"topology\": {\r\n            \"192.168.1.22:3306\": {\r\n                \"address\": \"192.168.1.22:3306\", \r\n                \"mode\": \"R\/W\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"ONLINE\"\r\n            }, \r\n            \"192.168.1.48:3306\": {\r\n                \"address\": \"192.168.1.48:3306\", \r\n                \"mode\": \"R\/O\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"ONLINE\"\r\n            }, \r\n            \"192.168.1.50:3306\": {\r\n                \"address\": \"192.168.1.50:3306\", \r\n                \"mode\": \"R\/O\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"ONLINE\"\r\n            }\r\n        }\r\n    }\r\n}<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3>Supprimer\u00a0une instance du groupe<\/h3>\n<p>Sans grande surprise, c&rsquo;est la commande\u00a0<strong><em>removeInstance<\/em><\/strong><\/p>\n<pre class=\"lang:mysql decode:true\">mysql-js&gt; cluster.status()\r\n{\r\n    \"clusterName\": \"pocCluster\", \r\n    \"defaultReplicaSet\": {\r\n        \"name\": \"default\", \r\n        \"primary\": \"192.168.1.22:3306\", \r\n        \"status\": \"OK\", \r\n        \"statusText\": \"Cluster is ONLINE and can tolerate up to ONE failure.\", \r\n        \"topology\": {\r\n            \"192.168.1.22:3306\": {\r\n                \"address\": \"192.168.1.22:3306\", \r\n                \"mode\": \"R\/W\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"ONLINE\"\r\n            }, \r\n            \"192.168.1.48:3306\": {\r\n                \"address\": \"192.168.1.48:3306\", \r\n                \"mode\": \"R\/O\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"ONLINE\"\r\n            }, \r\n            \"192.168.1.50:3306\": {\r\n                \"address\": \"192.168.1.50:3306\", \r\n                \"mode\": \"R\/O\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"ONLINE\"\r\n            }\r\n        }\r\n    }\r\n}\r\n\r\n\r\nmysql-js&gt; cluster.removeInstance(\"root@192.168.1.50:3306\")\r\nThe instance will be removed from the InnoDB cluster. Depending on the \r\ninstance being the Seed or not, the Metadata session might become invalid. \r\nIf so, please start a new session to the Metadata Storage R\/W instance.\r\n\r\nThe instance 'root@192.168.1.50:3306' was successfully removed from the cluster.\r\n\r\n\r\nmysql-js&gt; cluster.status()\r\n{\r\n    \"clusterName\": \"pocCluster\", \r\n    \"defaultReplicaSet\": {\r\n        \"name\": \"default\", \r\n        \"primary\": \"192.168.1.22:3306\", \r\n        \"status\": \"OK_NO_TOLERANCE\", \r\n        \"statusText\": \"Cluster is NOT tolerant to any failures.\", \r\n        \"topology\": {\r\n            \"192.168.1.22:3306\": {\r\n                \"address\": \"192.168.1.22:3306\", \r\n                \"mode\": \"R\/W\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"ONLINE\"\r\n            }, \r\n            \"192.168.1.48:3306\": {\r\n                \"address\": \"192.168.1.48:3306\", \r\n                \"mode\": \"R\/O\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"ONLINE\"\r\n            }\r\n        }\r\n    }\r\n}<\/pre>\n<p>L&rsquo;instance n&rsquo;est alors plus list\u00e9e dans les m\u00e9ta-donn\u00e9es :<\/p>\n<pre class=\"lang:mysql decode:true\">mysql-js&gt; \\sql\r\nSwitching to SQL mode... Commands end with ;\r\n\r\n\r\nmysql-sql&gt; SELECT instance_name FROM mysql_innodb_cluster_metadata.instances;\r\n+-------------------+\r\n| instance_name     |\r\n+-------------------+\r\n| 192.168.1.22:3306 |\r\n| 192.168.1.48:3306 |\r\n+-------------------+\r\n2 rows in set (0.00 sec)<\/pre>\n<p>Pour la remettre dans le groupe, il faut donc rejouer le processus de l&rsquo;ajout d&rsquo;instance vu plus haut :<\/p>\n<pre class=\"lang:mysql decode:true\">mysql-js&gt; cluster.checkInstanceState('root@192.168.1.50:3306')\r\nPlease provide the password for 'root@192.168.1.50:3306': \r\nAnalyzing the instance replication state...\r\n\r\nThe instance '192.168.1.50:3306' is valid for the cluster.\r\nThe instance is fully recoverable.\r\n\r\n{\r\n    \"reason\": \"recoverable\", \r\n    \"state\": \"ok\"\r\n}\r\n\r\n\r\nmysql-js&gt; cluster.addInstance(\"root@192.168.1.50:3306\", {ipWhitelist: \"192.168.1.0\/16\"})\r\nA new instance will be added to the InnoDB cluster. Depending on the amount of\r\ndata on the cluster this might take from a few seconds to several hours.\r\n\r\nPlease provide the password for 'root@192.168.1.50:3306': \r\nAdding instance to the cluster ...\r\n\r\nThe instance 'root@192.168.1.50:3306' was successfully added to the cluster.\r\n\r\n\r\nmysql-js&gt; cluster.status()\r\n{\r\n    \"clusterName\": \"pocCluster\", \r\n    \"defaultReplicaSet\": {\r\n        \"name\": \"default\", \r\n        \"primary\": \"192.168.1.22:3306\", \r\n        \"status\": \"OK\", \r\n        \"statusText\": \"Cluster is ONLINE and can tolerate up to ONE failure.\", \r\n        \"topology\": {\r\n            \"192.168.1.22:3306\": {\r\n                \"address\": \"192.168.1.22:3306\", \r\n                \"mode\": \"R\/W\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"ONLINE\"\r\n            }, \r\n            \"192.168.1.48:3306\": {\r\n                \"address\": \"192.168.1.48:3306\", \r\n                \"mode\": \"R\/O\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"ONLINE\"\r\n            }, \r\n            \"192.168.1.50:3306\": {\r\n                \"address\": \"192.168.1.50:3306\", \r\n                \"mode\": \"R\/O\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"ONLINE\"\r\n            }\r\n        }\r\n    }\r\n}<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3>Perte du quorum<\/h3>\n<p>Si le cluster perd plus de la moiti\u00e9 de ses membres il se retrouve dans un \u00e9tat assez d\u00e9sagr\u00e9able, <a href=\"https:\/\/dev.mysql.com\/doc\/refman\/5.7\/en\/group-replication-network-partitioning.html\" target=\"_blank\" rel=\"noopener noreferrer\">network partitioning<\/a>, en clair il faut une intervention externe au groupe pour permettre aux membres restant de continuer \u00e0 faire leur boulot de serveur MySQL.<\/p>\n<p>Dans notre cas, avec 3 instances, il faut en perdre\u00a02 d&rsquo;un coup :<\/p>\n<pre class=\"lang:mysql decode:true\">mysql-js&gt; cluster.status()\r\n{\r\n    \"clusterName\": \"pocCluster\", \r\n    \"defaultReplicaSet\": {\r\n        \"name\": \"default\", \r\n        \"primary\": \"192.168.1.22:3306\", \r\n        \"status\": \"OK\", \r\n        \"statusText\": \"Cluster is ONLINE and can tolerate up to ONE failure.\", \r\n        \"topology\": {\r\n            \"192.168.1.22:3306\": {\r\n                \"address\": \"192.168.1.22:3306\", \r\n                \"mode\": \"R\/W\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"ONLINE\"\r\n            }, \r\n            \"192.168.1.48:3306\": {\r\n                \"address\": \"192.168.1.48:3306\", \r\n                \"mode\": \"R\/O\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"ONLINE\"\r\n            }, \r\n            \"192.168.1.50:3306\": {\r\n                \"address\": \"192.168.1.50:3306\", \r\n                \"mode\": \"R\/O\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"ONLINE\"\r\n            }\r\n        }\r\n    }\r\n}<\/pre>\n<p>Perte des n\u0153uds (crash) 192.168.1.22 &amp;\u00a0192.168.1.50&#8230; \u00a0(Mayday, Mayday, Mayday!!!)<\/p>\n<pre class=\"lang:mysql decode:true\">mysql-js&gt; cluster.status()\r\n{\r\n    \"clusterName\": \"pocCluster\", \r\n    \"defaultReplicaSet\": {\r\n        \"name\": \"default\", \r\n        \"primary\": \"192.168.1.22:3306\", \r\n        \"status\": \"NO_QUORUM\", \r\n        \"statusText\": \"Cluster has no quorum as visible from 'localhost:3306' and cannot process write transactions. 2 members are not active\", \r\n        \"topology\": {\r\n            \"192.168.1.22:3306\": {\r\n                \"address\": \"192.168.1.22:3306\", \r\n                \"mode\": \"R\/W\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"UNREACHABLE\"\r\n            }, \r\n            \"192.168.1.48:3306\": {\r\n                \"address\": \"192.168.1.48:3306\", \r\n                \"mode\": \"R\/O\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"ONLINE\"\r\n            }, \r\n            \"192.168.1.50:3306\": {\r\n                \"address\": \"192.168.1.50:3306\", \r\n                \"mode\": \"R\/O\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"UNREACHABLE\"\r\n            }\r\n        }\r\n    }\r\n}<\/pre>\n<p>Le failover automatique ne peut pas s\u2019enclencher, le membre survivant (192.168.1.48) est en lecture seule. Il faut donc intervenir :<\/p>\n<pre class=\"lang:mysql decode:true\">$ mysqlsh --uri=root@192.168.1.48\r\nCreating a Session to 'root@192.168.1.48'\r\n...\r\n\r\nmysql-js&gt; var cluster = dba.getCluster(\"pocCluster\")\r\nWARNING: The session is on a Read Only instance.\r\n         Write operations on the InnoDB cluster will not be allowed\r\n\r\n\r\nmysql-js&gt; cluster.forceQuorumUsingPartitionOf('192.168.1.48:3306')\r\nRestoring replicaset 'default' from loss of quorum, by using the partition composed of [192.168.1.48:3306]\r\n\r\nPlease provide the password for 'root@192.168.1.48:3306': \r\nRestoring the InnoDB cluster ...\r\n\r\nThe InnoDB cluster was successfully restored using the partition from the instance 'root@192.168.1.48:3306'.\r\n\r\nWARNING: To avoid a split-brain scenario, ensure that all other members of the replicaset are removed or joined back to the group that was restored.\r\n\r\n\r\nmysql-js&gt; cluster.status()\r\n{\r\n    \"clusterName\": \"pocCluster\", \r\n    \"defaultReplicaSet\": {\r\n        \"name\": \"default\", \r\n        \"primary\": \"192.168.1.48:3306\", \r\n        \"status\": \"OK_NO_TOLERANCE\", \r\n        \"statusText\": \"Cluster is NOT tolerant to any failures. 2 members are not active\", \r\n        \"topology\": {\r\n            \"192.168.1.22:3306\": {\r\n                \"address\": \"192.168.1.22:3306\", \r\n                \"mode\": \"R\/O\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"(MISSING)\"\r\n            }, \r\n            \"192.168.1.48:3306\": {\r\n                \"address\": \"192.168.1.48:3306\", \r\n                \"mode\": \"R\/W\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"ONLINE\"\r\n            }, \r\n            \"192.168.1.50:3306\": {\r\n                \"address\": \"192.168.1.50:3306\", \r\n                \"mode\": \"R\/O\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"(MISSING)\"\r\n            }\r\n        }\r\n    }\r\n}<\/pre>\n<p>Evidemment, sauf si tu es joueur \ud83d\ude42 , il faut \u00e9viter de rester trop longtemps dans cet \u00e9tat.<\/p>\n<p>Une fois les instances en condition, il faut utiliser\u00a0<em><strong>rejoinInstance()<\/strong><\/em>\u00a0pour remettre les membres dans le cluster, en tant que secondaire (voir paragraphe <strong><span style=\"text-decoration: underline;\">Remettre un membre dans le groupe<\/span><\/strong>).<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3>Repartir apr\u00e8s un arr\u00eat total du cluster<\/h3>\n<p>La perte du quorum est une chose, mais il y a pire, perdre tout les n\u0153uds&#8230;<\/p>\n<p>En cas d&rsquo;arr\u00eat total du cluster i.e. toutes les instances\u00a0sont \u00e9teintes, il faut utiliser, une fois les instances MySQL de nouveau d\u00e9marr\u00e9es \u00a0<strong><em>rebootClusterFromCompleteOutage()<\/em><\/strong> :<\/p>\n<pre class=\"lang:mysql decode:true\">$ mysqlsh --uri=root@192.168.1.48\r\nCreating a Session to 'root@mysql_node1'\r\n...\r\n\r\nmysql-js&gt; var cluster = dba.rebootClusterFromCompleteOutage('pocCluster')\r\nReconfiguring the cluster 'pocCluster' from complete outage...\r\n\r\nThe instance '192.168.1.22:3306' was part of the cluster configuration.\r\nWould you like to rejoin it to the cluster? [y|N]: y\r\n\r\nThe instance '192.168.1.50:3306' was part of the cluster configuration.\r\nWould you like to rejoin it to the cluster? [y|N]: y\r\n\r\n\r\nThe cluster was successfully rebooted.\r\n\r\n\r\nmysql-js&gt; cluster.status()\r\n{\r\n    \"clusterName\": \"pocCluster\", \r\n    \"defaultReplicaSet\": {\r\n        \"name\": \"default\", \r\n        \"primary\": \"192.168.1.48:3306\", \r\n        \"status\": \"OK\", \r\n        \"statusText\": \"Cluster is ONLINE and can tolerate up to ONE failure.\", \r\n        \"topology\": {\r\n            \"192.168.1.22:3306\": {\r\n                \"address\": \"192.168.1.22:3306\", \r\n                \"mode\": \"R\/O\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"ONLINE\"\r\n            }, \r\n            \"192.168.1.48:3306\": {\r\n                \"address\": \"192.168.1.48:3306\", \r\n                \"mode\": \"R\/W\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"ONLINE\"\r\n            }, \r\n            \"192.168.1.50:3306\": {\r\n                \"address\": \"192.168.1.50:3306\", \r\n                \"mode\": \"R\/O\", \r\n                \"readReplicas\": {}, \r\n                \"role\": \"HA\", \r\n                \"status\": \"ONLINE\"\r\n            }\r\n        }\r\n    }\r\n}<\/pre>\n<p>Le membre sur lequel la commande est ex\u00e9cut\u00e9e est le nouveau primaire.<\/p>\n<p>&nbsp;<\/p>\n<p>Dans la m\u00eame th\u00e9matique :<\/p>\n<ul>\n<li><span style=\"color: #ff0000;\"><strong><a style=\"color: #ff0000;\" href=\"http:\/\/dasini.net\/blog\/2018\/08\/21\/tutoriel-deployer-mysql-5-7-innodb-cluster\/\">Tutoriel \u2013 D\u00e9ployer MySQL 5.7 InnoDB Cluster<\/a><\/strong><\/span><\/li>\n<li><a href=\"http:\/\/dasini.net\/blog\/2016\/11\/08\/deployer-un-cluster-mysql-group-replication\" target=\"_blank\" rel=\"noopener noreferrer\">D\u00e9ployer un cluster MySQL Group Replication<\/a><\/li>\n<li><a href=\"https:\/\/mysqlrelease.com\/2018\/03\/docker-compose-setup-for-innodb-cluster\/\" target=\"_blank\" rel=\"noopener\">D\u00e9ployer MySQL InnoDB Cluster avec Docker<\/a><\/li>\n<li><a href=\"http:\/\/dasini.net\/blog\/2017\/03\/03\/faq-webinar-mysql-group-replication\/\" target=\"_blank\" rel=\"noopener noreferrer\">FAQ Webinar MySQL Group Replication<\/a><\/li>\n<li><a href=\"http:\/\/dasini.net\/blog\/2017\/03\/13\/tester-mysql-innodb-cluster\/\" target=\"_blank\" rel=\"noopener noreferrer\">Tester MySQL InnoDB Cluster<\/a><\/li>\n<li><a href=\"http:\/\/dasini.net\/blog\/2017\/01\/11\/configurer-proxysql-pour-mysql-group-replication\/\" target=\"_blank\" rel=\"noopener noreferrer\">Configurer ProxySQL pour MySQL Group Replication<\/a><\/li>\n<li><a href=\"https:\/\/dev.mysql.com\/doc\/refman\/5.7\/en\/group-replication.html\" target=\"_blank\" rel=\"noopener noreferrer\">Doc &#8211; MySQL Group Replication<\/a><\/li>\n<li><a href=\"https:\/\/dev.mysql.com\/doc\/refman\/5.7\/en\/mysql-innodb-cluster-userguide.html\" target=\"_blank\" rel=\"noopener noreferrer\">Doc &#8211; MySQL InnoDB Cluster<\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>Thanks for using MySQL!<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Dans les \u00e9pisodes pr\u00e9c\u00e9dents on a vu comment  d\u00e9ployer \u00ab\u00a0manuellement\u00a0\u00bb MySQL Group Replication,  comprendre et tester MySQL InnoDB Cluster  ainsi que comment  g\u00e9rer ais\u00e9ment un cluster Group Replication d\u00e9ja d\u00e9ploy\u00e9 avec MySQL Shell.<\/p>\n<p>Aujourd&rsquo;hui, dans la s\u00e9rie Haute Disponibilit\u00e9 avec MySQL on va voir comment d\u00e9ployer et g\u00e9rer un cluster from scratch , sous la forme d&rsquo;un tutoriel, gr\u00e2ce \u00e0 la solution tout en un : MySQL InnoDB Cluster.<\/p>\n<p>Note:<br \/>\nL&rsquo;article traite de MySQL InnoDB Cluster, HA natif de MySQL Server avec pour moteur de stockage InnoDB, solution \u00e0 ne pas confondre avec MySQL NDB Cluster (moteur de stockage NDB).<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"footnotes":""},"categories":[282,316,288,8,337],"tags":[286,79,24,298,302,318,341],"class_list":["post-1915","post","type-post","status-publish","format-standard","hentry","category-group-replication","category-haute-disponibilite","category-innodb-cluster","category-mysql","category-tuto","tag-group-replication","tag-haute-disponibilite","tag-innodb","tag-innodb-cluster","tag-router","tag-shell","tag-tuto"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9LfWW-uT","jetpack-related-posts":[{"id":3291,"url":"https:\/\/dasini.net\/blog\/2019\/07\/16\/deployer-1-cluster-mysql-avec-2-commandes\/","url_meta":{"origin":1915,"position":0},"title":"D\u00e9ployer 1 cluster MySQL avec 2 commandes","author":"Olivier DASINI","date":"16 juillet 2019","format":false,"excerpt":"Dans cette courte vid\u00e9o, je vais te montrer comment cr\u00e9er un cluster MySQL de 3 n\u0153uds avec simplement 2 commandes. https:\/\/www.youtube.com\/watch?v=YZzGsDjlWvk","rel":"","context":"Dans &quot;Group Replication&quot;","block_context":{"text":"Group Replication","link":"https:\/\/dasini.net\/blog\/category\/group-replication\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/img.youtube.com\/vi\/YZzGsDjlWvk\/0.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1855,"url":"https:\/\/dasini.net\/blog\/2017\/04\/10\/adopte-un-cluster-mysql-group-replication\/","url_meta":{"origin":1915,"position":1},"title":"Adopte un&#8230; cluster MySQL Group Replication","author":"Olivier DASINI","date":"10 avril 2017","format":false,"excerpt":"Au menu d'aujourd'hui : comment passer de l'administration \"manuelle\" de votre solution HA MySQL Group Replication \u00e0 une administration plus simple, plus fun mais surtout facilement automatisable avec le pack MySQL InnoDB Cluster. En clair, on va voir comment utiliser MySQL Shell pour l'administration et l'orchestration du cluster et MySQL\u2026","rel":"","context":"Dans &quot;Group Replication&quot;","block_context":{"text":"Group Replication","link":"https:\/\/dasini.net\/blog\/category\/group-replication\/"},"img":{"alt_text":"MySQL InnoDB Cluster Overview","src":"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/MySQL_InnoDB_cluster_overview.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1832,"url":"https:\/\/dasini.net\/blog\/2017\/03\/13\/tester-mysql-innodb-cluster\/","url_meta":{"origin":1915,"position":2},"title":"Tester MySQL InnoDB Cluster","author":"Olivier DASINI","date":"13 mars 2017","format":false,"excerpt":"MySQL InnoDB Cluster est la (future) solution out-of-the-box HA de MySQL (\u00e0 ne pas confondre avec MySQL NDB Cluster). Ce produit est compos\u00e9 de 3 \u00e9l\u00e9ments : MySQL Group Replication Plugin de r\u00e9plication multi-ma\u00eetre, avec r\u00e9solution de conflits et basculement (failover) automatique. MySQL Router Middleware l\u00e9ger et performant qui fournit\u2026","rel":"","context":"Dans &quot;Group Replication&quot;","block_context":{"text":"Group Replication","link":"https:\/\/dasini.net\/blog\/category\/group-replication\/"},"img":{"alt_text":"MySQL InnoDB Cluster Architecture","src":"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/MySQL_InnoDB_Cluster_Architecture.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1800,"url":"https:\/\/dasini.net\/blog\/2017\/03\/03\/faq-webinar-mysql-group-replication\/","url_meta":{"origin":1915,"position":3},"title":"FAQ Webinar MySQL Group Replication","author":"Olivier DASINI","date":"3 mars 2017","format":false,"excerpt":"Le 1er mars dernier, j'ai pr\u00e9sent\u00e9 lors d'un webinar, la technologie de haute disponibilit\u00e9 MySQL Group Replication. On a explos\u00e9 notre record d'affluence et j'ai \u00e9t\u00e9 inond\u00e9 de questions, preuve s'il en faut de votre int\u00e9r\u00eat, toujours plus important, pour la base de donn\u00e9es Open Source la plus populaire au\u2026","rel":"","context":"Dans &quot;Group Replication&quot;","block_context":{"text":"Group Replication","link":"https:\/\/dasini.net\/blog\/category\/group-replication\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1654,"url":"https:\/\/dasini.net\/blog\/2016\/10\/05\/mysql-a-oracle-openworld-2016\/","url_meta":{"origin":1915,"position":4},"title":"MySQL \u00e0 Oracle OpenWorld 2016","author":"Olivier DASINI","date":"5 octobre 2016","format":false,"excerpt":"R\u00e9sum\u00e9 des annonces MySQL \u00e0 Oracle OpenWorld: MySQL dans le cloud, MySQL Group Replication, MySQL InnoDB Cluster, MySQL 8,...","rel":"","context":"Dans &quot;Group Replication&quot;","block_context":{"text":"Group Replication","link":"https:\/\/dasini.net\/blog\/category\/group-replication\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/Oracle_MySQL_Cloud_Service.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":4381,"url":"https:\/\/dasini.net\/blog\/2021\/02\/24\/webinar-la-haute-disponibilite-avec-mysql\/","url_meta":{"origin":1915,"position":5},"title":"Webinar \u2013  La haute disponibilit\u00e9 avec MySQL","author":"Olivier DASINI","date":"24 f\u00e9vrier 2021","format":false,"excerpt":"MySQL propose plusieurs solutions pour vous aider \u00e0 b\u00e2tir une architecture hautement disponible. On retrouve InnoDB Cluster avec Group Replication, la r\u00e9plication asynchrone en utilisant InnoDB ReplicaSet ou encore la r\u00e9plication semi-synchrone, et enfin NDB Cluster. Dans cette session, nous examinerons ces diff\u00e9rents sc\u00e9narios, les \u00e9cueils \u00e0 \u00e9viter et les\u2026","rel":"","context":"Dans &quot;MySQL&quot;","block_context":{"text":"MySQL","link":"https:\/\/dasini.net\/blog\/category\/mysql\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/dasini.net\/blog\/wp-json\/wp\/v2\/posts\/1915","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dasini.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dasini.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dasini.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/dasini.net\/blog\/wp-json\/wp\/v2\/comments?post=1915"}],"version-history":[{"count":26,"href":"https:\/\/dasini.net\/blog\/wp-json\/wp\/v2\/posts\/1915\/revisions"}],"predecessor-version":[{"id":2626,"href":"https:\/\/dasini.net\/blog\/wp-json\/wp\/v2\/posts\/1915\/revisions\/2626"}],"wp:attachment":[{"href":"https:\/\/dasini.net\/blog\/wp-json\/wp\/v2\/media?parent=1915"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dasini.net\/blog\/wp-json\/wp\/v2\/categories?post=1915"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dasini.net\/blog\/wp-json\/wp\/v2\/tags?post=1915"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}