Amazon EFS是一种弹性文件系统,可提供简单、可扩展、完全托管的弹性 NFS 文件系统。关于NFS可以了简单理解为网络磁盘分区。
Amazon EFS可以在控制台或 AWS CLI 创建文件系统,还可以用编程的方式访问,如:AWS SDKs 或 Amazon EFS API。
关于Amazon EFS创建文件系统的API官方解析在这里:https://docs.aws.amazon.com/zh_cn/efs/latest/ug/API_CreateFileSystem.html
关于使用AWS CLI,官方提供的小案例:例如,以下 create-file-system
命令在 us-west-2
AWS 区域创建一个文件系统。该命令指定 MyFirstFS
作为创建令牌。
$ aws efs create-file-system \
--creation-token MyFirstFS \
--performance-mode generalPurpose \
--throughput-mode bursting \
--region us-west-2 \
--tags Key=Name,Value="Test File System" Key=developer,Value=rhoward \
--profile adminuser
这里定义了令牌,性能模式(creation-token),吞吐量模式(throughput-mode),区域(region),标签(tags).
要删除EFS要两大步:
删除挂载目标
用describe-file-systems查询文件系统列表,用describe-mount-targets查询挂载点,用delete-mount-target删除挂载点
$ aws efs describe-file-systems \
--profile adminuser \
--region aws-region
$ aws efs describe-mount-targets \
--file-system-id file-system-ID \
--profile adminuser \
--region aws-region
$ aws efs delete-mount-target \
--mount-target-id ID-of-mount-target-to-delete \
--profile adminuser \
--region aws-region
删除文件系统
用delete-file-system删除文件系统
$ aws efs delete-file-system \
--file-system-id ID-of-file-system-to-delete \
--region aws-region \
--profile adminuser
直接挂载
用create-mount-target创建挂载目标,用describe-mount-targets查询挂载目标,linux端用mount命令挂载
$ aws efs create-mount-target \
--file-system-id file-system-id \
--subnet-id subnet-id \
--security-group ID-of-the-security-group-created-for-mount-target \
--region aws-region \
--profile adminuser
$ aws efs describe-mount-targets \
--file-system-id file-system-ID \
--profile adminuser \
--region aws-region
$ sudo mount \
-t nfs \
-o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport \
mount-target-DNS:/ ~/efs-mount-point
通过EFS 访问点挂载
$ aws efs create-access-point --file-system-id fs-01234567 --client-token 010102020-3
$ sudo mount -t efs -o tls,accesspoint=access-point-id file-system-id efs-mount-point
用modify-mount-target-security-groups修改挂载目标安全组,每个挂载目标都会有关联的网络接口,该操作就是修改网络接口的安全组
$ aws efs modify-mount-target-security-groups \
--mount-target-id mount-target-ID-whose-configuration-to-update \
--security-groups security-group-ids-separated-by-space \
--region aws-region-where-mount-target-exists \
--profile adminuser
用create-access-point创建访问点,用delete-access-point删除访问点。
aws efs create-access-point \
--file-system-id fs-01234567 \
--client-token 010102020-3
aws efs delete-access-point \
--access-point-id fsap-092e9f80b3fb5e6f3 \
--client-token 010102020-3
Amazon FSx 通过为工作负载提供本机兼容性和功能集(如基于 Microsoft Windows 的存储、高性能计算、机器学习和电子设计自动化),提供了完全托管的第三方文件系统。Amazon FSx 支持两种文件系统类型:Lustre 和 Windows File Server。
Lustre是一个开源、分布式并行文件系统软件平台,具有高可扩展、高性能、高可用等特点。Lustre的可伸缩体系结构具有三个主要组成部分。元数据服务器,对象存储服务器和客户端。
官网的架构图:
制作MDT
mkfs.lustre \
--mdt \
--index=0 \
--fsname=lustre \
--failnode=xxx.xxx.xxx.xx@tcp \
--mgsnode=xxx.xxx.xxx.xx@tcp \
--mgsnode=xxx.xxx.xxx.xx@tcp \
--reformat \
--verbose \
/dev/mapper/mdt
制作MGT
mkfs.lustre \
--mdt \
--index=0 \
--fsname=lustre \
--failnode=xxx.xxx.xxx.xx@tcp \
--mgsnode=xxx.xxx.xxx.xx@tcp \
--mgsnode=xxx.xxx.xxx.xx@tcp \
--reformat \
--verbose \
/dev/mapper/mgt
制作OST
mkfs.lustre \
--ost \
--index=0 \
--fsname=lustre \
--failnode=xxx.xxx.xxx.xx@tcp \
--mgsnode=xxx.xxx.xxx.xx@tcp \
--mgsnode=xxx.xxx.xxx.xx@tcp \
--reformat \
--verbose \
/dev/mapper/OST0001
其他就不继续讨论了,核心不是介绍Lustre
https://docs.aws.amazon.com/zh_cn/fsx/latest/LustreGuide/getting-started-step1.html
如上面的Lustre组件图一样,想要使用Amazon FSx for Lustre 文件系统,首先安装开源Lustre客户端。这里截取官方提供的AmazonLinux2的安装方法,更多安装方法:https://docs.aws.amazon.com/zh_cn/fsx/latest/LustreGuide/install-lustre-client.html
#查看内核
uname -r
#跟新内核
#4.14.104-95.84.amzn2.x86_64 基于x86的EC2实例,
#或4.14.181-142.260.amzn2.aarch64 或更高可以跳过步骤
sudo yum -y update kernel && sudo reboot
#安装客户端
sudo amazon-linux-extras install -y lustre2.10
更平常挂载一样,使用mount命令,如:
sudo mount -t lustre -o noatime,flock file_system_dns_name@tcp:/mountname /mnt/fsx
查看
df
AWS Config 提供了关于您的 AWS 账户中 AWS 资源配置的详细信息。通过AWS Config我们可以很好得监控AWS账号中的资源使用,对AWS资源进行监控。随着对应用程序的需求的不断增加,记录您的 AWS 资源的需求也在不断增加。AWS Config 可以帮助您监督自己的应用程序资源。
AWS Config在以下情况可以帮助你进行资源监控:
df
AWS Config 提供了关于您的 AWS 账户中 AWS 资源配置的详细信息。通过AWS Config我们可以很好得监控AWS账号中的资源使用,对AWS资源进行监控。随着对应用程序的需求的不断增加,记录您的 AWS 资源的需求也在不断增加。AWS Config 可以帮助您监督自己的应用程序资源。
AWS Config在以下情况可以帮助你进行资源监控:
因篇幅问题不能全部显示,请点此查看更多更全内容