初探glusterfs-使用小结FAQ
2015/11/4 time 17:58
1、快速建立一个卷来提供服务的流程示例 【数据盘分区】 如果分区所在设备已经挂载,要先卸载并删掉现有系统。 yum install lvm2 xfsprogs -y pvcreate /dev/sdb vgcreate vg0 /dev/sdb lvcreate -l 100%FREE -n lv01 vg0 mkfs.xfs -f -i size=512 /dev/vg0/lv01 mkdir /data cat <<_EOF >>/etc/fstab UUID=$(blkid /dev/vg0/lv01 |cut -d‘"‘ -f2) /data xfs defaults 0 0 _EOF mount -a # df -h |grep data /dev/mapper/vg0-lv01 16T 33M 16T 1% /data 【配置服务】以在 10.60.200.11 上配置为例 yum install glusterfs-server service glusterd start chkconfig glusterd on 【配置集群】 gluster peer probe 10.60.200.12 每台集群节点上建立目录 mkdir /data/gv1/brick1 -p 【提供data域】 创建卷gv0作为主数据域: # gluster volume create gv0 replica 2 transport tcp 10.60.200.11:/data/gv2/brick1 10.60.200.12:/data/gv2/brick1 【启动】 # gluster volume start gv2 【查看现状】 # gluster volume info Volume Name: gv1 Type: Replicate Volume ID: 32b1866c-1743-4dd9-9429-6ecfdfa168a2 Status: Started Number of Bricks: 1 x 2 = 2 Transport-type: tcp Bricks: Brick1: 10.60.200.11:/data/gv1/brick1 Brick2: 10.60.200.12:/data/gv1/brick1 2、挂载时,可以使用参数来提供备用节点: mount.gluster -o backupvolfile-server=10.60.200.12 10.60.200.11:/gv1 /mnt/test 3、参数配置 实例: ovirt的优化做了如下工作: --- 优化后,配置将做如下调整: Options Reconfigured: diagnostics.count-fop-hits: on diagnostics.latency-measurement: on storage.owner-gid: 36 storage.owner-uid: 36 cluster.server-quorum-type: server cluster.quorum-type: auto network.remote-dio: enable cluster.eager-lock: enable performance.stat-prefetch: off performance.io-cache: off performance.read-ahead: off performance.quick-read: off auth.allow: * user.cifs: enable nfs.disable: off performance.readdir-ahead: on --- ---配置卷,以gv1为例: gluster volume set gv1 diagnostics.count-fop-hits on gluster volume set gv1 diagnostics.latency-measurement on gluster volume set gv1 storage.owner-gid 36 gluster volume set gv1 storage.owner-uid 36 gluster volume set gv1 cluster.server-quorum-type server gluster volume set gv1 cluster.quorum-type auto gluster volume set gv1 network.remote-dio enable gluster volume set gv1 cluster.eager-lock enable gluster volume set gv1 performance.stat-prefetch off gluster volume set gv1 performance.io-cache off gluster volume set gv1 performance.read-ahead off gluster volume set gv1 performance.quick-read off gluster volume set gv1 auth.allow \* gluster volume set gv1 user.cifs enable gluster volume set gv1 nfs.disable off ---配置卷 4、扩容 volume add-brick gv_test1 replica 2 10.60.200.21:/data/gv1/brick1 10.60.200.22:/data/gv1/brick1 # gluster volume info Volume Name: gv1 Type: Distributed-Replicate Volume ID: 32b1866c-1743-4dd9-9429-6ecfdfa168a2 Status: Started Number of Bricks: 2 x 2 = 4 Transport-type: tcp Bricks: Brick1: 10.60.200.11:/data/gv1/brick1 Brick2: 10.60.200.12:/data/gv1/brick1 Brick3: 10.60.200.21:/data/gv1/brick1 Brick4: 10.60.200.22:/data/gv1/brick1
原文地址:http://nosmoking.blog.51cto.com/3263888/1710133