Comment by QuantumNomad_
10 hours ago
I have had various servers over time running FreeBSD, both physically in my home, rented bare metal servers and rented VPSes.
So I’m not exactly a newcomer to FreeBSD, but I am wondering if this book might be relevant to me anyways.
My main issue with my servers that I would like to solve better, is how to organize the file system layout and ZFS “datasets” in a better way.
I generally don’t use separate disks for system and other things. Whatever number of disks are available, anywhere from a single disk or a pair of disks up to several handfuls of disks become a zpool where both the system is installed and all my data lives too.
For example, this is the zpool setup of one physical bare metal rented server I have, consisting of ten disks all put into a single raidz3 grouping:
NAME STATE READ WRITE CKSUM
zroot ONLINE 0 0 0
raidz3-0 ONLINE 0 0 0
ada0p3 ONLINE 0 0 0
ada1p3 ONLINE 0 0 0
ada3p3 ONLINE 0 0 0
ada5p3 ONLINE 0 0 0
ada2p3 ONLINE 0 0 0
ada4p3 ONLINE 0 0 0
da0p3 ONLINE 0 0 0
da1p3 ONLINE 0 0 0
da2p3 ONLINE 0 0 0
da3p3 ONLINE 0 0 0
This particular server I’m underutilising in terms of total amount of space I am using va how much it can hold, so it’s due to be replaced by something with fewer disks. At the moment I use this server only for backup storage, and that will be the role of the server that replaces it too.
Another physical bare metal server I rent has only two disks, so I have them in a mirror setup:
NAME STATE READ WRITE CKSUM
zroot ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
ada0p2 ONLINE 0 0 0
ada1p2 ONLINE 0 0 0
I use ZFS send and recv to make backups of this server to the one with the many disks.
This server with the mirror pool runs some actual services like a couple of websites and a PeerTube instance etc, all in separate jails.
However, in spite of the goodness of having jails it’s still a bit of a mess I’ve made, that make it somewhat difficult (time consuming) to set up a new server with a similar setup to replace it one day when the disks give up and I have to restore from backup.
In particular I have a bit of config and other files spread out in the host system itself.
I am hoping that given that this book looks to be focused in part on practical examples, that perhaps if I buy this book I can get some inspiration for how I can better set up a new server and make it so that in the future that one in turn would be quicker to move between machines.
Also, the pool on the server with the mirrored disk setup has become extremely fragmented:
NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
zroot 3.62T 3.18T 453G - - 48% 87% 1.00x ONLINE -
Which I am pretty sure is also the reason why sshing into it takes around 30 to 60 seconds to get to the shell.
What I really would like is to have it so that one ZFS “dataset” contains only the base system as it comes from a fresh install, and to have config changes I’ve added be separately stored and somehow overlaid on top of that. While at the same time having it so that when I install updates to the system, the default config files that are updated are not written out into the overlay but instead replace what’s below in the default install. If that makes sense.
And perhaps that instead of having many pkg installs for various tools in the host system that I add a sort of management jail where I can install various tools and edit files and manage the server, if possible.
Also I am wondering if running multiple instances of PostgreSQL server each in their separate jails is better, or having a single PostgreSQL server in a single jail that all the other jails share for services I have in jails where the services use PostgreSQL.
forums.freebsd.org may be a good place to discuss these sort of questions.