Deployment - digitalepidemiologylab/crowdbreaks-streamer-v1 GitHub Wiki
Deployment to production on AWS EC2 (Ubuntu 18.04)
- Update system
sudo apt update && sudo apt upgrade
- Create SSL keypair
ssh-keygen -t rsa -b 4096 -C "[email protected]"
- Add public key to deploy keys in github repository and clone repo
- Set secrets in
secrets.list
cp secrets.list.example secrets.list
- Install docker and docker-compose
- Install certbot, obtain certificates for
kibana.crowdbreaks.org
andapi.crowdbreaks.org
and set up automatic renewal - Run deploy script
source build_production.sh
Redis warnings
Redis will issue two warnings on start-up when run on a EC2 machine. Both are config settings to be made on the host machine. After having made those settings Redis needs to be restarted.
# Fix "WARNING overcommit_memory is set to 0! Background save may fail under low memory condition."
sudo sysctl vm.overcommit_memory=1
# Fix "WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis"
sudo sh -c "echo never > /sys/kernel/mm/transparent_hugepage/enabled"
sudo sh -c "echo never > /sys/kernel/mm/transparent_hugepage/defrag"