zoukankan      html  css  js  c++  java
  • glusterfs 快照

    1、创建快照

    # gluster snapshot create trobvol-s1 trobvol 
    snapshot create: success: Snap trobvol-s1_GMT-2021.05.16-02.47.36 created successfully
    

    说明:
    trobvol-s1 : 快照名字
    trobvol: 卷名
    默认创建的快照带有时间戳,如果想要创建出来的快照不带有时间戳,可以在命令的最后加上no-timestamp

    # gluster snapshot create trobvol-s1 trobvol no-timestamp
    

    这种情况下,想要查看快照创建的时间,可以输入如下的命令:

    # gluster snapshot info trobvol-s1
    Snapshot                  : trobvol-s1
    Snap UUID                 : 7c63da82-9198-49d5-99ae-aab62da5cb7d
    Created                   : 2021-05-16 02:56:00 +0000
    Snap Volumes:
    
    	Snap Volume Name          : 08f8c1369bcf45798c4ccb9115033778
    	Origin Volume name        : trobvol
    	Snaps taken for trobvol      : 1
    	Snaps available for trobvol  : 255
    	Status                    : Stopped
    

    可以看到该快照的创建时间以及快照的状态。

    2、查看快照状态

    # gluster snapshot status
    

    或者list查看快照列表

    # gluster snapshot list
    

    默认情况下,快照创建出来是没有被激活的

    3、允许快照完全复制卷

    [root@hadoop4 ~]# gluster volume set  trobvol features.uss enable
    volume set: success
    [root@hadoop4 ~]# gluster volume  info trobvol
     
    Volume Name: trobvol
    Type: Replicate
    Volume ID: b43b3e13-5f8c-4ecf-b363-d90d41f508b9
    Status: Started
    Snapshot Count: 1
    Number of Bricks: 1 x 2 = 2
    Transport-type: tcp
    Bricks:
    Brick1: hadoop4:/data/brick1/brick7
    Brick2: k8s-node2:/data/brick1/brick5
    Options Reconfigured:
    features.uss: enable
    features.barrier: disable
    features.scrub-freq: hourly
    features.scrub: Active
    features.bitrot: on
    performance.client-io-threads: off
    nfs.disable: on
    transport.address-family: inet
    storage.fips-mode-rchecksum: on
    cluster.granular-entry-heal: on
    

    4、激活快照

    [root@hadoop4 ~]# gluster snapshot activate trobvol-s1
    Snapshot activate: trobvol-s1: Snap activated successfully
    [root@hadoop4 ~]# gluster snapshot info trobvol-s1
    Snapshot                  : trobvol-s1
    Snap UUID                 : 7c63da82-9198-49d5-99ae-aab62da5cb7d
    Created                   : 2021-05-16 02:56:00 +0000
    Snap Volumes:
    
    	Snap Volume Name          : 08f8c1369bcf45798c4ccb9115033778
    	Origin Volume name        : trobvol
    	Snaps taken for trobvol      : 1
    	Snaps available for trobvol  : 255
    	Status                    : Started
    

    5、查看快照的存储目录

    [root@k8s-node2 gluster_client_trb]# ls -d .snaps/trobvol-s1/
    .snaps/trobvol-s1/
    [root@k8s-node2 gluster_client_trb]# pwd
    /gluster_client_trb
    

    存储在挂载点下的.snaps,这是一个隐藏文件

    6、还原快照

    [root@hadoop4 ~]# gluster volume stop trobvol
    Stopping volume will make its data inaccessible. Do you want to continue? (y/n) y
    volume stop: trobvol: success
    [root@hadoop4 ~]# gluster snapshot restore trobvol-s1
    Restore operation will replace the original volume with the snapshotted volume. Do you still want to continue? (y/n) y
    Snapshot restore: trobvol-s1: Snap restored successfully
    [root@hadoop4 ~]# gluster volume start trobvol
    volume start: trobvol: success
    [root@hadoop4 ~]# gluster snapshot list // 快照还原就会被删除
    No snapshots present
    

    7、删除快照

    # gluster snapshot delete all // 删除所有快照
    
    记录学习和生活的酸甜苦辣.....哈哈哈
  • 相关阅读:
    打开安装 好的Microsoft Dynamics CRM 4.0 报错误为 Caller does not have enough privilege to set CallerOriginToken to the specified value 的解决办法
    基于 Windows Server 2008 的计算机对 Microsoft Dynamics CRM 4.0 的支持
    Microsoft Dynamics CRM 4.0 如何添加自定义按钮
    Microsoft Dynamics CRM 4.0 Plugin 取值,赋值,查询
    C# 中的 enum(枚举) 类型使用例子
    vue事件的绑定
    表单验证2
    node中模块
    node模块的引入
    node中的读文件
  • 原文地址:https://www.cnblogs.com/yjt1993/p/14773414.html
Copyright © 2011-2022 走看看