Add and use AnalyticDB for PostgreSQL

更新时间:
复制 MD 格式

This topic describes how to connect to AnalyticDB for PostgreSQL in Grafana to perform visual analytics.

Prerequisites

Procedure

Grafana 9.x

  1. Log on to the Managed Service for Grafana console. In the left-side navigation pane, click Workspace Management.

  2. On the Workspace Management page, click the name of the target workspace to open the Workspace Information page.

  3. In the Basic Information section, copy the Public IP address of Grafana and add it to the whitelist of the AnalyticDB for PostgreSQL instance. This allows Grafana to access the AnalyticDB for PostgreSQL instance. For more information, see Configure a whitelist.

  4. On the Workspace Management page, click the URL in the Endpoint URL column for the target workspace to open Grafana.

    Note

    To log on to Grafana, use the Admin account and the password that you set when you created the workspace.

  5. In the navigation pane on the left, click the image icon.

  6. On the Configuration page, click Add data source. In the search box, search for and click PostgreSQL. Then, enter the connection information. The following table describes the parameters.

    Parameter

    Description

    Name

    The name of the data source.

    Host

    The endpoint of the AnalyticDB for PostgreSQL instance. The format is <host>:<port>. For example, gp-bp10vkbe1x1v3h****-master.gpdb.rds.aliyuncs.com:5432.

    Database

    The name of the AnalyticDB for PostgreSQL database.

    User

    The database account of AnalyticDB for PostgreSQL.

    Password

    The password of the AnalyticDB for PostgreSQL database account.

    TLS/SSL Mode

    Select disable, or configure this parameter as needed.

    Version

    Set the PostgreSQL version to 9.4.

    More parameters

    For more information about other parameters, see the open source Grafana documentation.

  7. At the bottom of the page, click Save & Test.

    Note

    If the message Database Connection OK appears, the connection is successful.

  8. You can perform data analytics in Grafana. For more information about data analytics, see the open source Grafana documentation.

Grafana 10.x

  1. Log on to the Managed Service for Grafana console. In the left-side navigation pane, click Workspace Management.

  2. On the Workspace Management page, click the name of the target workspace to open the Workspace Information page.

  3. In the Basic Information section, copy the Public IP address of Grafana and add it to the whitelist of the AnalyticDB for PostgreSQL instance. This allows Grafana to access the AnalyticDB for PostgreSQL instance. For more information, see Configure a whitelist.

  4. On the Workspace Management page, click the URL in the Endpoint URL column for the target workspace to open Grafana.

    Note

    To log on to Grafana, use the Admin account and the password that you set when you created the workspace.

  5. On the Grafana home page, click the image icon in the upper-left corner.

  6. In the navigation pane on the left, click Connections, and then click Add new connection.

  7. In the search box, search for and click PostgreSQL.

  8. On the PostgreSQL page, on the Overview tab, click Create a PostgreSQL data source and enter the connection information. The following table describes the parameters.

    Parameter

    Description

    Name

    The name of the data source.

    Host

    The endpoint of the AnalyticDB for PostgreSQL instance. The format is <host>:<port>. For example, gp-bp10vkbe1x1v3h****-master.gpdb.rds.aliyuncs.com:5432.

    Database

    The name of the AnalyticDB for PostgreSQL database.

    User

    The database account of AnalyticDB for PostgreSQL.

    Password

    The password of the AnalyticDB for PostgreSQL database account.

    TLS/SSL Mode

    Select disable, or configure this parameter as needed.

    Version

    Set the PostgreSQL version to 9.4.

    More parameters

    For more information about other parameters, see the open source Grafana documentation.

  9. At the bottom of the page, click Save & Test.

    Note

    If the message Database Connection OK appears, the connection is successful.

  10. You can perform data analytics in Grafana. For more information about data analytics, see the open source Grafana documentation.