 Good afternoon, everyone. I'm Balasudra Mania, and I work as a senior software development manager in MySQL Release Engineering team. And the presentation for today is we're going to see the Docker Compose setup for MySQL NODB cluster. Safe hardware statement. And the agenda for today is we are going to see what MySQL NODB cluster is. We're going to see the architecture, the different components that are involved in MySQL NODB cluster, the vision that we call for MySQL NODB cluster. So in that, we're going to see about the MySQL shell before I proceed with this. I'll just ask a question. How many of you are using MySQL or used MySQL? Good number. And is there a developer here, or anyone developing, or any developers, any students? Perfect. Any DBAs? Awesome. So I'm sure that I'm going to get this MySQL shell tool. It's going to be an interesting topic because it's one unified tool by both developers, and the DBAs can work on. So we're going to see what it does. And there's going to be a demo as well. So we can quickly set up the MySQL NODB cluster. We're going to see how easy it is to deploy or get the MySQL NODB cluster, et cetera. Right, so let's get into the NODB cluster part. 100% so virtually our organization require the most critical system to be highly available. Having said that, this is required for productivity. And as a company, let's say that I don't want my system to be down because that's going to be a cost-effective thing. So it's going to impact my whole system. So what's the vision of MySQL NODB cluster is it's a single product, which basically means you're going to get all the high availability and the scaling features baked into it, which means that we're going to get an integrated end-to-end solution, which is pretty easy to use. As I said, let's say that I'm going to just to be two minutes to set up the NODB cluster. Interesting, isn't it? So I'm sure that I'm going to try this out after this presentation. And all the code that I'm going to use is available in the GitHub. It is for instance. So coming back to the picture, it's basically to see that it does the out of solution first. And we have got everything integrated in one place. Pretty easy to use. And it's extremely scaled. Let's see the NODB cluster architecture. So for instance, the first or the backbone of the NODB cluster is the group replication part here. And you see that there's a primary instance, which is the primary master. And we've got, which is a really right instance. And there are two secondary, which is really only me. So which means I need a minimum of three servers to set up a master NODB cluster. Going to the second one, which is the master router, it's lies in between the application and the server part. I'm excited that master router is a lightweight middleware that provides transfer and routing between the application and servers. And, trust me, getting the route problem is the pretty easiest thing to do. You just need to say that I can write in bootstrap. And the router is going to have a bootstrap that it doesn't get able to understand the number of instances that's present in the system. And it's going to get it configured. So you're going to see that in the demo. The next impression is the master shell. So what it does is it's in cluster admin. Like I said, that you can use Jaster, assuming that I am a Python programmer. Yes, you can use Python as well. And of course, SQL is fighting for it. The important thing to be noticed for DBA is like, I can use the admin API that's present. I can create instance just with a single command. I can kill an instance. And all I can do in one, which basically is like, I do not log into multiple instances to see what is happening. Everything is in one place. All right, this is putting all things together. So as I said, the group replication is the first thing that's required. Second is to draw the configuration and master shell to setup, manage, and focus free. And as I said, it's one product. And it has got a full stack HA solution. And it's pretty easy to use. Right, let's see what master shell is. It is basically an advanced command line client and a code editor for my SQL server. And the best part about that is it has got multiple language code, so which is JavaScript, Python, and SQL. And it supports both document and relational models. And what it does is it performs data queries and also it can perform all the administration operations as well. The first thing is like on the Scriptable DevOps API, so I can even use the whole API that's available. And then, as I said, it's a single interface for both the master developers and the database. And it's pretty easy to use. So before we go to the demo, the requirement for setting up a new database cluster is we need a minimum of three containers. And we need a master shell container to ensure that we get the master in a database setup. So that is, you know, so master shell container here is a temporary container, which I only used to just setup the new database cluster for us. And master router container is one which kind of, you know, it directs us to the corresponding server instances that are available. And lastly, they want to use this very simple application. So in my demo, I have selected WordPress. So what we do is we kind of bring up, you know, a quick blog, and then we kind of try to bring down one instance and let's see how, you know, we could able to get an HL out of the box. Right, so let's go back to the demo. I've got it recorded because, you know, it's 25 minutes, trust me, it's not that easy when you try to do a demo. So, let's start. So as I say, let's go to the record structure first. So I've just got a record called demo and what it called is, it's called the list of file set of record. So what we do now is let's see the content of each and every file. Right, so let's start the server. So let's say the MySQL server.lb and it fill out the password that's recommended to connect to the server and it's called the MySQL root post. So the part of the order here is percentage, which basically means that I want all the containers or with the different IP address to connect to MySQL. In a production environment, we need to ensure that we take care of the setting because we don't want anyone to contact our connectors. And this demo is basically a sandbox testing and having said that, I know you can try it out, but in a production, you need to ensure that you pick it up all the same. Right, so let's see what the content of MySQL shell.lb is. You see that? For still, we have just got it configured for the MySQL server one. So we've got three instance, server one, server two, and server three. And the best part is we, as I said, it's a temporary container and they've got a script to bind up getting, you know, to be cluster setup and a simple DV or SQL script to create the database and use fewer activities for our WordPress application. So that's about MasterShell. And this is the contents of the DV or SQL. We have just tried it out and I'll create a database or say sharing it, of course. And we just kind of create a user and see how it goes. And the next thing is a very important thing, that and what we do is we kind of see how the database cluster is set up. Right, so what we do here is the pretty important thing is like share it up in that which basically means that you're connecting to server one here and the cluster name is the cluster that we have created. So let's see, you know, how easy it is to get this out. So if you can see here, you're adding an instance, just take a map, which is cluster.addinstance. I mean, we're adding the next instance, which is MasterShell server two. And as simple as that, I'm going to pre-assessing command for server three because we want to get our cluster up and running. Pretty easy, isn't it? This, after this, what we do is let's see the content of router. So let's say the content of the router, all right. So the important thing to be noted here is that in order to be in num numbers, this is basically, we tell, you know, to our application that we just need to wait for the pre-master server to be up for me to set up for the router. So this is a very important configuration that I need to ensure when we try to set up and master it a bit closer. And so that is about the master in order to be in num numbers. So how do we get into the thing is, so the top part composed of .ma is an important file which got the contents of, just got all the information about our image. So let's see here, so if you see that, you know, let's just bring up three services and over here it is like, I'm using server 8.0.30 and there are a few things that we can ask to set up and group replication. So let's see what are those. And server 2 configuration and server 3 is similar. You can see that. This is the requirement for setting up a group replication which means that first is I need a log bin that has to be enabled and only no form of the supported and of course the GT ID has to be enabled and that should be a primary case as well and third is on the replication metadata it has to be stored on the system tables. So I'll use the options that are available master in 4.3 and the relay log in 4.3. And fourth is log slave updates. Yes, it has to be enabled for the group replication to work and last is the write set transaction must be enabled. So once you're done with, there's other things that are passed in this particular server to get the group replication out. And the next important thing that we say is how a shell is configured. So you could say that it's pretty easy and I've got my image so you can always download the image and see what it has. So what it has is we just need to wait for all the 3 server 1, 2, and 3 to be up for the cluster to be set up. So how it's set up? The router depends on the server and shell. And lastly, you could say that there is an application WordPress which depends on the master router. So this is what the contents of the docker compose.ml file is for. So let's say there's no container that we're up and running. We just saw that with docker ps, which is a command to check if there are any live instances. And the bringing up the energy cluster is pretty easy. So what I do is I just use one command since I've got all the configuration set. When I say it's docker compose up, it's going to do all the things for me. It does. So what it does is it's going to download all the images that's for it. And it's downloading shell now. This is the command to set docker compose up. With one single command, you get a complete new to be clustered set up in a couple of minutes. So let's see. So what it does is it just goes through it and the important thing to be noted here is first it tries to set up a server depending on the dependency that we've set in AML file. So let's see what it does now. If you just could see the number number in here. It's running two things finally. So two and so three. So let's see what it does. It just takes a while because the server is out of the dimension and you just set the server. In the meantime, you can see this. How can we be waiting for the server? So that's it. That's the key point here. Things to be told, to be noted here is how the wrapper is like in the compiler and how the shell is set up. So you can see here, it's trying to set up in a new cluster and this is done by a master shell designer. And we're using the server one image. It just basically goes through a set of things and I configured server and then comes the rocker. It just goes to it and let's see what the rocker does now. So these are a lot of things that happen. Basically, it just gets things up and running. And what has happened now is the wrapper is done and configuration is done. So we've got all our free service, one, two, and three. So what we quickly do is we just open and fit this. The master in ADB set up is complete. Yes. So that's pretty cool. And let's see the container manager is now with Docker PS. And you see that everything is well with this healthy which basically means all your server is server one, two, and three is like perfectly fine. We do not even bother with that. So this is an application that is, you know, that no adore. You can see that I can really connect the application to local host because that's how we configure it. And then you could see that I'm just using the database that we used in the dv.sql search. The important thing to be noted here is the database host. So what we do is here we pass the mask router because router takes care of routing things to the corresponding server. So that is what is the thing to be noted. And rest is pretty normal WordPress setup. So it's going to work very quickly. I'll just get things up very quickly so that. This is very simple, you know, a blog that you wrote. And now let's see, for instance, let's say I want to know what is happening with the mask router. You can use the command mask. Doctor compose logs mask router to see what is happening with each and every containers that you have got. So if you see that, I could able to say this and this is how I connect the server. Let's see how it does. So I just need to provide the password. This is the interface that we talked, the mask shell which is one particular page where I can interact with both SQL and JavaScript and Python. So let's see how we do it. By default it gets into your downstairs. So you can just see that I love this way which I think they're put up here, the child. By default it gets into the downstairs. So how many get into it? In other words, you say, blacks got this SQL. Yes, we are in SQL more. I can run commands in SQL. And getting back to Python is pretty easy. So since that three different language, and we can perform both interactive and batch operations. And how we set up in cluster is like, what I do is, what we do here is, we just say, where will cluster is equal to DBA.get cluster? The best part about mask shell is it has got an autocomplete feature and it provides you the different options that is available for a DBA to respond. So I need not even remember it. I just say DBA.cat, you will get a list of options that can be used in your shell. And DBA.get cluster is the one that gets the name over. If you remember, no, we have bought it does. And how do you get the name? Again, here is cluster.getname. It'll get me that name of cluster here. Here in our case, it is get cluster. So what we do now is, we just see the status of the cluster here. So I can always check the status of the cluster as simple as running one command, status.cluster. The thing to remember here is this is the first server. Cluster is online and we can tolerate up to one failure. The reason as we have given the instance as total number of instances is three. And you can see that the status is online and it's in Ruby Lite, which is the first server. And second server, other code servers are three, one. And I can always get into the SQL, just like this man. I hope you can see what is the entire name here. I can always use the select header, false name. And it's going to return me the container I need. And let's go back to the other instance to see what the connector ID is. It should match it with the master of server one. So it is demo server one, so which basically means that we are third. Let's talk this server one, which basically we want to bring down this container and see how our application is going to survey and how it should. So I'll say, Dr. Stop, and you mentioned it. And even I can also select the port, which is another command like select the port and you will see the port here. So let's stop the server one to see what is happening. Right, so in case if an HEA is not set, my whole application is going to fail and my log is not accessible, but I don't want that. So you can see that there is something that's growing up in the log. Yes, my log is accessible, which means that if we're able to handle a failure, so it's automatic failure has happened. I didn't, we didn't do anything much except for setting up the loading cluster. And now let's see what has happened behind the scene to get this up and running. And understanding the instance too, just to see what is happening. And this is how we connect to the router. So let's do the same thing again. Let's try to get the cluster name first and then try to get the status just to see what has happened with our cluster now. And interestingly, you will see something very catchy. What happens is it has gotten an intelligence just to make the server two is read, right? Go here. This is what has happened. And server one, it's missing, which basically means that something happened to server one. And you could see that it's online. The other one is like, this other one is online, but it can tolerate up to one failure because now server one is down. Yeah, so that is pretty thing to be noted and the different status. So what we quickly do is we kind of, you know, go to another session and we'll try to bring up to kind of the server instance, our server container again and see what is going to happen. So let's start with the upper start and the container name. And let's check the status and you could see that it's going to take a while. And let's write it down. Yes, server one is back online, which basically means that as application is up and running, one thing is it has got an automatic failure over to ensure that whenever I add an instance back, it's going to add it as read only. But as a user, I won't be able to know what is happening with regards to the cluster. So let me just quickly go over the presentation. So in case if you have any queries, as I said, we are available to Google and this is a very good resource that I can always go through the links. And in case you can press it or to know what to download, you can show it very quickly. This is a page where you can download the master server, the latest version that we have called as 8015. So the URL is www.maskel.com slash downloads slash masterl. And this is basically the Docker image that we have got, which is the master server, which is our own official master server Docker image. On the Docker app, the scripts that we spoke or the images is available for free, you can always download, start, and I can always do the same thing, but setting up in order to be clustered in two minutes. So all the things are available and even the, you can always pull the source code. So these are the two things that are available. So feel free to use it and share your free address. Right? So with that, very much questions. Everything is free. So that is what I said. If you can download it for free, start using it, including shell, router, server, everything is open source. So the URL that we use here is, I go here and I select the thing that I want. For example, let's say I'm a Red Hat user and I can always use Red Hat. These are different formats. Select all you want. Use it for free. So that's mask, it's an open source. And in case you want to download the Docker match, yes, this is what you go here and then I, you say Docker pull, mask, slash, mask, server, you can get the Docker image for masquerade. More questions? Yes. I have a question, right? Yeah. About that read mic. Yes. So a very good question. So router has got two ports. So 6446 is for read, right? And I can always configure my instance with 6447, which is a read only instance. And I can always get my application point to that port.