Raspi_lustre
ラズパイでLustre、分散ファイルシステムを構築して、I/Oのバンド幅を爆上げしたいって話 まずはいきなり参考文献ですね。 GlusterFS んで、早速壁にぶち当たるわけですね。Lustreはbinaryが配布されているらしいんですが、x86用らしいんですよね。ということで、raspiで動かすためにはソースコードをビルドしないといけないんですね。 まあ、これだけ書いて終わりっていうの残念なので、分散ファイルシステムについて知っていることを書いていきたいと思います。 まず、ファイルシステムっていうのは、OSの機能で、ブロックデバイスの操作をするためのデバイスドライバをラッピングしてくれているOSの機能。デバイスドライバへのAPIを提供してくれているOSの機能。で、ファイルシステムがあるから、我々はOSにお願いするだけでいい感じにファイルを作れるし、どこにどのファイルがあるか、とかそういう管理もしなくていいのよね。ただね、ファイルシステムもただのプログラムに過ぎないんですわ。何が言いたいかというと、内部ではカチカチとデバイスドライバーを動かしているわけで。いや、何が言いたいかっていうと、1ファイルにつき1プロセスしか操作を許されないってことね。つまり、複数のプロセスが一気に一つのファイルに書き込むとか、そういうのは無理なわけよ。これまず大事なポイントね。だからね、書き込みたいデータがたくさんあってもsingule writingをするしかないんだよね。 はい、GPT先生に聞いてみた。 Is it impossible for multiple processes to write data to a same file simultaniously? In traditional file systems, it is generally not possible for multiple processes to write data simultaneously to the same file without coordination or synchronization mechanisms. Concurrent writes to the same file can lead to data corruption, inconsistencies, or conflicts. When multiple processes attempt to write to the same file simultaneously, several issues can arise: Data Corruption: Simultaneous writes from multiple processes can result in data corruption, where the written data becomes mixed or garbled. This can happen if the file system interleaves or merges the write operations from different processes in an uncontrolled manner. Inconsistent Data: If processes are writing to different parts of the same file simultaneously, it can lead to inconsistent data. For example, if two processes write different values to the same location within the file at the same time, the final content of that location becomes unpredictable. File Locking and Concurrency Control: File systems often employ locking mechanisms to control access to files and ensure data integrity. These locks allow processes to acquire exclusive or shared access to a file, preventing simultaneous writes by multiple processes. Without proper coordination, conflicts may arise, and processes may contend for file locks, leading to delays and reduced performance. To enable multiple processes to write data to the same file simultaneously, coordination mechanisms such as file locking, semaphores, or other synchronization techniques need to be employed. These mechanisms ensure that processes take turns or serialize their write operations to maintain data integrity and consistency. However, it's worth noting that some distributed file systems or specialized I/O middleware, like ADIOS, may provide mechanisms to support parallel or concurrent writes to a file. These systems typically implement internal coordination and synchronization mechanisms to manage concurrent access safely. In such cases, the middleware handles the coordination and ensures data integrity, allowing multiple processes to write to the same file efficiently. しかし一つのファイルに同時書き込みを許可しているふぃあるシステムもある。XFSは一つのファイルに同時書き込みを許可しているらしいのだが。そんなことできるのか??? ...