魔法系统之家下载 - 系统之家,XP系统之家,GhostXP系统,纯净版XP系统,Windows7下载之家

当前位置:首页 > 系统教程 > Linux教程 > 详细页面

CentOS 6.4如何安装及设置GlusterFS(3)

时间:2017-08-17 19:55:48来源:魔法系统之家下载作者:qipeng

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

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

  代码如下

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

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

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

  [sc2-ads15][root@sc2-ads15 ~]# 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-ads15挂载点上进行查看:

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

  [sc2-ads15][root@sc2-ads15 ~]# 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-ads15挂载点上进行查看:

  [sc2-ads15][root@sc2-ads15 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 10.60.1.*,10.70.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的其他操作方法。

123 下一页
分享到:

相关信息

  • Arch Linux不适合当作服务器操作系统的四大原因

    为什么Arch Linux不适合当作服务器操作系统?可能很多用户都发现了,Linux服务器操作系统一般都是Ubuntu Server、Cent OS、Fedora或者Red Hat等,为什么很少看到Arch Linux呢?因为Arch Linux在服务方面确实存在一些劣势,下面...

    2017-08-17

  • Ubuntu 3D桌面特效怎么设置?

    有些用户为了使桌面更好看、更具动感性,于是就想要设置系统的3D桌面特效,不过不少人却不知道Ubuntu 3D桌面特效怎么设置?其实方法很简单,如果你不知道的话,那就赶紧来看看小编整理的Ubuntu 3D桌面特效设置方法吧!...

    2017-08-17

系统教程栏目

栏目热门教程

人气教程排行

站长推荐

热门系统下载