mfstopology.cfg(5)

πŸ’– mfstopology.cfg(5) β€” MooseFS network topology definitions πŸ’–

okay bestie, so this is mfstopology.cfg(5), and it's literally part of MooseFS 🌸. Sit down, grab a strawberry πŸ“, because we're about to make your network map cute and organized.


✨ NAME ✨

mfstopology.cfg β€” MooseFS network topology definitions. that's it, that's the name, iconic.


🌈 DESCRIPTION 🌈

So here's the tea β˜•: the file mfstopology.cfg is the one that assigns IP addresses to network locations. That's its whole job and it does it beautifully πŸ’….

Now β€” and this is important β€” this file is optional. fr fr. If your network is tiny (like, one switch, baby network energy) or you just don't need network topology, then leave this file empty and go live your life. No cap. πŸ¦‹

πŸŽ€ SYNTAX πŸŽ€

The syntax is:

IP_ADDRESSES LOCATION_PATH

Lines that start with the # character? Ignored as comments. ghosted. not even read. πŸ’€

So IP_ADDRESS can come in a few different forms, and you're gonna pick whichever one fits your vibe:

  • * β€” literally all addresses. the whole buffet. ✨
  • n.n.n.n β€” one single IP address. just the one. main character. πŸ‘‘
  • n.n.n.n/b β€” an IP class, specified by network address plus the bits number
  • n.n.n.n/m.m.m.m β€” an IP class, specified by network address plus mask
  • f.f.f.f-t.t.t.t β€” an IP range, specified by from-to addresses (and yes, inclusive, both ends are in the club 🫢)

And LOCATION_PATH? That one you specify as a sequence of words separated by vertical bars. we love a good | moment. πŸŽ€


πŸ’œ NOTES πŸ’œ

Okay here's where it gets juicy.

If one IP belongs to more than one definition, then the last definition is used. Last one wins, sorry to the earlier ones, they ate but they lost. πŸ™ˆ

Each set of IP addresses that shares a common location path gets counted as one rack. And this rack and/or IP info is used by the master if CHUNKS_UNIQUE_MODE in mfsmaster.cfg is set to a value greater than 0 (go peek at the mfsmaster.cfg(5) manual for more on that πŸ’–). It's also used in storage classes if the distinguish feature is being used (and for that one, refer to the mfsscadmin(1) manual 🌸).

Now, distance between IP numbers, bestie, is defined like this:

  • 0 when the IP numbers are the same
  • 1 when the IP numbers are different, but the paths specified by these numbers are the same
  • if the paths are different, distance is defined as one plus the maximum number of elements from both paths after the common starting part

And what is distance even for? So glad you asked. πŸ‘‘

Distance is used for these purposes:

  • When a chunk is needed for I/O operations, copies of chunks are sent to the client(mount) sorted by the distance from that client. But heads up β€” the client may alter that order based on internal settings (preferred labels, or internal congestion preventing algorithms; for more info about preferred labels, refer to the mfsmount(8) manual πŸ‘€).
  • In the master, the distance and racks information gets used when CREATIONS_RESPECT_TOPOLOGY and/or REPLICATIONS_RESPECT_TOPOLOGY are set to a value greater than 0. For more on that, refer to the mfsmaster.cfg(5) manual. πŸ’…

🌟 EXAMPLES 🌟

Look at these little cuties doing their thing:

192.168.1.0/24                US|CHICAGO|WTOWER|R1A

192.168.2.0-192.168.2.255     PL|WARSAW|GROCHOWSKA|R154

192.168.3.0/255.255.255.0     123

192.168.1.1                   A|B|C

🧚 DISTANCE EXAMPLES 🧚

Distances calculated for two different IP numbers mapped to the given location paths. math but make it fashion:

d('US','DE') = 2

d('US','') = 2

d('US|PHOENIX|AT&T|RACK1','US|PHOENIX|AT&T|RACK2') = 2

d('US|PHOENIX|AT&T|RACK1','US|PHOENIX|ATM|RACK7') = 3

d('US|PHOENIX|AT&T|RACK1','US|CHICAGO|AT&T|RACK2') = 4

d('US|PHOENIX|AT&T|RACK1','US|ATM') = 4

d('US|PHOENIX|AT&T|RACK1','DE|BERLIN|ATM|RACK175') = 5

okay numbers slay πŸ’…


Copyright (C) 2026 Jakub Kruszona-Zawadzki, Saglabs SA

This file is part of MooseFS.

MooseFS is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 (only).

MooseFS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, see <https://www.gnu.org/licenses/>.

⚠️ the warranty thing is real, bestie. no warranty, no cap, read the license. πŸ’€

πŸ‘€ SEE ALSO πŸ‘€


and that's the whole page, bestie!! 🫢 this was MooseFS 4.59.2-1, dated May 2026 β€” go forth and organize your racks, you absolute icon πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ‘‘

πŸ“¦ where this page comes from