1. Home
  2. Training Library
  3. Alibaba Cloud
  4. Courses
  5. A Practical Understanding of Alibaba Cloud RDS

Read Only Instances and Monitoring

Start course
Overview
Difficulty
Intermediate
Duration
50m
Students
45
Ratings
5/5
starstarstarstarstar
Description

This course explores Alibaba's RDS service looking at RDS instances, features, security, and the foundational concepts of the service. You'll follow along with guided demos from the Alibaba Cloud platform that will show you how to use and manage the RDS service.

Learning Objectives

  • Get a foundational understanding of the RDS service
  • Create an RDS instance
  • Set up backups and temporary instances
  • Set up read-only instances
  • Use monitoring, metrics, and alerts in RDS
  • Upgrading RDS Instance Configuration

Intended Audience

This course is intended for anyone who wants to learn more about Alibaba RDS, as well as anyone studying for the ACP Cloud Computing certification exam.

Prerequisites

To get the most out of this course, you should have a basic understanding of the Alibaba Cloud platform.

Transcript

So let's continue where we left off. We'll use the same RDS instance that we just used to test Backup and Restore. And now I want to try and create a read-only instance, and also take a look at some of the monitoring and metrics and alerts that are available in the RDS console. So we'll start by going back to the basic info page. From here on the right-hand side, you can see our read-only instance count. Right now, we have zero. So let's go ahead and change that.

Let's create a read-only instance by clicking here. That's going to set up a clone of our existing RDS my-SQL database that is read-only and we'll then be able to create a read/write splitting endpoint that points to our new database cluster. Such that, when read requests come in, they can be routed to the read instance and when write requests come in, they'll go directly to the master. And I'll go ahead and make this pay-as-you-go, and I'll deploy it in Zone-A. The same zone as the master. We'll choose a small one gigabyte of RAM, one CPU core, and we'll make the capacity five gigabytes, just like our master instance.

Then we'll move on to instance configuration. I need to choose a VPC and V-switch. Again, I'll choose those to be the same as the master. And then we'll click on Confirm Order. From here, I need to set how many read-only instances I would like to create. You can see that I can create quite a few. Although actually in practice, there's a limit of, I believe, 15 or 16. In my case, I'm going to create just one. I'll agree to the Terms of Service, and then we can click on Pay Now. Now this should go ahead and create our read-only instance for us. So let's wait a minute for the purchase process to complete.

Okay, it looks like the order has been successfully processed. So what's now going to happen is a new RDS database instance will be created. Our existing database will be migrated on to that new RDS instance, and then this read-only instance count should increment to one. So you can see we now have one read-only instance, and in a moment we should see a Migration task appear here.

First, we have to wait for the instance to create. You can see if we go back to the instance list, I now have a ordinary database instance, an ordinary my-SQL database instance and a read-only instance. You can tell it's read-only because it has an orange and white R-logo to the left of the RDS ID. So we need to wait a minute for that to finish creating. Once it's been successfully created, the contents of this RDS database will get cloned onto the read-only instance. So while we're waiting for that, let's take a look at some of the monitoring and metric information that's available for our primary RDS database. You can find that information here under Monitoring and Alerts.

If I click on Monitoring and Alerts, I can see one hour, one day, seven day, and one month worth of historical data. Although in my case, my instance was created today, so there's not very much to see. You can see, I can see both CPU and Memory Utilization. I can see Disc Space Utilization. I can see I/O Ops. So I can see I/O Operations taking place on the database. And I can see the total number of connections as well as inbound and outbound network traffic in kilobytes. All of that is available right here from the Monitoring and Alerts console. I can also monitor some specific qualities related to the database engine, like the number of queries per second, the size of the InnoDB Buffer Pool, and the InnoDB database engine read/write volume. As well as Buffer Pool read/write frequency, and read/write F-sync Operations. I can even see temporary tables that have been created as my-SQL statements are executing.

So some of these temporary tables were probably created earlier when we were playing with our data in DMS. And you can see, we have a full set of my-SQL engine-related metrics here. Let me scroll back up to the top. I can also monitor database deployments. So if I have more than a single instance, I can see the status of my other instances here. And I can, from the Alerts tab, set up alert rules that will cause an alarm, an email, or a message to be sent to me in the event that the status of the database changes. So all of that's available right here from Monitoring and Alerts.

If I go back to the basic information page, we can see that the read-only instance is now being created. The Task is started. The Node has been created. And what we're going to do is make a backup of the existing RDS database, and then restore that backup onto the new read-only instance. Once that's done, we'll be able to apply for a read/write splitting endpoint, which is a database endpoint that can automatically forward read requests to the read-only node and write requests to the master. So this is essentially a proxy service that will take incoming database requests from our application and send them to the appropriate database.

Let's wait a minute for the creation process for our read-only instance to complete. So we've waited a while and the read-only instance has now been successfully created, and the backup of all the content from the master is now available on the read-only instance. So here's the read-only instance. You can see it's denoted by a white and orange R here. Our master here is indicated with this little split-icon with two nodes. Let's go ahead and click on Manage, next to the read-only instance. And then actually we should be able to log in to the read-only instance, the same way we do with the master. So by using DMS, it should have the same account and password configuration.

So we should be able to log in as student_admin with the same password as we did before. Now let's test that connection and see if it works. So technically during the creation process, the white list should have been transferred too. So you can see that we successfully connect without having to configure the white list. Let's go ahead and connect to our read-only instance, and try running a SELECT query on our table.

So, let's see what tables we have available to us. Oh, excuse me. I first need to find the student database. There we go. And sure enough, the student backup database, student_table_backup from last time, should be available and I can re-execute my previous SQL query. And sure enough, you can see all the records from the master database do also show up on the read-only instance. Now, in terms of monitoring and alerts, let's go take a look at that again.

So Monitoring and Alerts, you can see here that we have resource monitoring functions at the hour, day, week, and month level. And we can monitor both high level concepts, high level resources, like CPU and Disc Space and Memory, but we can also monitor things like the status of the database engine, the status of deployments, if we're running more than one database. So you can see all that data here as well. And that is all for this demo.

About the Author
Students
374
Courses
18
Learning Paths
2

Alibaba Cloud, founded in 2009, is a global leader in cloud computing and artificial intelligence, providing services to thousands of enterprises, developers, and governments organizations in more than 200 countries and regions. Committed to the success of its customers, Alibaba Cloud provides reliable and secure cloud computing and data processing capabilities as a part of its online solutions.