基本上搭建glusterfs都是用了2个副本,用来保证数据冗余

建立新卷,/export/test-vol目录不用事先建立,会自动建立的:

gluster volume create test-vol replica 2 transport tcp 172.16.8.5:/export/test-vol/ 172.16.8.6:/export/test-vol/  

如上建立新卷后,test-vol的属主是root,如果我们想基于gfs之上做个虚拟的vsftpd,建设用户是virtual.virtual,500.500

设置卷uid/gid属性:

gluster volume set test-vol storage.owner-uid 500  
gluster volume set test-vol storage.owner-gid 500  

设置卷的quota空间配额:

gluster volume quota test-vol enable  
gluster volume quota test-vol limit-usage / 10GB  
gluster volume quota test-vol limit-usage /path/in/volume 2G  
gluster volume set test-vol features.quota-timeout 30  
gluster volume quota test-vol list  
gluster volume quota test-vol list /path/in/volume  

去掉quota限制:

gluster volume quota test-vol remove /  
gluster volume quota test-Vol remove /path/in/volume  

优化tcp参数:

gluster volume set test-vol diagnostics.brick-log-level WARNING  
gluster volume set test-vol diagnostics.client-log-level WARNING  
gluster volume set test-vol nfs.enable-ino32 on  
gluster volume set test-vol nfs.addr-namelookup off  
gluster volume set test-vol nfs.disable on  
gluster volume set test-vol performance.cache-max-file-size 2MB  
gluster volume set test-vol performance.cache-refresh-timeout 4  
gluster volume set test-vol performance.cache-size 256MB  
gluster volume set test-vol performance.write-behind-window-size 4M  
gluster volume set test-vol performance.io-thread-count 32  

设置卷访问权限

gluster volume set test-vol auth.allow 192.168.2.*  
gluster volume set test-vol auth.reject 192.168.2.*  

监控

gluster volume profile  zfws-vol start  
gluster volume profile  zfws-vol info  
comments powered by Disqus