设为首页 收藏本站
查看: 1032|回复: 0

[经验分享] Glusterfs分布式存储的安装

[复制链接]

尚未签到

发表于 2019-2-1 10:39:51 | 显示全部楼层 |阅读模式
昨日小测了Glusterfs分布式存储系统,此次采用了官方最新版的glusterfs-3.0.2.tar.gz 具体安装配置如下:

一、操作系统和主机信息:
采用CentOS 5.2操作系统
client 192.168.1.9
Srv01 192.168.1.10
Srv02 192.168.1.11

客户和服务器端安装如下包:
rpm -ivh http://vault.centos.org/5.2/centosplus/x86_64/RPMS/kernel-2.6.18-92.1.6.el5.centos.plus.x86_64.rpm
rpm -ivh http://vault.centos.org/5.2/centosplus/x86_64/RPMS/kernel-devel-2.6.18-92.1.6.el5.centos.plus.x86_64.rpm
rpm -ivh http://vault.centos.org/5.2/centosplus/x86_64/RPMS/kernel-headers-2.6.18-92.1.6.el5.centos.plus.x86_64.rpm

二、客户端(client)配置:
yum install libibverbs-devel fuse-devel fuse fuse-libs
wget http://ftp.gluster.com/pub/gluster/glusterfs/3.0/LATEST/glusterfs-3.0.2.tar.gz
tar zxvf glusterfs-3.0.2.tar.gz
cd glusterfs-3.0.2
./configure --enable-fusermount
make && make install
ldconfig

验证:
glusterfs --version
mkdir -p /mnt/glusterfs

cat  /usr/local/etc/glusterfs/client-stor.vol
## file auto generated by /usr/local/bin/glusterfs-volgen (mount.vol)
# Cmd line:
# $ /usr/local/bin/glusterfs-volgen --name repstore --raid 1 Srv01:/glusterfs/b Srv02:/glusterfs/b Srv01:/glusterfs/c Srv02:/glusterfs/c Srv01:/glusterfs/d Srv02:/glusterfs/

# RAID 1
# TRANSPORT-TYPE tcp
volume Srv01-1
        type protocol/client
        option transport-type tcp/client
        option remote-host 192.168.1.10
        option remote-port 6996
        option remote-subvolume brick1
end-volume

volume Srv01-2
        type protocol/client
        option transport-type tcp/client
        option remote-host 192.168.1.10
        option remote-port 6996
        option remote-subvolume brick2
end-volume

volume Srv01-3
        type protocol/client
        option transport-type tcp/client
        option remote-host 192.168.1.10
        option remote-port 6996
        option remote-subvolume brick3
end-volume

volume Srv02-1
        type protocol/client
        option transport-type tcp/client
        option remote-host 192.168.1.11
        option remote-port 6996
        option remote-subvolume brick1
end-volume

volume Srv02-2
        type protocol/client
        option transport-type tcp/client
        option remote-host 192.168.1.11
        option remote-port 6996
        option remote-subvolume brick2
end-volume

volume Srv02-3
        type protocol/client
        option transport-type tcp/client
        option remote-host 192.168.1.11
        option remote-port 6996
        option remote-subvolume brick3
end-volume

volume mirror-0
        type cluster/replicate
        subvolumes Srv01-1 Srv02-1
end-volume

volume mirror-1
        type cluster/replicate
        subvolumes Srv01-2 Srv02-2
end-volume

volume mirror-2
        type cluster/replicate
        subvolumes Srv01-3 Srv02-3
end-volume

volume unify
        type cluster/distribute
        subvolumes mirror-0 mirror-1 mirror-2
end-volume

volume writebehind
        type performance/write-behind
        option cache-size 4MB
        subvolumes unify
end-volume

volume readahead
        type performance/read-ahead
        option page-count 4
        subvolumes writebehind
end-volume

volume iocache
        type performance/io-cache
        option cache-size `grep 'MemTotal' /proc/meminfo    | awk '{print $2 * 0.2 / 1024}' | cut -f1 -d.`MB
        option cache-timeout 1
        subvolumes readahead
end-volume

volume quickread
        type performance/quick-read
        option cache-timeout 1
        option max-file-size 64kB
        subvolumes iocache
end-volume

volume statprefetch
        type performance/stat-prefetch
        subvolumes quickread
end-volume

volume mountpoint1
        type mount/fuse
        option mountpoint /mnt/glusterfs
        subvolumes statprefetch
end-volume
EOF


三、服务器端(Srv01/Srv02)配置:
rpm -ivh ftp://ftp.pbone.net/mirror/ftp.centos.org/5.4/centosplus/x86_64/RPMS/reiserfs-utils-3.6.19-2.4.1.x86_64.rpm
mkdir -p /glusterfs/{b,c,d}
mkfs.reiserfs -f /dev/sdb
mkfs.reiserfs -f /dev/sdc
mkfs.reiserfs -f /dev/sdd
wget http://ftp.gluster.com/pub/gluster/glusterfs/3.0/LATEST/glusterfs-3.0.2.tar.gz
tar zxvf glusterfs-3.0.2.tar.gz
cd glusterfs-3.0.2
./configure --enable-fusermount
make && make install
ldconfig

验证:
glusterfs --version

cat  /usr/local/etc/glusterfs/server-export.vol
## file auto generated by /usr/local/bin/glusterfs-volgen (export.vol)
# Cmd line:
# $ /usr/local/bin/glusterfs-volgen --name repstore --raid 1 Srv01:/glusterfs/b Srv02:/glusterfs/b Srv01:/glusterfs/c Srv02:/glusterfs/c Srv01:/glusterfs/d Srv02:/glusterfs/

volume posix1
    type storage/posix
    option directory /glusterfs/b
end-volume

volume locks1
        type features/locks
        subvolumes posix1
end-volume

volume brick1
        type performance/io-threads
        option thread-count 8
        subvolumes locks1
end-volume

volume posix2
    type storage/posix
    option directory /glusterfs/c
end-volume

volume locks2
        type features/locks
        subvolumes posix2
end-volume

volume brick2
        type performance/io-threads
        option thread-count 8
        subvolumes locks2
end-volume

volume posix3
    type storage/posix
    option directory /glusterfs/d
end-volume

volume locks3
        type features/locks
        subvolumes posix3
end-volume

volume brick3
        type performance/io-threads
        option thread-count 8
        subvolumes locks3
end-volume

volume server-tcp
        type protocol/server
        option transport-type tcp/server
        option auth.addr.brick1.allow *
        option auth.addr.brick2.allow *
        option auth.addr.brick3.allow *
        option transport.socket.listen-port 6996
        option transport.socket.nodelay on
        subvolumes brick1 brick2 brick3
end-volume
EOF


四、启动顺序:
1、服务器端(Srv01/Srv02)
glusterfs -l /usr/local/etc/glusterfs/server-exportlog -f /usr/local/etc/glusterfs/server-export.vol
2、客户端(client)
glusterfs -l /usr/local/etc/glusterfs/client-stor.log -f /usr/local/etc/glusterfs/client-stor.vol

3、客户端验证(client)
# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                       71G  2.3G   65G   4% /
/dev/sda1              99M   19M   76M  20% /boot
tmpfs                 502M     0  502M   0% /dev/shm
glusterfs#/usr/local/etc/glusterfs/client-stor.vol
                      1.4T  1.3G  1.4T   1% /mnt/glusterfs




运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-670360-1-1.html 上篇帖子: centos7 搭建GlusterFS 下篇帖子: glusterfs实战
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表