分佈式文件系統glusterfs

塊存儲:數據庫

單機存儲:硬盤+LVM
直連存儲:磁盤陣列(主機插卡PCI-E用專業的線),數據庫用得比較多。
存儲區域網:SAN(FC-SAN)主機用HBA卡centos

分佈式文件系統:
安裝glusterfs
兩臺虛擬機同時
rpm -ivf https://mirrors.aliyun.com/epel/epel-release-latest-6.noarch.rpm
yum install centos-release-gluster
yum install glusterfs-servertcp

一臺信任另一臺
gluster peer probe 192.168.56.21分佈式

查看信任
gluster peer statuside

#######################################################
分佈式卷
A建立目錄
mkdir /data/exp1 -p
B建立目錄
mkdir /data/exp2 -p測試

A操做
建立分佈式卷test-volume(測試加proce由於只有一個磁盤,正常會新建磁盤)
gluster volume create test-volume 192.168.56.20://data/exp1 192.168.56.21://data/exp2 forceorm

查看卷信息
gluster volume infoserver

Volume Name: test-volume
Type: Distribute
Volume ID: 5330993e-7ef2-47a2-8a1c-b44bc5601fb2
Status: Created
Snapshot Count: 0
Number of Bricks: 2
Transport-type: tcp
Bricks:
Brick1: 192.168.56.20:/data/exp1
Brick2: 192.168.56.21:/data/exp2
Options Reconfigured:
transport.address-family: inet
performance.readdir-ahead: on
nfs.disable: onip

#######################################################
建立複製卷(raid1)
A建立目錄
mkdir /data/exp3 -p
B建立目錄
mkdir /data/exp4 -p
gluster volume create repl-volume replica 2 transport tcp 192.168.56.20://data/exp3 192.168.56.21://data/exp4 forceget

#######################################################
建立調帶卷(raid0)

A建立目錄
mkdir /data/exp5 -p
B建立目錄
mkdir /data/exp6 -p
gluster volume create raid0-volume stripe 2 transport tcp 192.168.56.20://data/exp5 192.168.56.21://data/exp6 force

#######################################################
查看卷的狀態
gluster volume status

啓動卷
[root@master ~]# gluster volume start raid0-volume
volume start: raid0-volume: success
[root@master ~]# gluster volume start repl-volume
volume start: repl-volume: success
[root@master ~]# gluster volume start test-volume
volume start: test-volume: success

#######################################################
掛載卷
建立掛載點
mkdir /mnt/g1 /mnt/g2 /mnt/g3
mount.glusterfs 192.168.56.20:/test-volume /mnt/g1
mount.glusterfs 192.168.56.20:/repl-volume /mnt/g2
mount.glusterfs 192.168.56.20:/raid0-volume /mnt/g3

#######################################################
測試分佈式卷,會寫在其中一個
echo 1 > /mnt/g1/test1.txt

測試複製卷,兩個都會寫
echo 1 > /mnt/g2/test1.txt

測試調帶卷,每一個都寫一部分
man tcp > /mnt/g3/tcp.man

#######################################################
生產建立分佈式複製卷(兩臺都有數據,在不一樣的文件夾中)

A建立目錄
mkdir /exp3
mkdir /exp4
B建立目錄
mkdir /exp3
mkdir /exp4

gluster volume create hehe1-volume replica 2 transport tcp 192.168.56.20:/exp3 192.168.56.21:/exp3 192.168.56.20:/exp4 192.168.56.21:/exp4 force

gluster volume start hehe1-volume

mkdir /mnt/g7
mount.glusterfs 192.168.56.20:/hehe1-volume /mnt/g7

man tcp > /mnt/g7/tcp1.txt

相關文章
相關標籤/搜索