[root@storage2-f15 ~]# vgcreate vg0 /dev/vdb3
A volume group called vg0 already exists.
[root@storage2-f15 ~]# vgextend vg0 /dev/vdb3
Volume group "vg0" successfully extended
[root@storage2-f15 ~]# lvcreate -L 1G -i 2 -n lv0 vg0
Using default stripesize 64.00 KiB
Logical volume "lv0" created
[root@storage2-f15 ~]# dmsetup table
VolGroup-lv_swap: 0 2097152 linear 252:2 17844224
VolGroup-lv_root: 0 17842176 linear 252:2 2048
vg0-lv0: 0 2097152 striped 2 128 252:18 2048 252:19 2048
新建分区:
cat << ENDF | fdisk /dev/vdb
n
p
1
+2G
w
ENDF
storage1:
ls /dev/vdb
ls /dev/vdb*
fdisk /dev/vdb
rpm -qa | grep gluster
pvcreate /dev/vdb1
vgcreate gfsvg0 /dev/vdb1
lvcreate -L 1G -T gfsvg0/pool0
lvcreate -V 10G -T gfsvg0/pool0 -n gfslv0
lvs
mkfs.ext4 /dev/gfsvg0/gfslv0
mkdir /brick
mount /dev/gfsvg0/gfslv0 /brick/
setenforce 0
iptables -F
vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
172.25.15.10 storage1-f15.example.com storage1-f15
172.25.15.11 storage2-f15.example.com storage2-f15
172.25.15.12 storage3-f15.example.com storage3-f15
yum install glusterfs-server -y
service glusterfs start
service glusterd start
gluster peer probe storage2-f15
gluster peer probe storage3-f15
gluster peer status
gluster peer detach storage3-f15
gluster peer status
gluster volume create testvol1 storage1-f15:/brick/vol1 storage2-f15:/brick/vol1
#分布式
gluster volume start testvol1
ls /brick/vol1/
gluster volume add-brick testvol1 storage3-f15:/brick/vol1
ls /brick/vol1/
gluster volume rebalance testvol1 fix-layout start
ls /brick/vol1/
gluster volume rebalance testvol1 start
ls /brick/vol1/
----------------------------------------
iscis1:
yum install glusterfs-fuse -y
mount 172.25.0.10:/testvol1 /mnt
ls /mnt
touch /mnt/file{1..10}
ls /mnt
srorage1: ls /brick/vol2
storage2: ls /brick/vol2
touch /mnt/file{20..50}
ls /mnt
srorage1: ls /brick/vol2
storage2: ls /brick/vol2
-----------------------------------------
storage1:
ls /tmp/.ICE-unix/
cat /etc/hosts
exit
yum list | grep gluster
ll /etc/yum.repos.d/
cat /etc/yum.repos.d/gluster.repo
gluster volume create testvol2 replica 2 storage1-f15:/brick/vol2 storage2-f15:/brick/vol2 #条带式复制
gluster volume start testvol2