×
Community Blog Monitor Changes in the Uptime Value of Resources

Monitor Changes in the Uptime Value of Resources

The article explains how to check and interpret the uptime metric for Alibaba Cloud databases and how switchover or restart events affect it.

Uptime query mode

By retrieving the uptime value, we can know the running status and running time of the server.

For ApsaraDB RDS for MySQL and PolarDB for MySQL, we can query the show status statement to obtain the uptime:

SHOW GLOBAL STATUS LIKE 'Uptime';

Obtain uptime of PostgreSQL:

SELECT date_trunc('second', current_timestamp - pg_postmaster_start_time()) as uptime;

Obtain uptime of ApsaraDB for Redis:

redis-cli INFO | grep uptime_in_seconds

Obtain uptime of MySQL

Snapshots of obtaining uptime of ApsaraDB RDS for MySQL and PolarDB for MySQL:

1
2

Obtain uptime after MySQL configures primary/secondary switchover

Obtain uptime again after ApsaraDB RDS for MySQL and PolarDB for MySQL configure manual primary/secondary switchover:

3
4

Snapshot of the uptime value of ApsaraDB RDS for MySQL after the primary/secondary switchover:

5

Snapshot of the uptime value of PolarDB for MySQL after the primary/secondary switchover:

6

Obtain uptime after restarting MySQL

Obtain uptime again after ApsaraDB RDS for MySQL or PolarDB for MySQL is manually restarted.

7
8

Snapshot of the uptime value of ApsaraDB RDS for MySQL after the instance is restarted:

9

Snapshot of the uptime value of PolarDB for MySQL after the instance is restarted:

10

Obtain uptime of PostgreSQL

Snapshot of obtaining uptime of PostgreSQL:

11

Obtain uptime after PostgreSQL configures primary/secondary switchover

Snapshot of manual primary/secondary switchover:

12

Snapshot of obtaining uptime after primary/secondary switchover:

13

Obtain uptime after PostgreSQL is restarted

Snapshot of manually restarting an instance:

14

Obtain uptime again after restarting the instance:

15

Obtain uptime of ApsaraDB for Redis

Log on to the ApsaraDB for Redis console from DMS and run the info command to view the snapshot:

16

Obtain uptime after ApsaraDB for Redis configures primary/secondary switchover

17
18

Snapshot of obtaining uptime after primary/secondary switchover:

19

Obtain uptime after ApsaraDB for Redis is restarted

Snapshot of restarting an instance:

20

Snapshot of obtaining uptime again after the restart:

21

Conclusion

When ApsaraDB RDS for MySQL, PolarDB for MySQL, and ApsaraDB RDS for PostgreSQL configure primary/secondary switchover, the uptime value continues to increase. The value does not pause or return to zero. If ApsaraDB RDS for MySQL, PolarDB for MySQL, and ApsaraDB RDS for PostgreSQL are restarted, the uptime value is reset to zero and starts again. The uptime value will not be affected and continue to increase if you switch or restart the high-availability version of ApsaraDB for Redis.

In Alibaba Cloud databases, the uptime of ApsaraDB RDS for MySQL and PolarDB for MySQL indicates the overall service duration of an instance, rather than the service duration of a single node. For ApsaraDB for Redis, uptime seems to be a meaningless metric.

0 1 0
Share on

ApsaraDB

516 posts | 167 followers

You may also like

Comments

ApsaraDB

516 posts | 167 followers

Related Products