Setting up a new DaDesktop Server
Deploying a DD Node on GTHost or Hetzner Servers
These notes are here to assist you in deploying a DaDesktop Node (Server) on a GTHost, Hetzner, or similar bare metal Linux server in Hong Kong. Keep in mind that they might change as the installation and deployment scripts evolve.
We're assuming you've already purchased a server and will be setting it up with Ubuntu Jammy 22.04. If you have two or more disks and enough space, you can use RAID0 (striping) to speed up disk access. With Hetzner, this must be configured using the 'installimage' process while in Rescue mode.
Preparing and Installing the OS on a GTHost / Hetzner Server
- First, use the provided root credentials to SSH in. Run 'apt update' and 'apt upgrade' to bring all packages up to date, then follow up with 'apt autoremove' to clean out any obsolete packages.
- If you're on Hetzner, the system will boot into rescue mode. You'll need to specify the distribution requirements, software RAID (like mdm, xfs, IPv4) before rebooting and completing the upgrade. Usually, you can stick with the defaults for the small /boot and /boot/esp partitions—use ext4 not xfs, and skip the swap partition since it's unnecessary. Let the root partition use xfs and take up all remaining disk space.
- For LeaseWeb or other providers, you'll have to switch the root filesystem from ext4 or btrfs to xfs. The steps that follow are only a guide—getting the root partition to use xfs is trickier than simply setting up /bigdisk with xfs, because filesystem changes must be performed outside the OS; you can't safely alter the root filesystem while it's mounted.
-
Where possible, use your provider's tool to create the xfs filesystem—it's much simpler. If not, from the rescue system you can run:
mkfs.xfs -f /dev/mdx (this formats the root with xfs, and -f forces the overwrite).
Note that we no longer set up /bigdisk as a separate partition; it's now just a directory under root. - Mount the root partition as xfs from outside the OS, either via command 'mount -t xfs /dev/mdX /' or using the system portal.
- If you still have a separate /bigdisk partition (which is now not typical), add 'defaults,nofail 0 0' in /etc/fstab so the system can boot even if that partition fails to mount.
- Run 'systemctl daemon-reload' to let systemd pick up any changes to /etc/fstab.
- Then do 'mount -a' to verify all partitions are mounted as intended, and check with 'df -T'.
-
Reboot the server
Running the DaDesktop Installation Script
- SSH into the server, e.g., user@xxxxx.
- Run the installation using the DaDesktop install script, like so:
- curl https://www.dadesktop.com/d > d
- At this stage, we recommend upgrading the base OS from 22.04 to the latest Ubuntu release. Right now that’s Ubuntu 23.10 (Mantic), which will soon become 24.04 (Noble).
- The easiest way to do this is with the update-os script found in /apps/dadesktop_npnode_deploy/modules/00-upgrade-os. This script handles the distribution upgrade for you, swapping the apt sources from jammy to mantic (or nautic) so you can jump directly to the new release in one step instead of multiple. Although skipping intermediate upgrades is usually not recommended, the minimal number of packages installed makes it quite safe.
-
If DNS stops working during the distribution upgrade (we've seen this happen once), fix it with:
rm /etc/resolv.conf ; echo "nameserver 8.8.8.8" > /etc/resolv.conf - If you like, you can assign a specific hostname—for example lo33uk.npg.io—especially if you want to re-use a node name that was previously set up. If needed, reboot to apply the new hostname.
- Then, we kick off the main script to install the DD Node. It’s a good idea to use tmux to guard against a broken SSH connection during the process. In the directory where you downloaded the script, run 'bash d'.
- Watch the on-screen output for any errors. While the script runs, your server’s IP will be automatically added to the NP access list. You might need to wait a couple of minutes for the whitelist cron job to update before you can proceed.
- Keep an eye on the script’s progress and address or report any issues that pop up.
- Run the cleanup script at /apps/dadesktop_npnode_deploy/modules/00-cleanup. It removes a lot of unneeded packages and may downgrade some.
- Execute /apps/zabbix-agent/services/test-all.sh to check for any remaining problems.
- If there are any unmaintained packages left, remove them with 'apt purge xxx yyy' and delete any broken links that appear.
-
Finally, reboot and verify that everything works as expected.
Testing the DD Node After Installation
- In the DaDesktop GUI, check the new DD server entry and run some tests, such as testing TPAPI.
- Add start and expiry dates for the server in DaDesktop, and optionally assign it to a datacenter.
- Verify the new server’s operation in Zabbix and resolve any issues if needed.
- Do a test run by adding a Standalone instance to the server.
- If appropriate, add the server to a Datacenter.
- Optionally, you can set up billing rules for the new server.
- Copy over any operating system templates that are required.
- If this server is intended for a specific course, notify the Trainer or Coordinator so they know to use it.
Enjoy!
