Prerequisites
-
Linux Virtual Machine
i. Ubuntu 20.04 or higher
ii. 2 vCPUs
iii. Min. 8 GiB of Memory
iv. Min. 60 GiB of Storage -
Networking Requirements for Initial Setup:
i. 80 (http): for connecting to the server from the browser
ii. 443 (https): for connecting to the server from the browser
iii. 22 (SSH): To allow you to SSH into your instance and configure it
iv. 8080 (DronaHQ): This is the default port DronaHQ runs on -
Installing self hosted
Follow documentation for installing DronaHQ self hosted. Click here
Installation will initialize mysql and mongodb as docker containers.
Scaling DronaHQ installation
For scaling DronaHQ Self Hosted, you will need to set up a managed remote database for MySQL and MongoDB. Also you will need to set up AWS S3 bucket for storing files and other resources uploaded/generated using DronaHQ Self hosted.
-
Requirements
1.1 MySQL RDS
1.2 MongoDB RDS
1.3 AWS S3 bucket -
Migrate MySQL from docker container to RDS
2.1. Login to self-hosted server
2.2. Take backup of database using following commandscd ~/dronahq/self-hosted sudo docker exec -i dronahq-self-hosted-mysqldb /usr/bin/mysqldump -u root --password=<%password%> --databases dhq_audit_log db5x --add-drop-database --triggers --events --routines --single-transaction > mysqldump.sql echo "SET GLOBAL log_bin_trust_function_creators = 1;"|cat - mysqldump.sql > /tmp/out && mv /tmp/out mysqldump.sql sed -i 's/DEFINER=[^ |\*]*//g' mysqldump.sql
Mysqldum.sql file will now have database dump which we can restore on a remote database.
2.3. Restore mysql dump on RDS with following command
sudo docker exec -i dronahq-self-hosted-mysqldb /usr/bin/mysql --host=<% remote host %> --port=<% port %> --user=<% remote %> --password=<% remote password %> < mysqldump.sql
-
Migrate MongoDB from docker container to RDS
3,1 Login to self-hosted server
3.2. Take backup of database using following commandscd ~/dronahq/self-hosted sudo docker exec -i dronahq-self-hosted-mongodb /usr/bin/mongodump --username root -- password <% password %> --authenticationDatabase admin --db db5x_studio --out /mongodbdump cd ~/dronahq/self-hosted sudo docker exec -i dronahq-self-hosted-mongodb /usr/bin/mongodump --username root --password <% password %> --authenticationDatabase admin --db db5x_studio --out /mongodbdump sudo docker cp dronahq-self-hosted-mongodb:/mongodbdump ~/mongodbdump
mongodump folder will now have a database dump which we can restore on a remote database.
3.3. Restore MongoDB dump on RDS with following command
sudo docker exec -i dronahq-self-hosted-mongodb /usr/bin/mongorestore --host=<% remote host %> --port=<% remote port %> -u <% username %> -p <% password %> --db db5x_studio /mongodbdump/db5x_studio --authenticationDatabase admin
-
Create AWS S3 bucket and generate credentials with read/write access
Prepare AWS s3 credentials for using it with DronaHQ Self Hosted. We will need the following information about your AWS S3 bucket.
- accesskeyId
- secretAccessKey
- Bucket name
- Bucket region
-
Configure MySQL RDS, MongoDB RDS, AWS S3 bucket credentials in dronahq.env file. In the environment file add modify following variables.
- DHQ_MYSQL_HOST
-
DHQ_MYSQL_USER
-
DHQ_MYSQL_PASSWORD
-
DHQ_MYSQL_DATABASE
-
DHQ_MYSQL_PORT
-
DHQ_AUDIT_LOG_MYSQL_DATABASE
-
DHQ_MONGODB_HOST
-
DHQ_MONGODB_USER
-
DHQ_MONGODB_PASSWORD
-
DHQ_MONGODB_DATABASE
-
DHQ_MONGODB_PORT
-
FILE_UPLOAD_TYPE=”aws”
-
DHQ_AWS_REGION
-
DHQ_AWS_ACCESS_KEY_ID
-
DHQ_AWS_SECRET_ACCESS_KEY
-
DHQ_AWS_BUCKET_NAME
-
Once you follow all above steps, restart docker container with following commands.
cd ~/dronahq/self-hosted sudo docker-compose restart webapp
-
Now, for scaling DronaHQ self hosted, you can run multiple containers of dronahq-self-hosted-webapp with same configuration. Or you can run multiple instances of your linux (ubuntu) instance.
-
You can use load balancer to manage traffic between multiple containers/instances.