NFS
詳細介紹參考《鳥哥的LINUX私房菜-服務器架設篇》第十三章
主要流程
server端配置
- 安裝兩個軟件:rpcbind和nfs-utils
- 配置/etc/exports
<DIR> *(rw,no_root_squash)
- 啓動nfs
/etc/init.d/rpcbind start
/etc/init.d/nfs start
/etc/init.d/nfslock start
chkconfig rpcbind on
chkconfig nfs on
chkconfig nfslock on
- 如果更新了/etc/exports文件,需要重新掛載
exportfs -arv
client端配置
- 安裝兩個軟件:rpcbind和nfs-utils
- 啓動相關服務
/etc/init.d/rpcbind start
/etc/init.d/nfslock start
- 查看服務器提供了哪些共享目錄
showmount -e hostname
- 建立掛載點並且掛載
mkdir -p <DIR>
mount -t nfs hostname:<DIR> <DIR>
umount <DIR> #卸載
glusterfs
官方文檔:http://gluster.readthedocs.io/en/latest/
Brick:對應一臺服務器上面的存儲空間
Volume:多個brick組成一個volume,對應於多臺服務器組成的存儲空間
Trusted Storage Pool:多臺服務器組成的服務器集羣
CENTOS安裝
https://wiki.centos.org/SpecialInterestGroup/Storage/gluster-Quickstart
http://gluster.readthedocs.io/en/latest/Quick-Start-Guide/Quickstart/
安裝到以下機器:hpc191、hpc192
#1.install on hpc191/hpc192
yum install centos-release-gluster
yum --enablerepo=centos-gluster*-test install glusterfs-server
service glusterd start
service glusterd status
#2.Configure the trusted pool
gluster peer probe hpc192 #on hpc191
gluster peer probe hpc191 #on hpc192
#3.Set up a GlusterFS volume
mkdir -p /euler/glusterfs/gv1 #on hpc191/hpc192
gluster volume create gv1 hpc191:<DIR>/gv1 hpc192:<DIR>/gv1 #on hpc191
gluster volume start gv1 #on hpc191
gluster volume info #on hpc191
#4.mount
mount -t glusterfs hpc191:/gv1 /glfs #on hpc191
mount -t glusterfs hpc192:/gv1 /glfs #on hpc192
擴展節點
新增加hpc193
#1.在client安裝
yum install centos-release-gluster
yum --enablerepo=centos-gluster*-test install glusterfs-server
service glusterd start
service glusterd status
#2.Configure the trusted pool,在hpc191或者hpc192執行
gluster peer probe hpc193
#3.add brick to volume
gluster volume add-brick gv1 hpc193:<DIR>/gv1
gluster volume status
#4.mount
mount -t glusterfs hpc193:/gv1 /glfs
#5.rebalance:add/delete brick 以後都需要rebalance
gluster volume rebalance gv1 fix-layout start #第一種方式:不遷移已有的數據
gluster volume rebalance gv1 start #第二種方式:遷移已有的數據
卸載
#hpc191
gluster volume stop gv1
gluster volume delete gv1
gluster peer detach hpc192
gluster peer detach hpc193
#hpc191/hpc192/hpc193
service glusferfsd stop
其他操作
service啓動
/etc/init.d/glusterd start
/etc/init.d/glusterd stop
/etc/init.d/glusterd status
pool操作
#add server to pool
gluster peer probe server
#status of pool
gluster peer status
#remove from pool
gluster peer detach server
volume操作
創建設置
類型包括:
Distributed
Striped
Distributed Striped
Distributed Replicated
Distributed Striped Replicated
Striped Replicated
Dispersed
Distributed Dispersed
其他操作
操作包括:
Tuning Volume Options
Configuring Transport Types for a Volume
Expanding Volumes
Shrinking Volumes
Replacing Bricks
Migrating Volumes
Rebalancing Volumes
Stopping Volumes
Deleting Volumes
Triggering Self-Heal on Replicate
Non Uniform File Allocation(NUFA)