amazon-efs - 如何找到挂载到特定 EFS 的所有 EC2 实例

标签 amazon-efs

我需要用加密的 EFS 替换 EFS。计划是将其所有内容复制到 S3,使用 S3 内容填充新 EFS,然后卸载旧 EFS 并将新 EFS 安装在同一位置。

问题是,我不知道如何找到挂载到该特定 EFS 的所有 EC2 实例。我已经浏览了 aws efs 文档,但没有任何东西可以满足我的需求。

最佳答案

没有一个地方或命令可以列出挂载 EFS 的 ec2 实例。

我建议做的下一个最好的事情是使用带有 EFS 指标的 Cloudwatch 仪表板。 There is one metric that shows you the number of EC2 instances that are connected to your EFS share: It is the Sum statistic of the ClientConnections metric under EFS

您可以轻松创建 Cloudwatch 仪表板 -

  • 转到您的 CloudWatch 控制台 -> Dashboard Create Dashboard 按钮。
  • 将您的仪表板命名为“EFS”,然后单击创建仪表板。
  • 下一步看类型选择,选择Line(第一个)点击Configure:
    enter image description here
  • 然后在底部的 All Metrics 选项卡下选择 EFS。
  • 单击文件系统指标
  • 然后在您要离开的非加密 EFS 驱动器名称下选择客户端连接。然后单击创建小部件按钮。
    enter image description here

  • 该图将是与之的连接数。当您将 EC2 从非加密驱动器移开时,这个数字应该会下降。

    最终的仪表板将如下所示:

    enter image description here

    关于amazon-efs - 如何找到挂载到特定 EFS 的所有 EC2 实例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55697577/

    相关文章:

    amazon-web-services - 在 ECS 中附加卷 EFS

    amazon-web-services - lambda + efs - 安装与接入点

    将文件写入 EFS docker 卷时 Python 进程没有响应

    docker - 在 kubernetes/k8s StatefulSet 中使用 nfs/efs 作为 PersistentVolume 和普通卷有什么区别?

    amazon-web-services - AWS EBS 快照到 EFS

    amazon-web-services - Terraform:如何将 EFS 访问点挂载到 EC2?

    terraform - 将 EFS 卷附加到 Fargate?

    terraform - 使用 Terraform 将 EFS 挂载到 AWS Fargate - PlatformTaskDefinitionIncompatibilityException 错误 :

    amazon-web-services - 在 MacBook Pro 上安装 EFS

    amazon-web-services - 如何将 AWS EFS 挂载到 Macbook 或本地计算机