用于两节点故障转移设置的分布式文件系统是什么?

Udo*_*o G 5 replication distributed-filesystems

I'm trying to set up a redundant setup consisting of two servers that have everything redundant:

  • the database (MySQL master-master in active/passive mode)
  • the file system (distributed/replicated)
  • our application software (kept in sync using the distributed file system)

Mostly one of the two servers will be the "main" server and the other will replicate all it's data and will also be used to distribute workload (Gearman). In case the main server fails, everything is switched to the "standby" server which will become the "active" server and continue it's work.

To reduce the risk of complete fail of both servers, they are geographically separated in two distant data centers (same country / direct connections).

I read a lot about distributed file systems, but still have no clue which solution is suitable for just two nodes...

Some more requirements to the distributed file system:

  • must be POSIX compliant
  • must replicate everything (all data must be available on both servers all the time) in both directions (all data can be changed anywhere)
  • current stats relating to the already existing data that should be replicated in future:
    • about 30 GB of data, constantly growing since 3 years
    • about 3 million files in 7,500 directories
    • average file size approx. 5-10 kb; there are a few big files around 10-50 MB
    • files are mostly added periodically through the day and moved to another directory once processed (similar to file based mail server)
    • once a day a few thousand files (received the day before) are archived to a number of TAR archives and left there "forever"
    • when adding files, the data is first written to a temporary file starting with a dot "." and then renamed when complete. Only rarely an existing file is being changed.
  • the system should deal well with unexpected connection losses, reboots of a server, etc.
  • no problem if the replication lags 1-2 seconds, but it should be always in a consistent state
  • as said, the distr. filesys. will consist of only two nodes, but it would be a big bonus if I could add additional nodes/servers, should I need more computing power in the future

Update/more details:

  • 我只需要“文件存储在两台服务器上,立即同步”意义上的冗余。当访问文件时,我不需要因为本地硬盘出现故障而需要文件系统从另一台服务器读取数据。当本地硬盘发生故障时,整个服务器计算机被视为“损坏”,因此应停止工作。

哪种文件系统适合这种情况?

use*_*554 0

尝试 DRBD。这不是文件系统,而是块设备。

来自http://lwn.net/Articles/329543/

协议A:本地磁盘写入完成后,即认为写入完成,并且数据包已放入对等端的发送队列中。当节点发生故障时,由于要写入远程节点磁盘的数据可能仍在发送队列中,因此可能会发生数据丢失。但是,故障转移节点上的数据是一致的,但不是最新的。这通常用于地理上分离的节点。

...

单一主要:主要指定给一个集群成员。由于只有一个集群成员操作数据,因此该模式对于 ext3 或 XFS 等传统文件系统非常有用。

另请参阅http://www.drbd.org/home/feature-list/了解更多详细信息。

  • 单独的 DRBD 并不能满足要求,因为它还需要在其之上有一个分布式文件系统,以便它可以处理所需的所有功能。 (2认同)
  • 如果我正确理解 DRBD,一次只有一台服务器可以“挂载”文件系统,但我需要两台服务器都具有读/写访问权限。 (2认同)