FreeBSD server with ZFS storage and applications/service running in jails
FreeBSD 14.0-RELEASE-p4 diyIT amd64
Multiple pools based on type of data and access requirements. Allows disks to spin down when not in use, increasing their life and reducing overall power consumption.
Key ZFS settings
# set for all zfs pools zfs set atime=off# set for all zfs datasets with compressed data, like video zfs set compression=off zfs set logbias=throughput zfs list -o mountpoint,recordsize,sync,logbias,compression,atime
Motherboard - Gigabyte MD90
CPU x 2 - Intel E5-2689-V3 - 12 core, 2.5Ghz, 30MB cache
Memory x 24 - 8GB DDR4 2133MHz ECC
Storage Controllers
Storage Disks
Network Controller (MB integrated)
FreeBSD 12.0-RELEASE-p12 r354847M kernel with FreeBSD 11.2-RELEASE mps(LSI SAS9207-4i4e) driver (to stop the kernel from crashing due to race conditions under load)
Applied the 344061, 344356, D20868, D20869 vnet related patches (to reduce crashes when deleting jails)
Reference vnet
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=235699
https://svnweb.freebsd.org/base?view=revision&revision=344061
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=235684
https://svnweb.freebsd.org/base?view=revision&revision=344356
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=234985
https://reviews.freebsd.org/D20868
exec_prestop="ifconfig epair0b -vnet ioc-$JAIL"
Reference mps
https://bugs.freebsd.org/bugzilla//show_bug.cgi?id=224496
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=235559
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=237937
Installation:
Setup swap on ZFS volume
zfs create zroot/raw zfs create -V 64G -o org.freebsd:swap=on -o checksum=off -o compression=off -o dedup=off -o sync=disabled -o primarycache=none zroot/raw/swapvol swapon /dev/zvol/zroot/raw/swapvol
Install ZSH instead
pkg install zsh zsh-autosuggestions zsh-syntax-highlighting git-prompt.zsh git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>! ~/.zshrc chsh -s /usr/local/bin/zsh pw usermod -n a -G wheel -s /usr/local/bin/zsh visudo and uncomment wheel $ cat .zshrc source ~/powerlevel10k/powerlevel10k.zsh-theme # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ZSH_HIGHLIGHT_STYLES[suffix-alias]=fg=cyan,underline ZSH_HIGHLIGHT_STYLES[precommand]=fg=cyan,underline ZSH_HIGHLIGHT_STYLES[arg0]=fg=cyan ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern cursor) ZSH_HIGHLIGHT_PATTERNS=('rm -rf *' 'fg=white,bold,bg=red') #if [ -z "$TMUX" ] #then # tmux attach -t TMUX || tmux new -s TMUX #fi
Install ZSH with oh-my-zsh "powerlevel10k/powerlevel10k"
pkg install zsh sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/themes/powerlevel10k set in ~/.zshrc: plugins=(git osx iterm2 docker zsh-autosuggestions zsh-syntax-highlighting) set in ~/.zshrc: ZSH_THEME="powerlevel10k/powerlevel10k" chsh -s /usr/local/bin/zsh pw usermod -n a -G wheel -s /usr/local/bin/zsh visudo and uncomment wheel
Packages:
Configurations:
00 08,12,16,20 * * * /root/FreeBSD/scripts/zfs_health.sh 00 2 * * 0 /usr/local/sbin/zfSnap -d -s -S -a 2w -p weekly_ -r zroot ship data base 00 3 * * 6 /root/FreeBSD/jails/jails-update-pkgs.sh pkgp-only
Updates