简体   繁体   English

Azure 存储 - 数据湖生命周期管理问题

[英]Azure Storage - Data Lake Lifecycle Management question

Using a lifecycle management policy to move the contents of a container to archive from cool access tier.I'm trying the following policy in the hopes that it will move all files in that container to archive tier after one day but it's not working.使用生命周期管理策略将容器的内容从酷访问层移动到存档。我正在尝试以下策略,希望它会在一天后将该容器中的所有文件移动到存档层,但它不起作用。 I've set the selection criteria "after one day of not being used".我已经设置了“一天不使用后”的选择标准。

Here's the json code: { "rules": [ { "enabled": true, "name": "move to cool storage", "type": "Lifecycle", "definition": { "actions": { "baseBlob": { "tierToArchive": { "daysAfterLastAccessTimeGreaterThan": 1 } } }, "filters": { "blobTypes": [ "blockBlob" ], "prefixMatch": [ "/amcont1" ] } } } ] }这是 json 代码: { "rules": [ { "enabled": true, "name": "move to cool storage", "type": "Lifecycle", "definition": { "actions": { "baseBlob": { "tierToArchive": { "daysAfterLastAccessTimeGreaterThan": 1 } } }, "filters": { "blobTypes": [ "blockBlob" ], "prefixMatch": [ "/amcont1" ] } } } ] }

I'm checking the container after one day and two days and nothing has changed, the access tier still remains the same, cool instead of archive.一天两天后我正在检查容器,没有任何变化,访问层仍然保持不变,很酷而不是存档。 Is there a way to test this interactively?有没有办法以交互方式测试它?

You also need to give the container name in "prefixMatch" value to implement the rule.您还需要在“prefixMatch”值中提供container name以实施规则。

在此处输入图像描述

Try the below given rule and check the result.尝试以下给定的规则并检查结果。 Change the values as per your storage account.根据您的存储帐户更改值。 This should work fine.这应该可以正常工作。

{
  "enabled": true,
  "name": "last-accessed-one-day-ago",
  "type": "Lifecycle",
  "definition": {
    "actions": {
      "baseBlob": {
        "tierToArchive": {
          "daysAfterLastAccessTimeGreaterThan": 1
        }
      }
    },
    "filters": {
      "blobTypes": [
        "blockBlob"
      ],
      "prefixMatch": [
        "mycontainer/logfile"
      ]
    }
  }
}

Refer: Move data based on last accessed time参考: 根据上次访问时间移动数据

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM