- 
                Notifications
    
You must be signed in to change notification settings  - Fork 163
 
Provisioning new hosts
        jbrown-xentity edited this page Apr 26, 2022 
        ·
        9 revisions
      
    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
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.
- Run 
lsblkto inspect block devices and make sure the new volume is available. For example, you should see 16GB/dev/xvdfin the list. 
 lsblk
- Make an ext4 file system.
 
mkfs /dev/xvdf -t ext4
- Create 
/mnt/log/and copy over existing log files. 
mkdir /mnt/log
mount /dev/xvdf /mnt/log
rsync -avzh /var/log/ /mnt/log/
- Modify 
/etc/fstabto 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.
- Run 
lsblkto inspect block devices and make sure the new volume is available. For example, you should see 100GB/dev/xvdgin the list. 
 lsblk
- Make an ext4 file system.
 
mkfs /dev/xvdg -t ext4
- Create 
/dataand mount it. 
mkdir /data
mount /dev/xvdg /data
- Modify 
/etc/fstabto 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.
Install the root SSH key to ~/.ssh/id_rsa (with public key ~/.ssh/id_rsa.pub).