为什么在使用 ec2-consistent-snapshot 调用时 xfs_freeze 找不到此目录?

jdw*_*jdw 0 xfs amazon-ec2

在我的管理服务器上:

/usr/bin/ec2-consistent-snapshot --freeze-filesystem /mnt/websites --description "FOO-DATA $(date)" vol-d84bhi64 --region eu-west-1
/mnt/websites: No such file or directory
ec2-consistent-snapshot: ERROR: xfs_freeze -f /mnt/websites: failed(256)
Run Code Online (Sandbox Code Playgroud)

在有问题的卷附加到的服务器上:

[root@foo ec2-user]# df -TH
Filesystem    Type     Size   Used  Avail Use% Mounted on
/dev/xvda1    ext4     8.5G   1.2G   7.2G  15% /
tmpfs        tmpfs     880M    50k   880M   1% /dev/shm
/dev/xvdf      xfs      54G   321M    54G   1% /mnt

[root@foo ec2-user]# ls -al /mnt
total 4
drwxr-xr-x  4 root           root     45 Sep  8 12:36 .
dr-xr-xr-x 22 root           root   4096 Sep 13 15:07 ..
drwxr-xr-x  3 mysql          mysql    16 Sep  8 12:36 mysql
-rw-r--r--  1 root           root      0 Sep  8 12:11 stuff
drwsrwsr-x  5 someuser       apache   37 Sep 21 15:41 websites
Run Code Online (Sandbox Code Playgroud)

在机器上运行 xfs_freeze 可以工作:

[root@fb ec2-user]# xfs_freeze -f /mnt/websites
[root@fb ec2-user]# xfs_freeze -u /mnt/websites
Run Code Online (Sandbox Code Playgroud)

Eri*_*ond 5

如果使用--freeze-filesystem(或--xfs-filesystem) 选项,则ec2-consistent-snapshot程序必须在安装文件系统的实例上运行。否则,它无法针对该文件系统运行 xfs_freeze。

我是ec2-consistent-snapshot. 我会考虑在文档中更清楚地说明这个要求。

有一个已提交的补丁可以ec2-consistent-snapshot在远程系统上工作(ssh运行诸如 之类的命令xfs_freeze)。这将有助于减少在实例上拥有 AWS 凭证的现有要求。我忘记了为什么补丁没有被合并,但会再看一遍。

如果您试图避免在实例上使用 AWS 凭证,我写了一篇文章来限制您的风险:

使用 AWS Identity and Access Management (IAM) 提高 EC2 的安全性
http://alestic.com/2010/09/aws-iam