EC2 上的 MongoDB - 无法统计 /dev/xdf --- 没有这样的文件或目录

EC2 上的 MongoDB - 无法统计 /dev/xdf --- 没有这样的文件或目录

我正在关注在 EC2 上设置 MongoDB 的教程我被困在以下部分:

$ sudo mkfs.ext4 /dev/xdf

mke2fs 1.42.3 (14-May-2012)
Could not stat /dev/xdf --- No such file or directory

The device apparently does not exist; did you specify it correctly?

不确定如何进行-任何帮助都将不胜感激!

编辑:

$ ls /dev
autofs           disk  hvc4   loop1         mapper              ppp     sdg     tty1   tty17  tty24  tty31  tty39  tty46  tty53  tty60  ttyS1    vcs4   vcsa5        xvdh
block            fd    hvc5   loop2         mem                 psaux   sdh     tty10  tty18  tty25  tty32  tty4   tty47  tty54  tty61  ttyS2    vcs5   vcsa6        zero
btrfs-control    full  hvc6   loop3         net                 ptmx    shm     tty11  tty19  tty26  tty33  tty40  tty48  tty55  tty62  ttyS3    vcs6   vga_arbiter
char             fuse  hvc7   loop4         network_latency     pts     stderr  tty12  tty2   tty27  tty34  tty41  tty49  tty56  tty63  urandom  vcsa   vhost-net
console          hvc0  input  loop5         network_throughput  random  stdin   tty13  tty20  tty28  tty35  tty42  tty5   tty57  tty7   vcs      vcsa1  xen
core             hvc1  kmsg   loop6         null                root    stdout  tty14  tty21  tty29  tty36  tty43  tty50  tty58  tty8   vcs1     vcsa2  xvda1
cpu              hvc2  log    loop7         oldmem              sda1    tty     tty15  tty22  tty3   tty37  tty44  tty51  tty59  tty9   vcs2     vcsa3  xvdf
cpu_dma_latency  hvc3  loop0  loop-control  port                sdf     tty0    tty16  tty23  tty30  tty38  tty45  tty52  tty6   ttyS0  vcs3     vcsa4  xvdg

从答案来看,这些似乎是块设备的名称。在管理控制台中,它们看起来像是sdh,,sdfsdg有道理xdf不存在。

答案1

此错误意味着您尝试使用 ext4 文件系统格式化的块设备 /dev/xvdf 不存在。

请确保 /dev/xvdf 存在。它可能有其他名称,而不是 xvdf。

答案2

您是否按照教程中使用 ec2-run-instances 命令指定的方式启动了实例,还是使用了以不同方式启动的实例?

它指定了ec2-运行-实例命令:

$ ec2-run-instances ami-05355a6c -t m1.large -g [安全组] -k [密钥对] -b“/dev/xdf=:200:false:io1:1000”-b“/dev/xdg=:25:false:io1:250”-b“/dev/xdh=:10:false:io1:100” --ebs 优化 true

如果您启动了没有这些卷的实例,则可以创建它们并将其附加到您的实例,或者使用上述参数启动新实例。

市场上预建的 AMI可能会更容易让您入门,他们已经设置好了一切,并预先配置了许多优化。

相关内容