0.实验前的环境检查与配置
[student@workstation ~]$ lab snapshots setup
1.测试删除
gluster snapshot delete tigers删除快照。
[root@serverc ~]# gluster snapshot delete tigers
Deleting snap will erase all the information about the snap. Do you still want to continue? (y/n) y
snapshot delete: tigers: snap removed successfully
2.测试克隆
gluster snapshot clone otters elephants克隆快照。 gluster volume start otters启用快照。
[root@serverc ~]# gluster snapshot clone otters elephants
snapshot clone: success: Clone otters created successfully
[root@serverc ~]# gluster volume start otters
volume start: otters: success
3.配置参数
gluster snapshot config snap-max-hard-limit 64 snap-max-soft-limit 75设置允许的快照数及启动监测的百分比。gluster snapshot config auto-delete enable开启自动删除功能。gluster snapshot config activate-on-create enable开启自动创建功能。
[root@serverc ~]# gluster snapshot config snap-max-hard-limit 64 snap-max-soft-limit 75
Changing snapshot-max-hard-limit will limit the creation of new snapshots if they exceed the new snapshot-max-hard-limit.
If Auto-delete is enabled, snap-max-soft-limit will trigger deletion of oldest snapshot, on the creation of new snapshot, when the snap-max-soft-limit is reached.
Do you want to continue? (y/n) y
snapshot config: snap-max-hard-limit & snap-max-soft-limit for system set successfully
[root@serverc ~]# gluster snapshot config auto-delete enable
snapshot config: auto-delete successfully set
[root@serverc ~]# gluster snapshot config activate-on-create enable
snapshot config: activate-on-create successfully set
4.启动服务
umount /mnt/zoo取消挂载。gluster volume set zoo features.uss enable启动用户服务功能。mount /mnt/zoo重新挂载。
[root@workstation ~]# umount /mnt/zoo
[root@serverc ~]# gluster volume set zoo features.uss enable
volume set: success
[root@workstation ~]# mount /mnt/zoo
5.创建快照
gluster snapshot create snakes zoo no-timestamp使用存储卷创建快照。
[root@serverc ~]# gluster snapshot create snakes zoo no-timestamp
snapshot create: success: Snap snakes created successfully
6.配置调度器
gluster volume set all cluster.enable-shared-storage enable启用存储卷共享功能。setsebool -P cron_system_cronjob_use_shares 1开启安全计划功能。snap_scheduler.py init初始化调度器。serverd参照serverc操作。 snap_scheduler.py enable启动调度器。 snap_scheduler.py add animals "0 4 * * *" zoo设置计划参数。
[root@serverc ~]# gluster volume set all cluster.enable-shared-storage enable
volume set: success
[root@serverc ~]# setsebool -P cron_system_cronjob_use_shares 1
[root@serverd ~]# setsebool -P cron_system_cronjob_use_shares 1
[root@serverc ~]# snap_scheduler.py init
snap_scheduler: Successfully initialised snapshot scheduler for this node
[root@serverd ~]# snap_scheduler.py init
snap_scheduler: Successfully initialised snapshot scheduler for this node
[root@serverc ~]# snap_scheduler.py enable
snap_scheduler: Snapshot scheduling is enabled
[root@serverc ~]# snap_scheduler.py add animals "0 4 * * *" zoo
snap_scheduler: Successfully added snapshot schedule
7.任务测评
lab snapshots grade进行测评。包括:用户服务功能,创建快照,启用快照,最大快照数,监测触发数,自动删除功能,自动创建功能,调度器启用,调度器配置,克隆等。
[student@workstation ~]$ lab snapshots grade
Grading the student's work:
· Checking if user-servicable snaps are enabled............... PASS
· Checking presence of snakes snapshot........................ PASS
· Checking if elephants is activated.......................... PASS
· Checking if snakes is activated............................. PASS
· Checking if tigers has been deleted......................... PASS
· Checking snapshot hard-limit................................ PASS
· Checking snapshot soft-limit................................ PASS
· Checking for auto-delete of snapshots....................... PASS
· Checking auto-activation of snapshots....................... PASS
· Checking if snapshot scheduling is enabled on serverc....... PASS
· Checking if snapshot scheduling is enabled on serverd....... PASS
· Checking if animals has been added.......................... PASS
· Checking if schedule is set correctly....................... PASS
· Checking if otters has been created......................... PASS
· Checking if otters is active................................ PASS
· Checking if otters is actually a clone...................... PASS
Overall lab grade.............................................. PASS