Will IPFS-Cluster work for this use case

I have 3 servers all geographically separated and would like them to all have a folder containing data that is replicated between the nodes so that any of the three nodes could create a file in the folder or update an existing file and the other nodes would get the new file or updated version. I found a few topics talking about similar things but it wasnt quite clear if it would.

1 Like

Yeah that’s exactly the use case for IPFS Cluster. Essentially, the cluster will maintain a pinset, which is a list of pins the cluster should pin.

The replication factor will control how many redundant copies are replicated by the cluster. If you set replication_factor_min to -1 all cids will be replicated to all nodes. See IPFS Cluster docs for more inofmration.

1 Like

Note cluster only works with IPFS pins. Folder mounting, or making sure changes in one place are pinned and then reflected somewhere else is something you have to build on top.



Is it possible to use MFS with one node in the cluster and then pin the new MFS root using the POST /pins/ipfs/CID endpoint in the REST API of IPFS Cluster?

Yes, but MFS root in IPFS will not get updated and the user needs to manually add the new CID back to MFS.

Last time I checked there was no way to replace the MFS root in IPFS.

I actually wrote this last time I needed to do exactly that: GitHub - hsanjuan/mfs-replace-root: A small program to replace IPFS MFS root

1 Like

Yes, but MFS root in IPFS will not get updated and the user needs to manually add the new CID back to MFS.

Not sure I understood what you mean.

My thinking was that it’s possible to use MFS on one node and after every change that needs to be persisted, run ipfs files stat / to get the root pin which you then pin to the cluster.

From my understanding, mfs-replace-root is a tool to replace the MFS root which would be useful if you don’t want to actually use MFS to manage files or just want to reset the whole MFS tree.

Are we on the same page?

You can do that, but I think the user wanted not only to safeguard the data of MFS, but to have the MFS view in different nodes be the same (and that involves having the same MFS root everywhere).

1 Like