Glusterfs不复制数据

时间:2014-06-19 11:05:30

标签: ubuntu-12.04 replication glusterfs

我有一个带有两个节点(Node1和Node2)的 glusterfs 设置。我看到两个连接之间的连接。问题是当我在Node1上创建一些文件夹时,它不会在Node2上复制它。如果有人修理过,请建议我克服吗?

如果我将其作为 glusterfs客户端安装在其他服务器上并创建文件和文件夹,则将其复制到glusterfs节点。这种行为是否正常?

Volume Name: testvol
Type: Replicate
Status: Started
Number of Bricks: 2
Transport-type: tcp
Bricks:
Brick1: gluster1.example.com:/var/www/drupal7/sites/default/files
Brick2: gluster2.example.com:/var/www/drupal7/sites/default/files

2 个答案:

答案 0 :(得分:4)

Gluster卷只能通过客户端访问和更新。我在同一个帖子上看到了类似的帖子。如果您不想在另一个节点中安装客户端并安装在同一服务器本身,则建议使用以下链接。

http://gopukrish.wordpress.com/glusterfs/
http://gopukrish.wordpress.com/high-availability-load-balanced-wordpress-site/

答案 1 :(得分:1)

当您使用“节点”一词时,我不确定您的意思。 Gluster通常由砖块,卷和主机组成。

卷通常由托管在主机上的砖块组成。在您的示例中,您创建了一个名为testvol的复制卷,该卷由两块砖组成。一块砖在gluster1.example.com上,另一块在gluster2.example.com上。

砖块只是gluster存储东西的地方。它们本身不是复制或分发的,您无意访问它们。

卷被复制和/或分发。在您将它们安装到某处之前,卷不会出现在您的文件系统中。

根据我的经验,“gluster”的人们对同一服务器中的gluster与其他应用程序一起运行感到沮丧,但是把它放在一边并继续你的例子,你想要实现的目标可以通过重新安排你的想一想。

  • 在gluster1.example.com上创建名为/ brick的文件夹
  • 在gluster2.example.com上创建名为/ brick的文件夹
  • 现在使用gluster1.example.com:/brick和gluster2.example.com/brick
  • 创建名为testvol的gluster卷
  • 你也需要开始音量。
  • 接下来,您需要在gluster1.example.com和gluster2.example.com上的文件系统中安装新的testvol。执行以下内容:

mkdir /mytestvol mount -t glusterfs gluster1.example.org:testvol /mytestvol

在每台主机上。它是/ mytestvol,它是复制的gluster文件系统。 gluster将砖块用于自己的目的。 / mytestvol是您对复制的gluster卷的视图。

假设您在两个系统中的/ mytestvol上安装了testvol,您可以在其中一个系统上的/ mytestvol中创建文件,它将自动显示在另一个系统上。

现在,就您的示例而言,您可能希望将文件夹移动到/ mytestvol,然后软链接回您的Web服务器层次结构。类似的东西:

mv /var/www/drupal7/sites/default/files /mytestvol ln -s /mytestvol/files /var/www/drupal7/sites/default/