怎么备份和恢复bucket元数据信息-成都快上网建站

怎么备份和恢复bucket元数据信息

这篇文章主要为大家展示了“怎么备份和恢复bucket元数据信息”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“怎么备份和恢复bucket元数据信息”这篇文章吧。

成都创新互联公司是一家专注于网站建设、成都做网站与策划设计,福贡网站建设哪家好?成都创新互联公司做网站,专注于网站建设十多年,网设计领域的专业建站公司;建站业务涵盖:福贡等地区。福贡做网站价格咨询:13518219792

1  

查看bucket下面的元数据列表

在ceph 10.2.9 下面操作,以修改Object名称为host的content_type属性为例,所有数据操作都有风险,请谨慎操作。

root@demohost:/home/demouser# radosgw-admin bi list --bucket=test
[
    {
        "type": "plain",
        "idx": "host",
        "entry": {
            "name": "host", #object名称
            "instance": "",
            "ver": {
                "pool": 60,
                "epoch": 1
            },
            "locator": "",
            "exists": "true",
            "meta": {
                "category": 1,
                "size": 254,
                "mtime": "2017-08-30 07:46:16.956870Z",
                "etag": "99a8629776211452eb4b9c3e6333a426",
                "owner": "s3user",
                "owner_display_name": "s3user",
                "content_type": "text\/plain", #Object对应的content_type属性
                "accounted_size": 254
            },
            "tag": "0a6967a5-2c76-427a-99c6-8a788ca25034.54133.2084",
            "flags": 0,
            "pending_map": [],
            "versioned_epoch": 0
        }
    }
]
2  

查看对应Object的bucket元数据信息

root@demohost:/home/demouser# radosgw-admin bi get --bucket=test --object=host

{
    "type": "plain",
    "idx": "host",
    "entry": {
        "name": "host",
        "instance": "",
        "ver": {
            "pool": 60,
            "epoch": 1
        },
        "locator": "",
        "exists": "true",
        "meta": {
            "category": 1,
            "size": 254,
            "mtime": "2017-08-30 07:46:16.956870Z",
            "etag": "99a8629776211452eb4b9c3e6333a426",
            "owner": "s3user",
            "owner_display_name": "s3user",
            "content_type": "text\/plain",
            "accounted_size": 254
        },
        "tag": "0a6967a5-2c76-427a-99c6-8a788ca25034.54133.2084",
        "flags": 0,
        "pending_map": [],
        "versioned_epoch": 0
    }
}
root@demohost:/home/demouser# radosgw-admin bi get --bucket=test --object=host > host.bi #导出(备份)到本地
3  

修改对应Object的元数据

root@demohost:/home/demouser# cat host.bi
{
    "type": "plain",
    "idx": "host",
    "entry": {
        "name": "host",
        "instance": "",
        "ver": {
            "pool": 60,
            "epoch": 1
        },
        "locator": "",
        "exists": "true",
        "meta": {
            "category": 1,
            "size": 254,
            "mtime": "2017-08-30 07:46:16.956870Z",
            "etag": "99a8629776211452eb4b9c3e6333a426",
            "owner": "s3user",
            "owner_display_name": "s3user",
            "content_type": "jpg\/plain", #随便改了个jpg
            "accounted_size": 254
        },
        "tag": "0a6967a5-2c76-427a-99c6-8a788ca25034.54133.2084",
        "flags": 0,
        "pending_map": [],
        "versioned_epoch": 0
    }
}

root@demohost:/home/demouser# radosgw-admin bi put --bucket=test --object=host < host.bi #导入修改后的内容(恢复)
4  

查看修改结果

root@demohost:/home/demouser# radosgw-admin bi get --bucket=test --object=host
{
    "type": "plain",
    "idx": "host",
    "entry": {
        "name": "host",
        "instance": "",
        "ver": {
            "pool": 60,
            "epoch": 1
        },
        "locator": "",
        "exists": "true",
        "meta": {
            "category": 1,
            "size": 254,
            "mtime": "0.000000",
            "etag": "99a8629776211452eb4b9c3e6333a426",
            "owner": "s3user",
            "owner_display_name": "s3user",
            "content_type": "jpg\/plain", #修改完成
            "accounted_size": 254
        },
        "tag": "0a6967a5-2c76-427a-99c6-8a788ca25034.54133.2084",
        "flags": 0,
        "pending_map": [],
        "versioned_epoch": 0
    }
}


root@demohost:/home/demouser# radosgw-admin bi list --bucket=test

[
    {
        "type": "plain",
        "idx": "host",
        "entry": {
            "name": "host",
            "instance": "",
            "ver": {
                "pool": 60,
                "epoch": 1
            },
            "locator": "",
            "exists": "true",
            "meta": {
                "category": 1,
                "size": 254,
                "mtime": "0.000000",
                "etag": "99a8629776211452eb4b9c3e6333a426",
                "owner": "s3user",
                "owner_display_name": "u-n4999",
                "content_type": "jpg\/plain",  #修改完成
                "accounted_size": 254
            },
            "tag": "0a6967a5-2c76-427a-99c6-8a788ca25034.54133.2084",
            "flags": 0,
            "pending_map": [],
            "versioned_epoch": 0
        }
    }
]

以上是“怎么备份和恢复bucket元数据信息”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注创新互联行业资讯频道!


网页标题:怎么备份和恢复bucket元数据信息
路径分享:http://kswjz.com/article/gjehcj.html
扫二维码与项目经理沟通

我们在微信上24小时期待你的声音

解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流