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

发布时间:2021-11-19 16:48:24 作者:小新
来源:亿速云 阅读:206

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

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元数据信息”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注亿速云行业资讯频道!

推荐阅读:
  1. elasticsearch的备份和恢复
  2. 实验:备份mbr和恢复

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

bucket

上一篇:JAVA泛型通配符T,E,K,V有什么区别

下一篇:Java反射机制使用方法有哪些

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》