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

[经验分享] glusterfs安装记录

[复制链接]

尚未签到

发表于 2019-2-1 10:52:03 | 显示全部楼层 |阅读模式
  http://hi.baidu.com/higkoo/item/f6eb8b18c63946cc39cb3022
  http://blog.csdn.net/liuaigui/article/details/17331557  

  参考博文

  

  环境:
  系统:Centos 6.4
  版本:2.6.32-358.14.2.el6.x86_64  CentOS release 6.4 (Final)
  
  
  Glusterfs下载地址:
  http://download.gluster.org/pub/gluster/glusterfs/3.4/3.4.0/CentOS/epel-6Server/x86_64/
  
  一:服务器端:
  1.下载相应的安装包

(1) yum install lvm2   (下载Linux端磁盘管理工具lvm)
(2) yum install rpcbind (rpcbind就是为了将不同服务与对应的端口进行绑定,以便支持机器间的互操作)
  (3)rpm -ivh (安装如下4个包)
  http://download.gluster.org/pub/gluster/glusterfs/3.4/3.4.0/CentOS/epel-6Server/x86_64/glusterfs-libs-3.4.0-8.el6.x86_64.rpm
  http://download.gluster.org/pub/gluster/glusterfs/3.4/3.4.0/CentOS/epel-6Server/x86_64/glusterfs-3.4.0-8.el6.x86_64.rpm
  http://download.gluster.org/pub/gluster/glusterfs/3.4/3.4.0/CentOS/epel-6Server/x86_64/glusterfs-fuse-3.4.0-8.el6.x86_64.rpm
  http://download.gluster.org/pub/gluster/glusterfs/3.4/3.4.0/CentOS/epel-6Server/x86_64/glusterfs-cli-3.4.0-8.el6.x86_64.rpm
  http://download.gluster.org/pub/gluster/glusterfs/3.4/3.4.0/CentOS/epel-6Server/x86_64/glusterfs-server-3.4.0-8.el6.x86_64.rpm
  
  2.添加到开机启动
  chkconfig glusterd on
  3.启动服务进程
  /etc/init.d/glusterd start
  以上操作在每台服务端上执行
  
  二:客户端
  1.# yum install -y fuse fuse-libs
   # modprobe fuse
  2.# rpm -ivh
  http://download.gluster.org/pub/gluster/glusterfs/3.4/3.4.0/CentOS/epel-6Server/x86_64/glusterfs-libs-3.4.0-8.el6.x86_64.rpm
  http://download.gluster.org/pub/gluster/glusterfs/3.4/3.4.0/CentOS/epel-6Server/x86_64/glusterfs-3.4.0-8.el6.x86_64.rpm
  http://download.gluster.org/pub/gluster/glusterfs/3.4/3.4.0/CentOS/epel-6Server/x86_64/glusterfs-fuse-3.4.0-8.el6.x86_64.rpm
  3.# mount -t glusterfs 192.168.1.1:/web-files /mnt
  
  三.挂载步骤:
  1:服务器端:将服务器端组成员统一添加到管理池中,每台服务器端是对等的不分主次。
  # gluster peer probe 192.168.1.2
  peer probe: success
  
  查看集群状态
  # gluster peer status
  Number of Peers: 1
  
  Hostname: 192.168.1.2
  Port: 24007
  Uuid: b1eddb73-4ef9-4e9c-8dd2-90988d21296c
  State: Peer in Cluster (Connected)
  
  创建名为web-files的卷,副本数(replica)为2
  # mkdir /data/app_test
  #gluster volume create web-file replica 2 10.20.216.173:/data/app_test/ 10.20.216.174:/data/app_test/
  http://blog.csdn.net/liuaigui/article/details/7009782 #创建不同类型的卷
  
  # gluster volume create web-files replica 2 192.168.1.1:/data/gluster/web-files 192.168.1.2:/data/gluster/web-files
  volume create: web-files: success: please start the volume to access data
  
  启动卷
  # gluster volume start web-files
  volume start: web-files: success
  
  查看卷状态
  # gluster volume info
  
  Volume Name: web-files
  Type: Replicate
  Volume ID: 4e943de6-3101-4c96-8a32-48548f34c88a
  Status: Started
  Number of Bricks: 1 x 2 = 2
  Transport-type: tcp
  Bricks:
  Brick1: 192.168.1.1:/data/gluster/web-files
  Brick2: 192.168.1.2:/data/gluster/web-files
  客户端:
  # mount -t glusterfs 10.20.216.173:/web-file /data/app/
  # df -h
  Filesystem             Size  Used Avail Use% Mounted on
  /dev/sda1              49G  2.1G   44G    5% /
  tmpfs                 2.0G     0  2.0G    0% /dev/shm
  /dev/sda3              20G  173M   19G   1% /data
  10.20.216.174:/web-file
                        20G  173M   19G   1% /data/app
  
  2.挂载本地目录到glusterfs服务器端的

http://blog.chinaunix.net/uid-1839523-id-3450679.html
问题:报错如下信息
volume create: CDN_web_data: failed: /data/app_glusterfs or a prefix of it is already part of a volume
  从glusterfs 3.3开始,有个变化:gluster 会一直check 目录是否已经是volume的一部分,如果你将brick从volume移除后再次使用时,会导致许多问题,甚至是数据丢失。
  目的是重用原来的brick时,需要让你知道你在做什么
  需要重用原来brick时,执行如下操作
  setfattr -x trusted.glusterfs.volume-id $brick_path
  setfattr -x trusted.gfid $brick_path
  rm -rf $brick_path/.glusterfs
  重启glusterd 服务即可
  或者如下脚本:
#! /bin/sh
read -p "Enter you will reuse brick path:" brick_path
setfattr -x trusted.glusterfs.volume-id $brick_path
setfattr -x trusted.gfid $brick_path
rm -rf $brick_path/.glusterfs
service glusterd restart
  





运维网声明 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-670370-1-1.html 上篇帖子: GlusterFS 隐藏参数说明 下篇帖子: GlusterFS的基础应用
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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

扫描微信二维码查看详情

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


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


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


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



合作伙伴: 青云cloud

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