ClusterStorage-236-6-配置分层与快照

0.实验环境图

1.配置文件系统

热区准备:分区,格式化,创建挂载目录,编辑挂载配置文件,进行挂载。

冷区准备:从瘦池划分LV,格式化,创建挂载目录,编辑挂载配置文件,进行挂载。

[root@servera ~]# fdisk /dev/sda
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0xb2f29343.

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): 
Using default response p
Partition number (1-4, default 1): 
First sector (2048-20971519, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-20971519, default 20971519): +2G
Partition 1 of type Linux and of size 2 GiB is set

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@servera ~]# mkfs.xfs -i size=512 /dev/sda1
meta-data=/dev/sda1              isize=512    agcount=4, agsize=131072 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=0        finobt=0
data     =                       bsize=4096   blocks=524288, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=0
log      =internal log           bsize=4096   blocks=2560, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
[root@servera ~]# mkdir -p /bricks/tier
[root@servera ~]# echo "/dev/sda1 /bricks/tier xfs defaults 0 0" >> /etc/fstab
[root@servera ~]# mount -a
 

[root@serverb ~]# fdisk /dev/sda
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x754d6769.

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): 
Using default response p
Partition number (1-4, default 1): 
First sector (2048-20971519, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-20971519, default 20971519): +2G
Partition 1 of type Linux and of size 2 GiB is set

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@serverb ~]# mkfs.xfs -i size=512 /dev/sda1
meta-data=/dev/sda1              isize=512    agcount=4, agsize=131072 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=0        finobt=0
data     =                       bsize=4096   blocks=524288, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=0
log      =internal log           bsize=4096   blocks=2560, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
[root@serverb ~]# mkdir -p /bricks/tier
[root@serverb ~]# echo "/dev/sda1 /bricks/tier xfs defaults 0 0" >> /etc/fstab
[root@serverb ~]# mount -a
 

[root@serverc ~]# lvcreate -V 2G -T vg/pool -n tier
  Logical volume "tier" created.

[root@serverc ~]# mkfs.xfs -i size=512 /dev/vg/tier
meta-data=/dev/vg/tier           isize=512    agcount=8, agsize=65520 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=0        finobt=0
data     =                       bsize=4096   blocks=524160, imaxpct=25
         =                       sunit=16     swidth=16 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=0
log      =internal log           bsize=4096   blocks=2560, version=2
         =                       sectsz=512   sunit=16 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
[root@serverc ~]# mkdir -p /bricks/tier
[root@serverc ~]# echo "/dev/vg/tier /bricks/tier xfs defaults 0 0" >> /etc/fstab
[root@serverc ~]# mount -a
 

[root@serverd ~]# lvcreate -V 2G -T vg/pool -n tier
  Logical volume "tier" created.
[root@serverd ~]# mkfs.xfs -i size=512 /dev/vg/tier
meta-data=/dev/vg/tier           isize=512    agcount=8, agsize=65520 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=0        finobt=0
data     =                       bsize=4096   blocks=524160, imaxpct=25
         =                       sunit=16     swidth=16 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=0
log      =internal log           bsize=4096   blocks=2560, version=2
         =                       sectsz=512   sunit=16 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
[root@serverd ~]# mkdir -p /bricks/tier
[root@serverd ~]# echo "/dev/vg/tier /bricks/tier xfs defaults 0 0" >> /etc/fstab
[root@serverd ~]# mount -a
 

2.配置分层

配置冷区,启动存储卷,添加分层到热区。

[root@servera ~]# gluster volume create tiervol replica 2 serverc:/bricks/tier/tiervol_n3 serverd:/bricks/tier/tiervol_n4
volume create: tiervol: success: please start the volume to access data
[root@servera ~]# gluster volume start tiervol
volume start: tiervol: success
[root@servera ~]# gluster volume tier tiervol attach servera:/bricks/tier/tiervol_n1 serverb:/bricks/tier/tiervol_n2
volume attach-tier: success
Tiering Migration Functionality: tiervol: success: Attach tier is successful on tiervol. use tier status to check the status.
ID: 4dad3b20-1a34-4192-8f84-cbdab958b2c6
 

3.配置快照

使用存储卷创建快照。

[root@servera ~]# gluster snapshot create snap-secvol secvol no-timestamp
snapshot create: success: Snap snap-secvol created successfully
 

猜你喜欢

转载自blog.csdn.net/ligan1115/article/details/88760574