Skip to content

Commit a0ade9f

Browse files
authored
Merge pull request #57662 from ajlam/master
MariaDB CLI docs and concepts monitor - retry PR
2 parents 318e0a9 + 51a26d5 commit a0ade9f

7 files changed

+655
-2
lines changed

articles/mariadb/TOC.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
items:
2222
- name: Azure portal
2323
href: tutorial-design-database-using-portal.md
24+
- name: Azure CLI
25+
href: tutorial-design-database-cli.md
2426
- name: Concepts
2527
items:
2628
- name: DB & Servers
@@ -29,8 +31,6 @@
2931
href: concepts-servers.md
3032
- name: Supported versions
3133
href: concepts-supported-versions.md
32-
- name: Server logs
33-
href: concepts-server-logs.md
3434
- name: High availability
3535
href: concepts-high-availability.md
3636
- name: Resources
@@ -51,6 +51,12 @@
5151
href: concepts-business-continuity.md
5252
- name: Backup and restore
5353
href: concepts-backup.md
54+
- name: Monitor
55+
items:
56+
- name: Monitor
57+
href: concepts-monitoring.md
58+
- name: Server logs
59+
href: concepts-server-logs.md
5460
- name: Development
5561
items:
5662
- name: Connection resiliency
@@ -65,10 +71,14 @@
6571
items:
6672
- name: Azure portal
6773
href: howto-manage-firewall-portal.md
74+
- name: Azure CLI
75+
href: howto-manage-firewall-cli.md
6876
- name: Restore a server
6977
items:
7078
- name: Azure portal
7179
href: howto-restore-server-portal.md
80+
- name: Azure CLI
81+
href: howto-restore-server-cli.md
7282
- name: Migrate a database
7383
items:
7484
- name: Dump & restore
@@ -85,10 +95,14 @@
8595
items:
8696
- name: Azure portal
8797
href: howto-server-parameters.md
98+
- name: Azure CLI
99+
href: howto-configure-server-parameters-cli.md
88100
- name: Access server logs
89101
items:
90102
- name: Azure portal
91103
href: howto-configure-server-logs-portal.md
104+
- name: Azure CLI
105+
href: howto-configure-server-logs-cli.md
92106
- name: Replication
93107
items:
94108
- name: Configure data-in replication
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
title: Monitoring in Azure Database for MariaDB
3+
description: This article describes the metrics for monitoring and alerting for Azure Database for MariaDB, including CPU, storage, and connection statistics.
4+
services: mariadb
5+
author: rachel-msft
6+
ms.author: raagyema
7+
manager: kfile
8+
editor: jasonwhowell
9+
ms.service: mariadb
10+
ms.topic: article
11+
ms.date: 11/10/2018
12+
---
13+
# Monitoring in Azure Database for MariaDB
14+
Monitoring data about your servers helps you troubleshoot and optimize for your workload. Azure Database for MariaDB provides various metrics that give insight into the behavior of your server.
15+
16+
## Metrics
17+
All Azure metrics have a one-minute frequency, and each metric provides 30 days of history. You can configure alerts on the metrics. Other tasks include setting up automated actions, performing advanced analytics, and archiving history. For more information, see the [Azure Metrics Overview]
18+
(../monitoring-and-diagnostics/monitoring-overview-metrics.md).
19+
20+
<!--For step by step guidance, see [How to set up alerts](howto-alert-on-metric.md). -->
21+
22+
### List of metrics
23+
These metrics are available for Azure Database for MariaDB:
24+
25+
|Metric|Metric Display Name|Unit|Description|
26+
|---|---|---|---|---|
27+
|cpu_percent|CPU percent|Percent|The percentage of CPU in use.|
28+
|memory_percent|Memory percent|Percent|The percentage of memory in use.|
29+
|io_consumption_percent|IO percent|Percent|The percentage of IO in use.|
30+
|storage_percent|Storage percentage|Percent|The percentage of storage used out of the server's maximum.|
31+
|storage_used|Storage used|Bytes|The amount of storage in use. The storage used by the service may include the database files, transaction logs, and the server logs.|
32+
|serverlog_storage_percent|Server Log storage percent|Percent|The percentage of server log storage used out of the server's maximum server log storage.|
33+
|serverlog_storage_usage|Server Log storage used|Bytes|The amount of server log storage in use.|
34+
|serverlog_storage_limit|Server Log storage limit|Bytes|The maximum server log storage for this server.|
35+
|storage_limit|Storage limit|Bytes|The maximum storage for this server.|
36+
|active_connections|Active Connections|Count|The number of active connections to the server.|
37+
|connections_failed|Failed Connections|Count|The number of failed connections to the server.|
38+
|network_bytes_egress|Network Out|Bytes|Network Out across active connections.|
39+
|network_bytes_ingress|Network In|Bytes|Network In across active connections.|
40+
41+
## Server logs
42+
You can enable slow query logging on your server. To learn more about logging, visit the [server logs](concepts-server-logs.md) page.
43+
44+
## Next steps
45+
- For more information on how to access and export metrics using the Azure portal, REST API, or CLI, see the [Azure Metrics Overview](../monitoring-and-diagnostics/monitoring-overview-metrics.md).
46+
47+
<!-- - See [How to set up alerts](howto-alert-on-metric.md) for guidance on creating an alert on a metric.-->
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
title: Access server logs in Azure Database for MariaDB by using Azure CLI
3+
description: This article describes how to access the server logs in Azure Database for MariaDB by using the Azure CLI command-line utility.
4+
services: mariadb
5+
author: rachel-msft
6+
ms.author: raagyema
7+
manager: kfile
8+
editor: jasonwhowell
9+
ms.service: mariadb
10+
ms.devlang: azure-cli
11+
ms.topic: article
12+
ms.date: 11/10/2018
13+
---
14+
# Configure and access server logs by using Azure CLI
15+
You can download the Azure Database for MariaDB server logs by using Azure CLI, the Azure command-line utility.
16+
17+
## Prerequisites
18+
To step through this how-to guide, you need:
19+
- [Azure Database for MariaDB server](quickstart-create-mariadb-server-database-using-azure-cli.md)
20+
- The [Azure CLI](/cli/azure/install-azure-cli) or Azure Cloud Shell in the browser
21+
22+
## Configure logging for Azure Database for MariaDB
23+
You can configure the server to access the MariaDB slow query log by taking the following steps:
24+
1. Turn on logging by setting the **slow\_query\_log** parameter to ON.
25+
2. Adjust other parameters, such as **long\_query\_time** and **log\_slow\_admin\_statements**.
26+
27+
To learn how to set the value of these parameters through Azure CLI, see [How to configure server parameters](howto-configure-server-parameters-cli.md).
28+
29+
For example, the following CLI command turns on the slow query log, sets the long query time to 10 seconds, and then turns off the logging of the slow admin statement. Finally, it lists the configuration options for your review.
30+
```azurecli-interactive
31+
az mariadb server configuration set --name slow_query_log --resource-group myresourcegroup --server mydemoserver --value ON
32+
az mariadb server configuration set --name long_query_time --resource-group myresourcegroup --server mydemoserver --value 10
33+
az mariadb server configuration set --name log_slow_admin_statements --resource-group myresourcegroup --server mydemoserver --value OFF
34+
az mariadb server configuration list --resource-group myresourcegroup --server mydemoserver
35+
```
36+
37+
## List logs for Azure Database for MariaDB server
38+
To list the available log files for your server, run the [az mariadb server-logs list](/cli/azure/mariadb/server-logs#az-mariadb-server-logs-list) command.
39+
40+
You can list the log files for server **mydemoserver.mariadb.database.azure.com** under the resource group **myresourcegroup**. Then direct the list of log files to a text file called **log\_files\_list.txt**.
41+
```azurecli-interactive
42+
az mariadb server-logs list --resource-group myresourcegroup --server mydemoserver > log_files_list.txt
43+
```
44+
## Download logs from the server
45+
With the [az mariadb server-logs download](/cli/azure/mariadb/server-logs#az-mariadb-server-logs-download) command, you can download individual log files for your server.
46+
47+
Use the following example to download the specific log file for the server **mydemoserver.mariadb.database.azure.com** under the resource group **myresourcegroup** to your local environment.
48+
```azurecli-interactive
49+
az mariadb server-logs download --name mysql-slow-mydemoserver-2018110800.log --resource-group myresourcegroup --server mydemoserver
50+
```
51+
52+
## Next steps
53+
- Learn about [server logs in Azure Database for MariaDB](concepts-server-logs.md).
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
---
2+
title: Configure the service parameters in Azure Database for MariaDB
3+
description: This article describes how to configure the service parameters in Azure Database for MariaDB using the Azure CLI command line utility.
4+
services: mariadb
5+
author: ajlam
6+
ms.author: andrela
7+
manager: kfile
8+
editor: jasonwhowell
9+
ms.service: mariadb
10+
ms.devlang: azure-cli
11+
ms.topic: article
12+
ms.date: 11/09/2018
13+
---
14+
# Customize server configuration parameters by using Azure CLI
15+
You can list, show, and update configuration parameters for an Azure Database for MariaDB server by using Azure CLI, the Azure command-line utility. A subset of engine configurations is exposed at the server-level and can be modified.
16+
17+
## Prerequisites
18+
To step through this how-to guide, you need:
19+
- [An Azure Database for MariaDB server](quickstart-create-mariadb-server-database-using-azure-cli.md)
20+
- [Azure CLI](/cli/azure/install-azure-cli) command-line utility or use the Azure Cloud Shell in the browser.
21+
22+
## List server configuration parameters for Azure Database for MariaDB server
23+
To list all modifiable parameters in a server and their values, run the [az mariadb server configuration list](/cli/azure/mariadb/server/configuration#az-mariadb-server-configuration-list) command.
24+
25+
You can list the server configuration parameters for the server **mydemoserver.mariadb.database.azure.com** under resource group **myresourcegroup**.
26+
```azurecli-interactive
27+
az mariadb server configuration list --resource-group myresourcegroup --server mydemoserver
28+
```
29+
30+
For the definition of each of the listed parameters, see the MariaDB reference section on [Server System Variables](https://mariadb.com/kb/en/library/server-system-variables/).
31+
32+
## Show server configuration parameter details
33+
To show details about a particular configuration parameter for a server, run the [az mariadb server configuration show](/cli/azure/mariadb/server/configuration#az-mariadb-server-configuration-show) command.
34+
35+
This example shows details of the **slow\_query\_log** server configuration parameter for server **mydemoserver.mariadb.database.azure.com** under resource group **myresourcegroup.**
36+
```azurecli-interactive
37+
az mariadb server configuration show --name slow_query_log --resource-group myresourcegroup --server mydemoserver
38+
```
39+
40+
## Modify a server configuration parameter value
41+
You can also modify the value of a certain server configuration parameter, which updates the underlying configuration value for the MariaDB server engine. To update the configuration, use the [az mariadb server configuration set](/cli/azure/mariadb/server/configuration#az-mariadb-server-configuration-set) command.
42+
43+
To update the **slow\_query\_log** server configuration parameter of server **mydemoserver.mariadb.database.azure.com** under resource group **myresourcegroup.**
44+
```azurecli-interactive
45+
az mariadb server configuration set --name slow_query_log --resource-group myresourcegroup --server mydemoserver --value ON
46+
```
47+
48+
If you want to reset the value of a configuration parameter, omit the optional `--value` parameter, and the service applies the default value. For the example above, it would look like:
49+
```azurecli-interactive
50+
az mariadb server configuration set --name slow_query_log --resource-group myresourcegroup --server mydemoserver
51+
```
52+
53+
This code resets the **slow\_query\_log** configuration to the default value **OFF**.
54+
55+
## Working with the time zone parameter
56+
57+
### Populating the time zone tables
58+
59+
The time zone tables on your server can be populated by calling the `az_load_timezone` stored procedure from a tool like the MariaDB command line or MariaDB Workbench.
60+
61+
> [!NOTE]
62+
> If you are running the `az_load_timezone` command from MariaDB Workbench, you may need to turn off safe update mode first using `SET SQL_SAFE_UPDATES=0;`.
63+
64+
```sql
65+
CALL mysql.az_load_timezone();
66+
```
67+
68+
To view available time zone values, run the following command:
69+
70+
```sql
71+
SELECT name FROM mysql.time_zone_name;
72+
```
73+
74+
### Setting the global level time zone
75+
76+
The global level time zone can be set using the [az mariadb server configuration set](/cli/azure/mariadb/server/configuration#az-mariadb-server-configuration-set) command.
77+
78+
The following command updates the **time\_zone** server configuration parameter of server **mydemoserver.mariadb.database.azure.com** under resource group **myresourcegroup** to **US/Pacific**.
79+
80+
```azurecli-interactive
81+
az mariadb server configuration set --name time_zone --resource-group myresourcegroup --server mydemoserver --value "US/Pacific"
82+
```
83+
84+
### Setting the session level time zone
85+
86+
The session level time zone can be set by running the `SET time_zone` command from a tool like the MariaDB command line or MariaDB Workbench. The example below sets the time zone to the **US/Pacific** time zone.
87+
88+
```sql
89+
SET time_zone = 'US/Pacific';
90+
```
91+
92+
Refer to the MariaDB documentation for [Date and Time Functions](https://mariadb.com/kb/en/library/date-time-functions/).
93+
94+
## Next steps
95+
96+
- How to configure [server parameters in Azure portal](howto-server-parameters.md)

0 commit comments

Comments
 (0)