【问题标题】:How do I get the volume of the directory on the MapR filesystem?如何获取 MapR 文件系统上目录的卷?
【发布时间】:2018-09-05 09:29:59
【问题描述】:

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

【问题讨论】:

    标签: mapr


    【解决方案1】:

    首先,您需要查找文件的主 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
    

    在上述两种情况下,您应该查找文件/目录路径后面的行,该行开始缩进,然后是字母“p”,表示“主要”FID。容器 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】:

      要使用的命令:

      maprcli volume info -path /dir1/dir2 -json
      

      如果这是卷的根目录,您将获得卷信息。如果该目录是子目录,则会收到一条错误消息。找到尽可能多的目录以找到挂载点

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-05-08
        • 2021-09-13
        • 1970-01-01
        • 2012-09-16
        相关资源
        最近更新 更多