【问题标题】:How to know RDS free storage with using AWS CLI?如何使用 AWS CLI 了解 RDS 免费存储?
【发布时间】:2019-05-19 03:21:21
【问题描述】:

我尝试了以下命令,但没有成功(如果我做错了什么,请告诉我)。

aws cloudwatch get-metric-statistics --metric-name FreeStorageSpace --start-time 2018-12-15T23:18:00Z --end-time 2018-12-16T23:18:00Z --period 60 --namespace AWS/RDS --statistics Average --dimensions Name=Instance name, value=dev

我得到以下输出:-

{ "Datapoints": [], "Label": "FreeStorageSpace" }

【问题讨论】:

标签: amazon-web-services amazon-rds aws-cli


【解决方案1】:

输入是这样的:

aws cloudwatch get-metric-statistics
--region us-east-1
--metric-name FreeStorageSpace
--start-time 2018-12-15T20:05:00
--end-time 2017-12-16T20:05:00
--period 3600
--namespace AWS/RDS
--statistics Maximum
--dimensions="Name=MyDB,Value=cc-mysql-prod-db"

输出:

{
"Datapoints": [
    {
        "Timestamp": "2018-12-15T20:05:00Z",
        "Maximum": 2196401152.0,
        "Unit": "Bytes"
    },
    {
        "Timestamp": "2018-12-15T21:05:00Z",
        "Maximum": 2196433920.0,
        "Unit": "Bytes"
    },
    {
        "Timestamp": "2018-12-15T22:05:00Z",
        "Maximum": 2196401152.0,
        "Unit": "Bytes"
    },


    ...


    {
        "Timestamp": "2018-12-16T18:05:00Z",
        "Maximum": 2196405248.0,
        "Unit": "Bytes"
    },
    {
        "Timestamp": "2018-12-16T19:05:00Z",
        "Maximum": 2196405248.0,
        "Unit": "Bytes"
    },
    {
        "Timestamp": "2018-12-16T20:05:00Z",
        "Maximum": 2196433920.0,
        "Unit": "Bytes"
    }
],
"Label": "FreeStorageSpace"
    }

您能否确保您使用的默认区域与数据库实例驻留在 aws cli 中的位置相同,并尝试使用 300 或其他时间段?

【讨论】:

    【解决方案2】:

    是的,我做到了。这是我的输出:-

    ..... ...... ..... "Timestamp": "2018-12-18T11:18:00Z", "Average": 103001828556.8, "Unit": "Bytes" }, { "Timestamp": "2018-12-17T20:18:00Z", "Average": 103001801386.66667, "Unit": "Bytes" }, { "Timestamp": "2018-12-18T01:18:00Z", "Average": 103001622664.53334, "Unit": "Bytes" } ], "Label": "FreeStorageSpace"

    但这里显示 103.00162266453334 GB(我的 Rds 实例大小只有 100GB),在 AWS 控制台上显示 98.3456775GB

    【讨论】:

      猜你喜欢
      • 2018-08-28
      • 1970-01-01
      • 2017-07-17
      • 2023-03-14
      • 2014-06-23
      • 1970-01-01
      • 1970-01-01
      • 2023-02-22
      • 2018-03-19
      相关资源
      最近更新 更多