管理 Amazon DocumentDB 事件

    重要

    对于某些管理功能,Amazon DocumentDB 使用与 Amazon RDS 和 Amazon Neptune 共享的操作技术。区域限制是指在区域级别管理,在 Amazon DocumentDB、Amazon RDS 和 Amazon Neptune 之间共有的限制。有关更多信息,请参阅区域配额

    每种 Amazon DocumentDB 资源类型与特定类型的事件关联。您可以使用 AWS CLI 操作查看事件类型和 Amazon DocumentDB 资源类型之间的映射。

    参数

    • --source-type — 可选。可以使用 --source-type 参数查看特定源类型的事件类别。以下是允许的值:

      • db-cluster

      • db-instance

      • db-parameter-group

      • db-security-group

      • db-snapshot

      • db-cluster-snapshot

    • --filters — 可选。要仅查看 Amazon DocumentDB 的事件类别,请使用筛选器 --filter Name=engine,Values=docdb

    对于 Linux、macOS 或 Unix:

    对于 Windows:

    1. aws docdb describe-event-categories ^
    2. --filter Name=engine,Values=docdb ^
    3. --source-type db-cluster

    此操作的输出将类似于下文(JSON 格式)。

    1. {
    2. "EventCategoriesMapList": [
    3. {
    4. "EventCategories": [
    5. "notification",
    6. "failure",
    7. "maintenance",
    8. "failover"
    9. ],
    10. "SourceType": "db-cluster"
    11. }
    12. ]
    13. }

    以下代码列出了与每种 Amazon DocumentDB 源类型关联的事件类别。

    此操作的输出将类似于下文(JSON 格式)。

    1. {
    2. "EventCategoriesMapList": [
    3. {
    4. "SourceType": "db-instance",
    5. "EventCategories": [
    6. "notification",
    7. "failure",
    8. "creation",
    9. "maintenance",
    10. "deletion",
    11. "recovery",
    12. "restoration",
    13. "configuration change",
    14. "read replica",
    15. "backtrack",
    16. "low storage",
    17. "availability",
    18. "failover"
    19. },
    20. {
    21. "SourceType": "db-security-group",
    22. "EventCategories": [
    23. "configuration change",
    24. "failure"
    25. ]
    26. },
    27. {
    28. "SourceType": "db-parameter-group",
    29. "EventCategories": [
    30. "configuration change"
    31. ]
    32. },
    33. {
    34. "SourceType": "db-snapshot",
    35. "EventCategories": [
    36. "notification",
    37. "creation",
    38. "deletion",
    39. "restoration"
    40. ]
    41. },
    42. {
    43. "SourceType": "db-cluster",
    44. "EventCategories": [
    45. "notification",
    46. "failure",
    47. "maintenance",
    48. "failover"
    49. ]
    50. },
    51. {
    52. "SourceType": "db-cluster-snapshot",
    53. "EventCategories": [
    54. "backup"
    55. ]
    56. }
    57. ]
    58. }

    查看 Amazon DocumentDB 事件

    您可通过 Amazon DocumentDB控制台(显示过去 24 小时的事件)检索 Amazon DocumentDB资源的事件。还可通过使用 describe-events AWS CLI 命令或 Amazon DocumentDB API 操作来检索 Amazon DocumentDB 资源的事件。如果您使用 AWS CLI 或 Amazon DocumentDB API 查看事件,则可检索过去长达 14 天内的事件。

    查看过去 24 小时的所有 Amazon DocumentDB 实例事件

    1. 通过以下网址登录 AWS 管理控制台并打开 Amazon DocumentDB 控制台:https://console.aws.amazon.com/docdb

    2. 在导航窗格中,选择 Events。列表中显示可用的事件。

    使用 AWS CLI

    查看过去 7 天的所有 Amazon DocumentDB实例事件

    筛选 Amazon DocumentDB事件

    要查看特定 Amazon DocumentDB事件,请使用带有以下参数的 describe-events 操作。

    参数

    • --filter — 必需,用于限制 Amazon DocumentDB 事件的返回值。可以使用 仅筛选 Amazon DocumentDB的所有事件。

    • --source-identifier—可选。为其返回事件的事件源的标识符。如果省略,则在结果中包含来自所有源的事件。

    • --source-type — 可选,除非提供 --source-identifier,此时则为必需。如果提供 --source-identifier,则 --source-type 必须与 --source-identifier 的类型一致。以下是允许的值:

      • db-cluster

      • db-instance

      • db-parameter-group

      • db-security-group

      • db-snapshot

      • db-cluster-snapshot

    以下示例列出您的所有 Amazon DocumentDB事件。

    1. aws docdb describe-events --filters Name=engine,Values=docdb
    1. {
    2. "Events": [
    3. {
    4. "SourceArn": "arn:aws:rds:us-east-1:123SAMPLE012:db:sample-cluster-instance3",
    5. "Message": "instance created",
    6. "SourceType": "db-instance",
    7. "Date": "2018-12-11T21:17:40.023Z",
    8. "SourceIdentifier": "sample-cluster-instance3",
    9. "EventCategories": [
    10. "creation"
    11. ]
    12. },
    13. {
    14. "SourceArn": "arn:aws:rds:us-east-1:123SAMPLE012:db:docdb-2018-12-11-21-08-23",
    15. "Message": "instance shutdown",
    16. "SourceType": "db-instance",
    17. "Date": "2018-12-11T21:25:01.245Z",
    18. "SourceIdentifier": "docdb-2018-12-11-21-08-23",
    19. "EventCategories": [
    20. "availability"
    21. ]
    22. },
    23. {
    24. "SourceArn": "arn:aws:rds:us-east-1:123SAMPLE012:db:docdb-2018-12-11-21-08-23",
    25. "Message": "instance restarted",
    26. "SourceType": "db-instance",
    27. "Date": "2018-12-11T21:25:11.441Z",
    28. "SourceIdentifier": "docdb-2018-12-11-21-08-23",
    29. "EventCategories": [
    30. "availability"
    31. ]
    32. }
    33. ]

    有关更多信息,请参阅 。