代码之家  ›  专栏  ›  技术社区  ›  Stefan Papp

如何获取MapR文件系统上的目录卷?

  •  0
  • Stefan Papp  · 技术社区  · 8 年前

    我想通过命令行在mapr FS中找到目录/mapr/clustername/dir1/dir2的卷

    2 回复  |  直到 8 年前
        1
  •  1
  •   AaronBeers    8 年前

    首先,您需要查找文件的主FID(或目录的FID),注意FID中包含的容器ID,然后转储容器的信息,该信息将列出它所属的卷。

    例如,第1步,列出FID:

    [root@tssperf01 ~]# hadoop mfs -ls /path/to/file
    Found 1 items
    -rwxr-xr-x  Z U U   3 root root          0 2018-09-05 09:38  268435456 /path/to/file
               p 2049.404.269954  tssperf08.lab:5660 tssperf01.lab:5660 tssperf02.lab:5660
    [root@tssperf01 ~]# hadoop mfs -lsd /path/to/dir
    Found 1 items
    drwxr-xr-x  Z U U   - root root          0 2018-09-05 09:40  268435456 /path/to/dir
               p 2049.408.269956  tssperf08.lab:5660 tssperf01.lab:5660 tssperf02.lab:5660
    

    在上述两种情况下,您应该查找file/dir路径后面的行,该行从缩进开始,然后是“primary”FID的字母“p”。容器ID是FID中的第一个数字,在本例中为2049。

    然后转储容器的信息并查找VolumeName字段,例如:

    [root@tssperf01 ~]# maprcli dump containerinfo -ids 2049 -json
    {
        "timestamp":1536161901817,
        "timeofday":"2018-09-05 09:38:21.817 GMT-0600",
        "status":"OK",
        "total":1,
        "data":[
            {
                "ContainerId":2049,
                ...
                "VolumeName":"mapr.cluster.root",
                ...
            }
        ]
    }
    
        2
  •  0
  •   Stefan Papp    8 年前

    要使用的命令:

    maprcli volume info -path /dir1/dir2 -json
    

    如果这是卷的根目录,则会获得卷信息。如果目录是子目录,则会收到错误消息。去尽可能多的目录,你需要找到你的挂载点

    推荐文章