SlideShare a Scribd company logo
Frédéric Descamps
Community Manager
MySQL
February 2021
MySQL Router
REST API
Who am I ?
about.me/lefred
Copyright @ 2021 Oracle and/or its affiliates.
2
Frédéric Descamps
@lefred
MySQL Evangelist
Managing MySQL since 3.20
devops believer
living in Belgium
h ps://lefred.be
Copyright @ 2021 Oracle and/or its affiliates.
3
What is it ?
MySQL Router
Copyright @ 2021 Oracle and/or its affiliates.
4
MySQL Router
MySQL Router is a building block for high availability (HA) solutions. It simpli es application
development by intelligently routing connections to MySQL servers for increased
performance and reliability.
MySQL Router is part of MySQL InnoDB Cluster and MySQL InnoDB ReplicaSet.
MySQL Router is wri ent in C++ and is part of MySQL's trunk.
Copyright @ 2021 Oracle and/or its affiliates.
5
MySQL Router
REST API
Copyright @ 2021 Oracle and/or its affiliates.
6
MySQL Router REST API - Why ?
When a problem occurs, it's not always obvious to understand why ? For example if for a
given route, the amount of max_connections is reached, it's important to know it and to
know that value before we reach it.
MySQL Router exposes data (statistics, se ings, ..,) as REST endpoints via HTTP methods
as JSON payload.
This is explained in WL#8965.
Copyright @ 2021 Oracle and/or its affiliates.
7
MySQL Router REST API - How ?
Since MySQL 8.0.16, MySQL Router has the possibility to launch an internal h p server. At
that time it could only serve static les.
Then, in MySQL 8.0.17 we added the REST API to MySQL Router.
With MySQL 8.0.20 the authentication credentials to access the REST API could also be
stored on MySQL in a metadata table, before it was only using a le. See WL#12952.
And nally with MySQL 8.0.22, bootstrapping a MySQL Router also con gures the REST
API functionality into the generated mysqlrouter.conf con guration le.
Copyright @ 2021 Oracle and/or its affiliates.
8
Test it and get the paths
To query swagger.json no authentication is required:
Copyright @ 2021 Oracle and/or its affiliates.
9
MySQL Router REST API - Authentication
MySQL Router uses realms for authentication. The backend can be a le or a record in a
metadata table:
[http_auth_backend:default_auth_backend]
backend=metadata_cache
If you use a le, the mysqlrouter_passwd command-line utility must be used to generate
and manage the users.
Copyright @ 2021 Oracle and/or its affiliates.
10
MySQL Router REST API - Authentication (metadata)
So there is a table in the metadata that we can use to connect to the REST API. Let's have a
look...
Copyright @ 2021 Oracle and/or its affiliates.
11
MySQL Router REST API - Authentication (metadata)
So there is a table in the metadata that we can use to connect to the REST API. Let's have a
look...
Copyright @ 2021 Oracle and/or its affiliates.
11
MySQL Router REST API - Authentication (metadata)
So there is a table in the metadata that we can use to connect to the REST API. Let's have a
look...
So when we bootstrap a Router against a MySQL InnoDB Cluster or a MySQL InnoDB
ReplicaSet, we need to add a user in this table.
Copyright @ 2021 Oracle and/or its affiliates.
11
My journey to add a user in router_rest_accounts
Let me share with you my journey to insert a user into that table...
Copyright @ 2021 Oracle and/or its affiliates.
12
My journey to add a user in router_rest_accounts
Let me share with you my journey to insert a user into that table...
Copyright @ 2021 Oracle and/or its affiliates.
12
Adding a user in router_rest_accounts - A empt #1
Let's try:
INSERT INTO router_rest_accounts VALUES (
(SELECT cluster_id FROM mysql_innodb_cluster_metadata.v2_clusters LIMIT 1),
"lefred", "modular_crypt_format", "fosdem", NULL, NULL, NULL);
Copyright @ 2021 Oracle and/or its affiliates.
13
Adding a user in router_rest_accounts - A empt #1
Let's try:
INSERT INTO router_rest_accounts VALUES (
(SELECT cluster_id FROM mysql_innodb_cluster_metadata.v2_clusters LIMIT 1),
"lefred", "modular_crypt_format", "fosdem", NULL, NULL, NULL);
Copyright @ 2021 Oracle and/or its affiliates.
13
Adding a user in router_rest_accounts - A empt #1
Let's try:
INSERT INTO router_rest_accounts VALUES (
(SELECT cluster_id FROM mysql_innodb_cluster_metadata.v2_clusters LIMIT 1),
"lefred", "modular_crypt_format", "fosdem", NULL, NULL, NULL);
Copyright @ 2021 Oracle and/or its affiliates.
13
lefred - security : 0 - 1
Copyright @ 2021 Oracle and/or its affiliates.
14
Adding a user in router_rest_accounts - A empt #2
For my second a empt, I asked to the router dev team for an example of string I could use.
The reply was simple 'copy' the value of your authentication_string column in the
mysql.user:
Copyright @ 2021 Oracle and/or its affiliates.
15
Adding a user in router_rest_accounts - A empt #2
For my second a empt, I asked to the router dev team for an example of string I could use.
The reply was simple 'copy' the value of your authentication_string column in the
mysql.user:
REPLACE INTO router_rest_accounts VALUES (
(SELECT cluster_id FROM mysql_innodb_cluster_metadata.v2_clusters LIMIT 1),
"lefred", "modular_crypt_format",
(SELECT authentication_string FROM mysql.user WHERE user='clusteradmin'),
NULL, NULL, NULL);
Copyright @ 2021 Oracle and/or its affiliates.
15
Adding a user in router_rest_accounts - A empt #2
Let's test it:
Copyright @ 2021 Oracle and/or its affiliates.
16
Adding a user in router_rest_accounts - A empt #2
Let's test it:
It works... but I don't want to use a MySQL user to monitor Router !
Copyright @ 2021 Oracle and/or its affiliates.
16
Adding a user in router_rest_accounts - A empt #2
Let's test it:
It works... but I don't want to use a MySQL user to monitor Router !
It's important to provide accurate information and context when you ask something...
Copyright @ 2021 Oracle and/or its affiliates.
16
lefred - developer : 0 - 1
Copyright @ 2021 Oracle and/or its affiliates.
17
Adding a user in router_rest_accounts - A empt #3
My goal was to manage the credential for the REST API using a MySQL Shell Plugin...
I've been said that I should use the same string as a MySQL user... let's generate it !
Copyright @ 2021 Oracle and/or its affiliates.
18
Adding a user in router_rest_accounts - A empt #3
My goal was to manage the credential for the REST API using a MySQL Shell Plugin...
I've been said that I should use the same string as a MySQL user... let's generate it !
I created a program that does it:
Copyright @ 2021 Oracle and/or its affiliates.
18
Adding a user in router_rest_accounts - A empt #3
My goal was to manage the credential for the REST API using a MySQL Shell Plugin...
I've been said that I should use the same string as a MySQL user... let's generate it !
I created a program that does it:
REPLACE INTO router_rest_accounts VALUES (
(SELECT cluster_id FROM mysql_innodb_cluster_metadata.v2_clusters LIMIT 1),
"lefred", "modular_crypt_format",
'$A$005$zwM4!A72%s)](-ed8FN-euE7cwRygTogySEBOTQY46UbIU483McwXJYiovTbML2',
NULL, NULL, NULL);
Copyright @ 2021 Oracle and/or its affiliates.
18
Adding a user in router_rest_accounts - A empt #3
Let's test it:
Copyright @ 2021 Oracle and/or its affiliates.
19
Adding a user in router_rest_accounts - A empt #3
Let's test it:
It works... but I don't want to use an external program in my plugin, that's not very portable.
Copyright @ 2021 Oracle and/or its affiliates.
19
lefred - usability : 0 - 1
Copyright @ 2021 Oracle and/or its affiliates.
20
Adding a user in router_rest_accounts - A empt #4
Mmm... let's try something else...
Copyright @ 2021 Oracle and/or its affiliates.
21
Adding a user in router_rest_accounts - A empt #4
Mmm... let's try something else...
A component !
Copyright @ 2021 Oracle and/or its affiliates.
21
Adding a user in router_rest_accounts - A empt #4
Mmm... let's try something else...
A component !
Copyright @ 2021 Oracle and/or its affiliates.
21
Adding a user in router_rest_accounts - A empt #4
Mmm... let's try something else...
A component !
REPLACE INTO router_rest_accounts VALUES (
(SELECT cluster_id FROM mysql_innodb_cluster_metadata.v2_clusters LIMIT 1),
"lefred", "modular_crypt_format",
"$A$005$op^'U#+}b)!n*~~3E<{+Pzrzs/Rg9jUO.b4iMY56vET9E3rt2bws/BVw43zpTW8",
NULL, NULL, NULL);
Copyright @ 2021 Oracle and/or its affiliates.
21
Adding a user in router_rest_accounts - A empt #4
Let's test it again:
Copyright @ 2021 Oracle and/or its affiliates.
22
Adding a user in router_rest_accounts - A empt #4
Let's test it again:
It works... but again, another component needs to be installed and maintained...
Copyright @ 2021 Oracle and/or its affiliates.
22
lefred - usability : 0 - 2
Copyright @ 2021 Oracle and/or its affiliates.
23
Adding a user in router_rest_accounts - A empt #5
What else ?
Copyright @ 2021 Oracle and/or its affiliates.
24
Adding a user in router_rest_accounts - A empt #5
What else ?
Let me ask again with more context to the MySQL Router Development Team...
Copyright @ 2021 Oracle and/or its affiliates.
24
Adding a user in router_rest_accounts - A empt #5
What else ?
Let me ask again with more context to the MySQL Router Development Team...
Summary of the answer: we do support MySQL 8.0's default authentication string but also
modular_crypt_format for MCF style password hashes as speci ed in the WL...
Copyright @ 2021 Oracle and/or its affiliates.
24
Adding a user in router_rest_accounts - A empt #5
What else ?
Let me ask again with more context to the MySQL Router Development Team...
Summary of the answer: we do support MySQL 8.0's default authentication string but also
modular_crypt_format for MCF style password hashes as speci ed in the WL...
Oups...
Copyright @ 2021 Oracle and/or its affiliates.
24
Adding a user in router_rest_accounts - A empt #5
What else ?
Let me ask again with more context to the MySQL Router Development Team...
Summary of the answer: we do support MySQL 8.0's default authentication string but also
modular_crypt_format for MCF style password hashes as speci ed in the WL...
Oups...
This means that the standard Python crypt module is what I need !
Copyright @ 2021 Oracle and/or its affiliates.
24
lefred - developer : 0 - 2
Copyright @ 2021 Oracle and/or its affiliates.
25
Adding a user in router_rest_accounts - A empt #5
REPLACE INTO router_rest_accounts VALUES (
(SELECT cluster_id FROM mysql_innodb_cluster_metadata.v2_clusters LIMIT 1),
"lefred", "modular_crypt_format",
"$5$tzRKNfEyehq1B5/Q$/PlKjs6PCEjNFiSDtdVZV2aL666SZrvKvrMWfYkIO82",
NULL, NULL, NULL);
Copyright @ 2021 Oracle and/or its affiliates.
26
Adding a user in router_rest_accounts - A empt #5
REPLACE INTO router_rest_accounts VALUES (
(SELECT cluster_id FROM mysql_innodb_cluster_metadata.v2_clusters LIMIT 1),
"lefred", "modular_crypt_format",
"$5$tzRKNfEyehq1B5/Q$/PlKjs6PCEjNFiSDtdVZV2aL666SZrvKvrMWfYkIO82",
NULL, NULL, NULL);
Copyright @ 2021 Oracle and/or its affiliates.
26
Wooohooo o/
Copyright @ 2021 Oracle and/or its affiliates.
27
Examples
MySQL Router REST API
Copyright @ 2021 Oracle and/or its affiliates.
28
Some examples
We can now use the REST API with curl and include that in any montiroring tool like Sensu,
Icinga...
Copyright @ 2021 Oracle and/or its affiliates.
29
MySQL Router & MySQL Shell
With MySQL Shell's router plugin (h ps://github.com/lefred/mysqlshell-plugins), you can
take bene t of all this.
Copyright @ 2021 Oracle and/or its affiliates.
30
MySQL Router & MySQL Shell
With MySQL Shell's router plugin (h ps://github.com/lefred/mysqlshell-plugins), you can
take bene t of all this.
Creating a user for the REST API:
Copyright @ 2021 Oracle and/or its affiliates.
30
MySQL Router & MySQL Shell
With MySQL Shell's router plugin (h ps://github.com/lefred/mysqlshell-plugins), you can
take bene t of all this.
Creating a user for the REST API:
Much easier ;) Convenient++
Copyright @ 2021 Oracle and/or its affiliates.
30
MySQL Router & MySQL Shell
Creating the Router object:
Copyright @ 2021 Oracle and/or its affiliates.
31
MySQL Router & MySQL Shell
Copyright @ 2021 Oracle and/or its affiliates.
32
MySQL Router & MySQL Shell
We have an host blocked by MySQL Router, which one is it ?
Copyright @ 2021 Oracle and/or its affiliates.
33
MySQL Router & MySQL Shell
We have an host blocked by MySQL Router, which one is it ?
Copyright @ 2021 Oracle and/or its affiliates.
33
MySQL Router & MySQL Shell
And nally the routing statistics:
Copyright @ 2021 Oracle and/or its affiliates.
34
Questions ?
Copyright @ 2021 Oracle and/or its affiliates.
35

More Related Content

MySQL Router REST API

  • 2. Who am I ? about.me/lefred Copyright @ 2021 Oracle and/or its affiliates. 2
  • 3. Frédéric Descamps @lefred MySQL Evangelist Managing MySQL since 3.20 devops believer living in Belgium h ps://lefred.be Copyright @ 2021 Oracle and/or its affiliates. 3
  • 4. What is it ? MySQL Router Copyright @ 2021 Oracle and/or its affiliates. 4
  • 5. MySQL Router MySQL Router is a building block for high availability (HA) solutions. It simpli es application development by intelligently routing connections to MySQL servers for increased performance and reliability. MySQL Router is part of MySQL InnoDB Cluster and MySQL InnoDB ReplicaSet. MySQL Router is wri ent in C++ and is part of MySQL's trunk. Copyright @ 2021 Oracle and/or its affiliates. 5
  • 6. MySQL Router REST API Copyright @ 2021 Oracle and/or its affiliates. 6
  • 7. MySQL Router REST API - Why ? When a problem occurs, it's not always obvious to understand why ? For example if for a given route, the amount of max_connections is reached, it's important to know it and to know that value before we reach it. MySQL Router exposes data (statistics, se ings, ..,) as REST endpoints via HTTP methods as JSON payload. This is explained in WL#8965. Copyright @ 2021 Oracle and/or its affiliates. 7
  • 8. MySQL Router REST API - How ? Since MySQL 8.0.16, MySQL Router has the possibility to launch an internal h p server. At that time it could only serve static les. Then, in MySQL 8.0.17 we added the REST API to MySQL Router. With MySQL 8.0.20 the authentication credentials to access the REST API could also be stored on MySQL in a metadata table, before it was only using a le. See WL#12952. And nally with MySQL 8.0.22, bootstrapping a MySQL Router also con gures the REST API functionality into the generated mysqlrouter.conf con guration le. Copyright @ 2021 Oracle and/or its affiliates. 8
  • 9. Test it and get the paths To query swagger.json no authentication is required: Copyright @ 2021 Oracle and/or its affiliates. 9
  • 10. MySQL Router REST API - Authentication MySQL Router uses realms for authentication. The backend can be a le or a record in a metadata table: [http_auth_backend:default_auth_backend] backend=metadata_cache If you use a le, the mysqlrouter_passwd command-line utility must be used to generate and manage the users. Copyright @ 2021 Oracle and/or its affiliates. 10
  • 11. MySQL Router REST API - Authentication (metadata) So there is a table in the metadata that we can use to connect to the REST API. Let's have a look... Copyright @ 2021 Oracle and/or its affiliates. 11
  • 12. MySQL Router REST API - Authentication (metadata) So there is a table in the metadata that we can use to connect to the REST API. Let's have a look... Copyright @ 2021 Oracle and/or its affiliates. 11
  • 13. MySQL Router REST API - Authentication (metadata) So there is a table in the metadata that we can use to connect to the REST API. Let's have a look... So when we bootstrap a Router against a MySQL InnoDB Cluster or a MySQL InnoDB ReplicaSet, we need to add a user in this table. Copyright @ 2021 Oracle and/or its affiliates. 11
  • 14. My journey to add a user in router_rest_accounts Let me share with you my journey to insert a user into that table... Copyright @ 2021 Oracle and/or its affiliates. 12
  • 15. My journey to add a user in router_rest_accounts Let me share with you my journey to insert a user into that table... Copyright @ 2021 Oracle and/or its affiliates. 12
  • 16. Adding a user in router_rest_accounts - A empt #1 Let's try: INSERT INTO router_rest_accounts VALUES ( (SELECT cluster_id FROM mysql_innodb_cluster_metadata.v2_clusters LIMIT 1), "lefred", "modular_crypt_format", "fosdem", NULL, NULL, NULL); Copyright @ 2021 Oracle and/or its affiliates. 13
  • 17. Adding a user in router_rest_accounts - A empt #1 Let's try: INSERT INTO router_rest_accounts VALUES ( (SELECT cluster_id FROM mysql_innodb_cluster_metadata.v2_clusters LIMIT 1), "lefred", "modular_crypt_format", "fosdem", NULL, NULL, NULL); Copyright @ 2021 Oracle and/or its affiliates. 13
  • 18. Adding a user in router_rest_accounts - A empt #1 Let's try: INSERT INTO router_rest_accounts VALUES ( (SELECT cluster_id FROM mysql_innodb_cluster_metadata.v2_clusters LIMIT 1), "lefred", "modular_crypt_format", "fosdem", NULL, NULL, NULL); Copyright @ 2021 Oracle and/or its affiliates. 13
  • 19. lefred - security : 0 - 1 Copyright @ 2021 Oracle and/or its affiliates. 14
  • 20. Adding a user in router_rest_accounts - A empt #2 For my second a empt, I asked to the router dev team for an example of string I could use. The reply was simple 'copy' the value of your authentication_string column in the mysql.user: Copyright @ 2021 Oracle and/or its affiliates. 15
  • 21. Adding a user in router_rest_accounts - A empt #2 For my second a empt, I asked to the router dev team for an example of string I could use. The reply was simple 'copy' the value of your authentication_string column in the mysql.user: REPLACE INTO router_rest_accounts VALUES ( (SELECT cluster_id FROM mysql_innodb_cluster_metadata.v2_clusters LIMIT 1), "lefred", "modular_crypt_format", (SELECT authentication_string FROM mysql.user WHERE user='clusteradmin'), NULL, NULL, NULL); Copyright @ 2021 Oracle and/or its affiliates. 15
  • 22. Adding a user in router_rest_accounts - A empt #2 Let's test it: Copyright @ 2021 Oracle and/or its affiliates. 16
  • 23. Adding a user in router_rest_accounts - A empt #2 Let's test it: It works... but I don't want to use a MySQL user to monitor Router ! Copyright @ 2021 Oracle and/or its affiliates. 16
  • 24. Adding a user in router_rest_accounts - A empt #2 Let's test it: It works... but I don't want to use a MySQL user to monitor Router ! It's important to provide accurate information and context when you ask something... Copyright @ 2021 Oracle and/or its affiliates. 16
  • 25. lefred - developer : 0 - 1 Copyright @ 2021 Oracle and/or its affiliates. 17
  • 26. Adding a user in router_rest_accounts - A empt #3 My goal was to manage the credential for the REST API using a MySQL Shell Plugin... I've been said that I should use the same string as a MySQL user... let's generate it ! Copyright @ 2021 Oracle and/or its affiliates. 18
  • 27. Adding a user in router_rest_accounts - A empt #3 My goal was to manage the credential for the REST API using a MySQL Shell Plugin... I've been said that I should use the same string as a MySQL user... let's generate it ! I created a program that does it: Copyright @ 2021 Oracle and/or its affiliates. 18
  • 28. Adding a user in router_rest_accounts - A empt #3 My goal was to manage the credential for the REST API using a MySQL Shell Plugin... I've been said that I should use the same string as a MySQL user... let's generate it ! I created a program that does it: REPLACE INTO router_rest_accounts VALUES ( (SELECT cluster_id FROM mysql_innodb_cluster_metadata.v2_clusters LIMIT 1), "lefred", "modular_crypt_format", '$A$005$zwM4!A72%s)](-ed8FN-euE7cwRygTogySEBOTQY46UbIU483McwXJYiovTbML2', NULL, NULL, NULL); Copyright @ 2021 Oracle and/or its affiliates. 18
  • 29. Adding a user in router_rest_accounts - A empt #3 Let's test it: Copyright @ 2021 Oracle and/or its affiliates. 19
  • 30. Adding a user in router_rest_accounts - A empt #3 Let's test it: It works... but I don't want to use an external program in my plugin, that's not very portable. Copyright @ 2021 Oracle and/or its affiliates. 19
  • 31. lefred - usability : 0 - 1 Copyright @ 2021 Oracle and/or its affiliates. 20
  • 32. Adding a user in router_rest_accounts - A empt #4 Mmm... let's try something else... Copyright @ 2021 Oracle and/or its affiliates. 21
  • 33. Adding a user in router_rest_accounts - A empt #4 Mmm... let's try something else... A component ! Copyright @ 2021 Oracle and/or its affiliates. 21
  • 34. Adding a user in router_rest_accounts - A empt #4 Mmm... let's try something else... A component ! Copyright @ 2021 Oracle and/or its affiliates. 21
  • 35. Adding a user in router_rest_accounts - A empt #4 Mmm... let's try something else... A component ! REPLACE INTO router_rest_accounts VALUES ( (SELECT cluster_id FROM mysql_innodb_cluster_metadata.v2_clusters LIMIT 1), "lefred", "modular_crypt_format", "$A$005$op^'U#+}b)!n*~~3E<{+Pzrzs/Rg9jUO.b4iMY56vET9E3rt2bws/BVw43zpTW8", NULL, NULL, NULL); Copyright @ 2021 Oracle and/or its affiliates. 21
  • 36. Adding a user in router_rest_accounts - A empt #4 Let's test it again: Copyright @ 2021 Oracle and/or its affiliates. 22
  • 37. Adding a user in router_rest_accounts - A empt #4 Let's test it again: It works... but again, another component needs to be installed and maintained... Copyright @ 2021 Oracle and/or its affiliates. 22
  • 38. lefred - usability : 0 - 2 Copyright @ 2021 Oracle and/or its affiliates. 23
  • 39. Adding a user in router_rest_accounts - A empt #5 What else ? Copyright @ 2021 Oracle and/or its affiliates. 24
  • 40. Adding a user in router_rest_accounts - A empt #5 What else ? Let me ask again with more context to the MySQL Router Development Team... Copyright @ 2021 Oracle and/or its affiliates. 24
  • 41. Adding a user in router_rest_accounts - A empt #5 What else ? Let me ask again with more context to the MySQL Router Development Team... Summary of the answer: we do support MySQL 8.0's default authentication string but also modular_crypt_format for MCF style password hashes as speci ed in the WL... Copyright @ 2021 Oracle and/or its affiliates. 24
  • 42. Adding a user in router_rest_accounts - A empt #5 What else ? Let me ask again with more context to the MySQL Router Development Team... Summary of the answer: we do support MySQL 8.0's default authentication string but also modular_crypt_format for MCF style password hashes as speci ed in the WL... Oups... Copyright @ 2021 Oracle and/or its affiliates. 24
  • 43. Adding a user in router_rest_accounts - A empt #5 What else ? Let me ask again with more context to the MySQL Router Development Team... Summary of the answer: we do support MySQL 8.0's default authentication string but also modular_crypt_format for MCF style password hashes as speci ed in the WL... Oups... This means that the standard Python crypt module is what I need ! Copyright @ 2021 Oracle and/or its affiliates. 24
  • 44. lefred - developer : 0 - 2 Copyright @ 2021 Oracle and/or its affiliates. 25
  • 45. Adding a user in router_rest_accounts - A empt #5 REPLACE INTO router_rest_accounts VALUES ( (SELECT cluster_id FROM mysql_innodb_cluster_metadata.v2_clusters LIMIT 1), "lefred", "modular_crypt_format", "$5$tzRKNfEyehq1B5/Q$/PlKjs6PCEjNFiSDtdVZV2aL666SZrvKvrMWfYkIO82", NULL, NULL, NULL); Copyright @ 2021 Oracle and/or its affiliates. 26
  • 46. Adding a user in router_rest_accounts - A empt #5 REPLACE INTO router_rest_accounts VALUES ( (SELECT cluster_id FROM mysql_innodb_cluster_metadata.v2_clusters LIMIT 1), "lefred", "modular_crypt_format", "$5$tzRKNfEyehq1B5/Q$/PlKjs6PCEjNFiSDtdVZV2aL666SZrvKvrMWfYkIO82", NULL, NULL, NULL); Copyright @ 2021 Oracle and/or its affiliates. 26
  • 47. Wooohooo o/ Copyright @ 2021 Oracle and/or its affiliates. 27
  • 48. Examples MySQL Router REST API Copyright @ 2021 Oracle and/or its affiliates. 28
  • 49. Some examples We can now use the REST API with curl and include that in any montiroring tool like Sensu, Icinga... Copyright @ 2021 Oracle and/or its affiliates. 29
  • 50. MySQL Router & MySQL Shell With MySQL Shell's router plugin (h ps://github.com/lefred/mysqlshell-plugins), you can take bene t of all this. Copyright @ 2021 Oracle and/or its affiliates. 30
  • 51. MySQL Router & MySQL Shell With MySQL Shell's router plugin (h ps://github.com/lefred/mysqlshell-plugins), you can take bene t of all this. Creating a user for the REST API: Copyright @ 2021 Oracle and/or its affiliates. 30
  • 52. MySQL Router & MySQL Shell With MySQL Shell's router plugin (h ps://github.com/lefred/mysqlshell-plugins), you can take bene t of all this. Creating a user for the REST API: Much easier ;) Convenient++ Copyright @ 2021 Oracle and/or its affiliates. 30
  • 53. MySQL Router & MySQL Shell Creating the Router object: Copyright @ 2021 Oracle and/or its affiliates. 31
  • 54. MySQL Router & MySQL Shell Copyright @ 2021 Oracle and/or its affiliates. 32
  • 55. MySQL Router & MySQL Shell We have an host blocked by MySQL Router, which one is it ? Copyright @ 2021 Oracle and/or its affiliates. 33
  • 56. MySQL Router & MySQL Shell We have an host blocked by MySQL Router, which one is it ? Copyright @ 2021 Oracle and/or its affiliates. 33
  • 57. MySQL Router & MySQL Shell And nally the routing statistics: Copyright @ 2021 Oracle and/or its affiliates. 34
  • 58. Questions ? Copyright @ 2021 Oracle and/or its affiliates. 35