glusterfs in centos 7

# hardward (space)
root=50g
/dev/sdb=2t


# yum install
yum update -y
hostnamectl set-hostname east-gfs-a231
vi /etc/hosts gfs1 gfs2
yum install chrony -y
systemctl enable chronyd
systemctl restart chronyd

yum install firewalld -y
systemctl enable firewalld
systemctl restart firewalld

firewall-cmd --remove-service=dhcpv6-client --permanent
yum install centos-release-gluster -y
yum install glusterfs gluster-cli glusterfs-libs glusterfs-server -y

# setup
pvcreate /dev/vdb
vgcreate vg_gluster /dev/vdb
lvcreate -L 2T -n brick1 vg_gluster
mkfs.xfs /dev/vg_gluster/brick1
mkdir -p /bricks/brick1
mount /dev/vg_gluster/brick1 /bricks/brick1
echo /dev/vg_gluster/brick1  /bricks/brick1    xfs     defaults    0 0 >> /etc/fstab

## 所有同屬一個儲存系統的節點都要執行 glusterd 的服務,並開於開機時就啟動,glusterd 是負責完成各個節點之間的通訊,也處理 Client 的請求。
systemctl enable  glusterd.service
systemctl start glusterd.service


firewall-cmd --add-port=24007-24009/tcp --permanent

# gluster add peer, execute once in anyone of peer
gluster peer probe gfs2
gluster peer status


gluster volume create  stripe_vol stripe 2  \
 gfs-01:/bricks/stripe_vol/brick \
 gfs-02:/bricks/stripe_vol/brick

gluster volume start stripe_vol


# nfs
systemctl enable rpcbind
systemctl restart rpcbind


firewall-cmd --add-service=nfs --permanent
firewall-cmd --add-service=rpc-bind --permanent
firewall-cmd --add-service=mountd --permanent


# selinux
yum install policycoreutils-python -y
cd /etc/selinux/targeted/modules
audit2allow -M glusterd_centos64 -l -i /var/log/audit/audit.log
semodule -i glusterd_centos64.pp

gluster volume info
gluster volume set stripe_vol nfs.disable off

# client
/etc/hosts add same host info with gluster server
gluster server firewall allow client to client
yum install glusterfs glusterfs-fuse -y
mount -t glusterfs  10.12.1.231:/stripe_vol/ /mnt/gfs

留言

熱門文章