位置: 编程技术 - 正文

CentOS 6.4如何安装及设置GlusterFS以解决网络存储的问题(centos6.5怎么安装)

编辑:rootadmin

推荐整理分享CentOS 6.4如何安装及设置GlusterFS以解决网络存储的问题(centos6.5怎么安装),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:centos6.5怎么安装,centos6.6安装,centos6.2安装教程,centos6.5安装步骤,centos6.5怎么安装,centos6.5怎么安装,centos 6.5 安装,centos6.5怎么安装,内容如对您有帮助,希望把文章链接给更多的朋友!

  GlusterFS因有很好的扩展性,使用的用户很多,使用GlusterFS能够解决网络存储、冗余备份等问题,那么在Linux下要如何安装GlusterFS呢?今天小编以CentOS6.4为例,给大家介绍下CentOS6.4安装配置GlusterFS的方法。

  环境介绍:

  OS: CentOS 6.4 x_ Minimal

  Servers: sc2-log1,sc2-log2,sc2-log3,sc2-log4

  Client: sc2-ads

  具体步骤:

  1. 在sc2-log{1-4}上安装GlusterFS软件包:

  代码如下

  # wget -P /etc/yum.repos.d   # yum install -y glusterfs-3.4.2-1.el6 glusterfs-server-3.4.2-1.el6 glusterfs-fuse-3.4.2-1.el6

  # /etc/init.d/glusterd start

  # chkconfig glusterfsd on

  2. 在sc2-log1上配置整个GlusterFS集群:

  代码如下

  [root@sc2-log1 ~]# gluster peer probe sc2-log1

  1 peer probe: success: on localhost not needed

  [root@sc2-log1 ~]# gluster peer probe sc2-log2

  1 peer probe: success

  [root@sc2-log1 ~]# gluster peer probe sc2-log3

  1 peer probe: success

  [root@sc2-log1 ~]# gluster peer probe sc2-log4

  1 peer probe: success

  [root@sc2-log1 ~]# gluster peer status

   Number of Peers: 3

  

   Hostname: sc2-log2

   Port:

   Uuid: af-bae9--9cbd-b5be5d

   State: Peer in Cluster (Connected)

  

   Hostname: sc2-log3

   Port:

   Uuid: a7b8d-e3b3--baf9-ee

   State: Peer in Cluster (Connected)

  

   Hostname: sc2-log4

   Port:

   Uuid: bfa---af-7a6bcafd9

   State: Peer in Cluster (Connected)

  3. 在sc2-log{1-4}上创建数据存放目录:

  代码如下

  # mkdir -p /usr/local/share/{models,geoip,wurfl}

  # ls -l /usr/local/share/

  1 total

  2 drwxr-xr-x 2 root root Apr 1 : geoip

  3 drwxr-xr-x 2 root root Apr 1 : models

  4 drwxr-xr-x 2 root root Apr 1 : wurfl

  4. 在sc2-log1上创建GlusterFS磁盘:

  代码如下

  [root@sc2-log1 ~]# gluster volume create models replica 4 sc2-log1:/usr/local/share/models sc2-log2:/usr/local/share/models sc2-log3:/usr/local/share/models sc2-log4:/usr/local/share/models force

  1 volume create: models: success: please start the volume to access data

  [root@sc2-log1 ~]# gluster volume create geoip replica 4 sc2-log1:/usr/local/share/geoip sc2-log2:/usr/local/share/geoip sc2-log3:/usr/local/share/geoip sc2-log4:/usr/local/share/geoip force

  1 volume create: geoip: success: please start the volume to access data

  [root@sc2-log1 ~]# gluster volume create wurfl replica 4 sc2-log1:/usr/local/share/wurfl sc2-log2:/usr/local/share/wurfl sc2-log3:/usr/local/share/wurfl sc2-log4:/usr/local/share/wurfl force

  1 volume create: wurfl: success: please start the volume to access data

  [root@sc2-log1 ~]# gluster volume start models

  1 volume start: models: success

  [root@sc2-log1 ~]# gluster volume start geoip

  1 volume start: geoip: success

  [root@sc2-log1 ~]# gluster volume start wurfl

  1 volume start: wurfl: success

  [root@sc2-log1 ~]# gluster volume info

   Volume Name: models

   Type: Replicate

   Volume ID: bbbd-6d8c-c0-b-fa5af

   Status: Started

   Number of Bricks: 1 x 4 = 4

   Transport-type: tcp

   Bricks:

   Brick1: sc2-log1:/usr/local/share/models

   Brick2: sc2-log2:/usr/local/share/models

   Brick3: sc2-log3:/usr/local/share/models

   Brick4: sc2-log4:/usr/local/share/models

  

   Volume Name: geoip

   Type: Replicate

   Volume ID: b0caa8-7c--beae-6fb1cffa3

   Status: Started

   Number of Bricks: 1 x 4 = 4

   Transport-type: tcp

   Bricks:

   Brick1: sc2-log1:/usr/local/share/geoip

   Brick2: sc2-log2:/usr/local/share/geoip

   Brick3: sc2-log3:/usr/local/share/geoip

CentOS 6.4如何安装及设置GlusterFS以解决网络存储的问题(centos6.5怎么安装)

   Brick4: sc2-log4:/usr/local/share/geoip

  

   Volume Name: wurfl

   Type: Replicate

   Volume ID: cad-eeab--a-ccf7ba

   Status: Started

   Number of Bricks: 1 x 4 = 4

   Transport-type: tcp

   Bricks:

   Brick1: sc2-log1:/usr/local/share/wurfl

   Brick2: sc2-log2:/usr/local/share/wurfl

   Brick3: sc2-log3:/usr/local/share/wurfl

   Brick4: sc2-log4:/usr/local/share/wurfl

  5. 在sc2-ads上部署客户端并mount GlusterFS文件系统:

  [sc2-ads][root@sc2-ads ~]# wget -P /etc/yum.repos.d   [sc2-ads][root@sc2-ads ~]# yum install -y glusterfs-3.4.2-1.el6 glusterfs-fuse-3.4.2-1.el6

  [sc2-ads][root@sc2-ads ~]# mkdir -p /mnt/{models,geoip,wurfl}

  [sc2-ads][root@sc2-ads ~]# mount -t glusterfs -o ro sc2-log3:models /mnt/models/

  [sc2-ads][root@sc2-ads ~]# mount -t glusterfs -o ro sc2-log3:geoip /mnt/geoip/

  [sc2-ads][root@sc2-ads ~]# mount -t glusterfs -o ro sc2-log3:wurfl /mnt/wurfl/

  [sc2-ads][root@sc2-ads ~]# df -h

  1 Filesystem Size Used Avail Use% Mounted on

  2 /dev/mapper/vg_t-lv_root

  3 G 7.7G G % /

  4 tmpfs 3.9G 0 3.9G 0% /dev/shm

  5 /dev/xvda1 M M M 8% /boot

  6 sc2-log3:models G 8.6G G % /mnt/models

  7 sc2-log3:geoip G 8.6G G % /mnt/geoip

  8 sc2-log3:wurfl G 8.6G G % /mnt/wurfl

  6. 相关数据读写可用性测试:

  在sc2-ads挂载点上写入数据:

  代码如下

  [sc2-ads][root@sc2-ads ~]# umount /mnt/models

  [sc2-ads][root@sc2-ads ~]# mount -t glusterfs sc2-log3:models /mnt/models/

  [sc2-ads][root@sc2-ads ~]# echo “This is sc2-ads” 》 /mnt/models/hello.txt

  [sc2-ads][root@sc2-ads ~]# mkdir /mnt/testdir

  在sc2-log1数据目录中进行查看:

  [root@sc2-log1 ~]# ls /usr/local/share/models/

  1 hello.txt testdir

  结果: 数据写入成功

  在sc2-log1数据目录中直接写入数据:

  代码如下

  [root@sc2-log1 ~]# echo “This is sc2-log1” 》 /usr/local/share/models/hello.2.txt

  [root@sc2-log1 ~]# mkdir /usr/local/share/models/test2

  在sc2-ads挂载点上进行查看:

  [sc2-ads][root@sc2-ads ~]# ls /mnt/models

  [sc2-ads][root@sc2-ads ~]# ls -l /mnt/models

  1 hello.txt testdir

  结果: 数据写入失败

  在sc2-log1挂载点上写入数据:

  代码如下

  [root@sc2-log1 ~]# mount -t glusterfs sc2-log1:models /mnt/models/

  [root@sc2-log1 ~]# echo “This is sc2-log1” 》 /mnt/models/hello.3.txt

  [root@sc2-log1 ~]# mkdir /mnt/models/test3

  在sc2-ads挂载点上进行查看:

  [sc2-ads][root@sc2-ads models]# ls /mnt/models

  1 hello.2.txt hello.3.txt hello.txt test2 test3 testdir

  结果: 数据写入成功,同时之前写入失败的数据也成功加载了。

  最终结论:

  在数据目录中直接写入数据,会导致其它节点因为得不到通知而使数据同步失败。

  正确的做法是所有的读写操作都通过挂载点来进行。

  7. 其它操作笔记:

  删除GlusterFS磁盘:

  代码如下

  # gluster volume stop models

  # gluster volume delete models

  卸载GlusterFS磁盘:

  代码如下

  sc2-log4

  ACL访问控制:

  代码如下

  # gluster volume set models auth.allow ..1.*,..1.*

  添加GlusterFS节点:

  代码如下

  # gluster peer probe sc2-log5

  # gluster peer probe sc2-log6

  # gluster volume add-brick models sc2-log5:/data/gluster sc2-log6:/data/gluster

  迁移GlusterFS磁盘数据:

  代码如下

  # gluster volume remove-brick models sc2-log1:/usr/local/share/models sc2-log5:/usr/local/share/models start

  # gluster volume remove-brick models sc2-log1:/usr/local/share/models sc2-log5:/usr/local/share/models status

  # gluster volume remove-brick models sc2-log1:/usr/local/share/models sc2-log5:/usr/local/share/models commit

  修复GlusterFS磁盘数据(例如在sc2-log1宕机的情况下):

  代码如下

  # gluster volume replace-brick models sc2-log1:/usr/local/share/models sc2-log5:/usr/local/share/models commit -force

  # gluster volume heal models full

  通过本文的介绍,想必你已经对GlusterFS在CentOS6.4的安装配置有了一定的了解,除此之外,本文还介绍了GlusterFS的其他操作方法。

在CentOS中安装和配置Xen虚拟机的教程 注1:本次实验环境真机CentOS5.位,虚拟机CentOS5.位,真机IP:...注2:实验前一定要先记下真机的MAC地址,以免以后不能上网用,我这里的MAC是:

CentOS下查看硬件信息的命令整理 安装包命令查找:复制代码代码如下:yumwhatprovides*/lspci查看主板型号:复制代码代码如下:dmidecode|grep-A"SystemInformation$"内存槽及内存条:复制代码代码如

在CentOS下使用Munin来监控服务器运行的方法 Munin的介绍和原理Munin是一个服务器监控工具,基于perl写的,能通过网络,定期收集所有节点服务器的信息,将服务器的数据信息保存为RRD文件格式,并

标签: centos6.5怎么安装

本文链接地址:https://www.jiuchutong.com/biancheng/363301.html 转载请保留说明!

上一篇:CentOS VPS如何打开80端口解决网站打不开的问题(用centos搭建服务器的详细教程)

下一篇:在CentOS中安装和配置Xen虚拟机的教程(centos安装总结)

  • 公司清算存货怎么算
  • 施工单位临时设施搭建费属于
  • 工会经费应税项怎么算
  • 土地增值税计税依据
  • 小规模纳税人收入账务处理
  • 股份制改造而发生的资产评估增值税法规定
  • 内部往来科目设置在哪类下
  • 帮别人开票收税点怎么做账
  • 长期待摊费用做在什么记账凭证里
  • 金税三期中个税怎么算
  • 退休人员返聘工资按工资薪金还是劳务报酬
  • 非营利性企业要交企业所得税吗
  • 小规模注销时盈余公积余额怎么处理
  • 未按期预缴企业个税
  • 将汽车奖励给员工财务如何处理?
  • 协会会费收入会计科目
  • 投资收益的表现形式
  • 对外来发票金额怎么算
  • 国税一个月没报税罚款多少
  • 虚开增值税发票具体操作是怎样的?
  • 发票勾选可以勾选几次
  • 价内税与价外税的计算公式
  • 安保服务费税率几个点怎么算
  • 税务三方协议一式几份
  • 分公司交总公司管理费怎么做账
  • 跨年度多计提的社保调整
  • 负债的情况
  • 冲销去年暂估收入
  • php日期时间运算汇总
  • 误删开始菜单
  • PHP:pg_client_encoding()的用法_PostgreSQL函数
  • 主营业务收入含义
  • 刚收到的假发怎么处理
  • 在杂志上发表文章算出版吗
  • php图形图像处理技术
  • php怎么访问本地的网页
  • v-model的双向绑定原理
  • 未开票收入如何申报
  • 支票的提示付款期限为自出票日期
  • 前端可以用jsp写吗
  • 用友u8删除凭证的步骤
  • lpstat命令
  • mysqlbinlog -vv
  • 非货币性资产投资的会计处理
  • 旅行社代订酒店如何入账
  • jsp页面构成
  • 企业年度预算编制流程
  • 网上怎么申请增驾摩托车
  • 应付职工薪酬属于什么会计科目
  • 缴纳增值税的营业收入
  • 销货方和供货方的区别
  • 永久性差异有哪些项目
  • 联营单位投入的款项
  • 债券溢价什么意思
  • 如何计算政府补贴应摊销
  • 财政收回项目资金请示
  • 企业盘亏的设备会计分录
  • 企业自查补交增值税
  • 约当产量法下的加权平均法怎么算
  • sql优化常用的15种方法
  • win7复制文件
  • ubuntu编辑器在哪
  • dockers容器
  • windows字幕软件
  • 五个常用的说明方法
  • win7如何运行命令
  • linux修改用户名
  • winxp破解登录密码
  • 如何解决焦虑的心理
  • 用linux配置ftp服务器的过程
  • nodejs回调函数返回值如何传递给其它函数
  • android:PopupWindow的使用场景和注意事项
  • vue 瀑布流
  • js的类型有哪几种
  • 移交税务稽查的条件标准
  • 税务局要求补上年房租开票
  • 小规模纳税企业的增值税税率一律为3%
  • 苏州税务局下班时间
  • 车险包括车船费吗
  • 云南省电子税务局登录入口
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设