Skip to content

Provisioning new hosts

jbrown-xentity edited this page Apr 26, 2022 · 9 revisions

Deprecated content, no longer relevant

Ansible

Before we can run ansible, we need to install python on the hosts. TODO: include python in the AMI so this step isn't necessary.

$ for host in ...; do ssh $host DEBIAN_FRONTEND=noninteractive apt-get install -y python3; done

Disk mounts

All hosts are provisioned with a 16G volume for /var/log. The disk must be manually initialized and mounted. Some instances (solr, jenkins) have additional volumes for data which also must be manually initialized and mounted.

Mount /var/log

  1. Run lsblk to inspect block devices and make sure the new volume is available. For example, you should see 16GB /dev/xvdf in the list.
 lsblk
  1. Make an ext4 file system.
mkfs /dev/xvdf -t ext4
  1. Create /mnt/log/ and copy over existing log files.
mkdir /mnt/log
mount /dev/xvdf /mnt/log
rsync -avzh /var/log/ /mnt/log/
  1. Modify /etc/fstab to add this line so that the partition is available on boot.
/dev/xvdf /var/log ext4 defaults,discard 0 2

Reboot and verify /var/log is getting new logs.

Mount /data (for instances that need /data partition)

  1. Run lsblk to inspect block devices and make sure the new volume is available. For example, you should see 100GB /dev/xvdg in the list.
 lsblk
  1. Make an ext4 file system.
mkfs /dev/xvdg -t ext4
  1. Create /data and mount it.
mkdir /data
mount /dev/xvdg /data
  1. Modify /etc/fstab to add this line so that the partition is available on boot.
/dev/xvdg /data ext4 defaults,discard 0 1

Reboot and verify /var/log is getting new logs.

Note: for newer t3 instances, NVMe virtual devices are used instead of SATA, which look like /dev/nvme0n1p1, /dev/nvme1n1p1, etc.

Jumpbox

Install the root SSH key to ~/.ssh/id_rsa (with public key ~/.ssh/id_rsa.pub).

Clone this wiki locally