位置: 编程技术 - 正文

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

发布时间:2024-02-26

推荐整理分享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安装总结)

  • 工资社保缴纳计算器
  • 冲红的发票税款计提分录要冲红吗
  • 房地产自有资金投入
  • 债权转增资本应缴纳什么税
  • 运输设备折旧费用科目
  • 无形资产研发费用加计扣除是晢时差异吗
  • 收到国外提供免费样品怎么入账?
  • 先取得发票后付款说明
  • 管理费用对所得收入影响
  • 母子公司无偿划拨资产
  • 联通租赁官网
  • 进项税暂估收入的税务处理
  • 认可的发票验证怎么弄
  • 营改增后小规模ktv怎么纳税
  • 纳税的税种有哪些
  • 小微企业增值税收优惠政策
  • 独资企业需要交企业所得税吗
  • 支付销售产品的保险费计入什么科目
  • 软件开发公司怎么选择
  • 金税盘发票份数没有显示
  • 以自有资金进行股权投资
  • 审计调整以前年度投资收益怎么处理
  • linux多线程运行
  • 员工离职补偿金计算方法
  • 农产品进项转出的规定
  • 玫瑰小镇的玫瑰有什么用
  • php类和对象写法
  • 生产提供什么产品
  • 企业虚报亏损的税务如何处理
  • 生产性生物资产折旧账务处理
  • 红字发票怎么填申报表表二
  • 企业购买烟酒可以抵扣吗
  • 董事会会费应计什么科目
  • MySQL中UPDATE与DELETE语句的使用教程
  • 水利建设基金申报
  • 经营性应付项目的增加为什么调减
  • 应纳税所得额计入什么科目
  • mysql数据库访问速度慢的解决方法
  • SQL设置外键
  • 砂石可以开专票吗
  • 残保金是计入管理费用还是?
  • 跨年发票能不能用
  • 车辆维修费会计分录
  • 幼儿园的经费支出主要包括哪几个方面
  • 阶段性减免企业社保费实施政策对象
  • 车间购买劳保费用会计分录
  • 流转税怎么核算
  • 个人所得税缴纳标准怎么计算
  • 期初应收账款对应什么科目试算平衡
  • 内控制度包括哪几方面
  • 单位给食堂的补贴怎么算
  • 新公司办公室装修费怎么记账
  • 公司房租没有发票不入账税务怎么处理
  • 营业执照可以注册几个抖音号
  • mysql官方监控工具
  • 在linux系统中安装软件
  • 恢复mysql数据库
  • centos7配置tomcat
  • win8系统笔记本出现意外错误
  • 怎么彻底卸载visual
  • windows vista界面
  • mac键盘怎么开
  • RedHat 9.0下Apache+PHP+MySQL服务器安装配置
  • main.exe是什么意思
  • win7运行慢如何解决办法
  • 番茄花园论坛
  • windows7旗舰版怎么打字
  • perl的chomp
  • nodejs跳转到指定页面
  • jquery选择器包含哪几大类
  • JavaScript中的NaN代表什么
  • python放歌
  • window10脚本错误
  • js实现网页收藏的方法
  • 怎么用jquery
  • 动态表单的设计与实现
  • 税控发票开票软件密码怎么修改?
  • 税务八项规定日期怎么写
  • 长沙市社保中心主任
  • 出口退税正式申报资料上传
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号