A map-reduce compatible distributed file system, comprising: a plurality of containers (309, 312) in which each container stores file and directory metadata as well as file content data; a container location database, CLDB, configured to maintain information about where each of said plurality of containers is located; a plurality of cluster nodes (302, 304), each cluster node containing one or more storage pools (303, 305), each storage pool containing zero or more containers; and a plurality of inodes (306, 308, 310, 311) for structuring data within said containers; wherein a subset of the cluster nodes are designated as CLDB nodes to store the CLDB; wherein one of the CLDB nodes is designated as a master CLDB node; wherein references to the file content data are stored in the plurality of inodes in which container metadata and data are stored; wherein said CLDB is configured to assign nodes as replicas of data in a container to meet policy constraints in accordance with the following: said CLDB assigns each container to a master node that controls all transactions for that container; said CLDB designates a chain of nodes to hold replicas, the chain of nodes comprising a plurality of nodes of the cluster nodes; if one of the nodes goes down or is separated from the master CLDB node, it is removed from the replication chain; if the master node goes down or is separated from the master CLDB node, the CLDB designates a new master node; any node that comes back after having been removed from the replication chain is reinserted at the end of the replication chain if the chain still needs another replica when the node returns; if the node returns within a first predetermined interval, no new node to replicate the container in question has been designated and the chain still needs a replica, and the returning node is reinserted at the end of the chain of nodes; and if the node has been gone for a second, longer predetermined interval, the CLDB may designate some other node to take a place in the chain, and the returning node is not reinserted into the chain of nodes. a plurality of containers (309, 312) in which each container stores file and directory metadata as well as file content data; a container location database, CLDB, configured to maintain information about where each of said plurality of containers is located; a plurality of cluster nodes (302, 304), each cluster node containing one or more storage pools (303, 305), each storage pool containing zero or more containers; and a plurality of inodes (306, 308, 310, 311) for structuring data within said containers; wherein a subset of the cluster nodes are designated as CLDB nodes to store the CLDB; wherein one of the CLDB nodes is designated as a master CLDB node; wherein references to the file content data are stored in the plurality of inodes in which container metadata and data are stored; wherein said CLDB is configured to assign nodes as replicas of data in a container to meet policy constraints in accordance with the following: said CLDB assigns each container to a master node that controls all transactions for that container; said CLDB designates a chain of nodes to hold replicas, the chain of nodes comprising a plurality of nodes of the cluster nodes; if one of the nodes goes down or is separated from the master CLDB node, it is removed from the replication chain; if the master node goes down or is separated from the master CLDB node, the CLDB designates a new master node; any node that comes back after having been removed from the replication chain is reinserted at the end of the replication chain if the chain still needs another replica when the node returns; if the node returns within a first predetermined interval, no new node to replicate the container in question has been designated and the chain still needs a replica, and the returning node is reinserted at the end of the chain of nodes; and if the node has been gone for a second, longer predetermined interval, the CLDB may designate some other node to take a place in the chain, and the returning node is not reinserted into the chain of nodes. said CLDB assigns each container to a master node that controls all transactions for that container; said CLDB designates a chain of nodes to hold replicas, the chain of nodes comprising a plurality of nodes of the cluster nodes; if one of the nodes goes down or is separated from the master CLDB node, it is removed from the replication chain; if the master node goes down or is separated from the master CLDB node, the CLDB designates a new master node; any node that comes back after having been removed from the replication chain is reinserted at the end of the replication chain if the chain still needs another replica when the node returns; if the node returns within a first predetermined interval, no new node to replicate the container in question has been designated and the chain still needs a replica, and the returning node is reinserted at the end of the chain of nodes; and if the node has been gone for a second, longer predetermined interval, the CLDB may designate some other node to take a place in the chain, and the returning node is not reinserted into the chain of nodes.