Mount the Same Filesystem on Many Clients
Every client mounts with the samemeta_url (token included) and the same TELNYX_API_KEY. There is nothing per-client to set up — a mount holds no server-side state — so you can add or remove clients at any time. Run the mount recipe on each host:
Distribute the token to each client however you manage secrets. If you rotate the token, already-mounted clients keep working on their existing connection; only new mounts need the new
meta_url.What One Client Sees of Another’s Writes
CloudFS gives close-to-open consistency, the standard for shared filesystems: when a client writes a file and closes it, other clients see the new contents the next time they open it. Directory operations — create, rename, delete — commit to the metadata store immediately and become visible to other clients within about a second (the lifetime of a client’s kernel metadata cache). With client A and client B both mounted at/mnt/shared:
Coordinating Writers on the Same File
Two clients writing the same file (or the same byte range) at the same time is the one case that needs coordination — as on any shared filesystem, uncoordinated overlapping writes resolve last-writer-wins. Use file locks: CloudFS supports both BSD locks (flock) and POSIX record locks (fcntl), and JuiceFS coordinates them across clients through the shared metadata. A lock held on one host blocks a conflicting lock on another.
flock exits non-zero and B’s command doesn’t run — so a fleet can serialize access to a shared resource (a worklog, a build output directory, a leader-election file) without any external coordinator.
Worked Example: Two Clients, One Filesystem
Two containers, each an independent client, mounting the same filesystem:Caveats
- Same-file, uncoordinated concurrent writes resolve last-writer-wins on overlapping regions. Use the locks above whenever more than one client may write the same file.
- Metadata latency. Every metadata operation — open, create, rename, lock — is a round-trip to
us-east-1(see The Metadata Lane). Coordination-heavy or many-small-file workloads run faster the closer clients mount to us-east-1; bulk data throughput is unaffected. - One credential set per filesystem. All clients share the same
meta_tokenand API key; there is no per-client scoping within a filesystem.
Next Steps
- Mounting a Filesystem — the full mount recipe each client runs
- How CloudFS Works — why one consistent metadata store makes shared access work
- Quick Start — create a filesystem and mount it