-
Git Bash
- This is used to access and manipulate the machines
- Download it here (alongisde other git softwrare): https://git-scm.com/downloads
-
Ruby
- This is used to interact withe the code of the databases
- Installed at: https://www.ruby-lang.org/en/downloads/
- Create two AWS instances
- Instructions to this can be seen below under setting up an amazon web server
- DB_README contains instructions how creating the DB instance correctly
- Make a note of the servers IPs
- Fork this repositry and download it in an appropriate location
- The various IPs will need to be changed based on the IPs assigned to the servers
- Setup the database server
- ./db_setup.sh
- Provision the database server
- cd db/
- chmod 777 db_provision.sh
- ./db_provision.sh
- Mongod status will be shown upon end of the provision script
- if no errors are present enter exit
- Setup the app server
- ./app_setup.sh
- cd app/
- chmod 777 provision.sh
- cd ..
- ./app/provision.sh
- pm2 start app.js -f will run the app
- Access the app
- The below links will lead to the app
- http://app_ip_here/post does not work currently
http://3.250.17.181/fibonacci/8
- app_setup.sh
- db_setup.sh
- app/provision.sh
- db/db_provision.sh
- link urls
Access AWS here https://eu-west-1.console.aws.amazon.com/console/home?region=eu-west-1
Steps to follow
- Select EC2
- Click on Instances
- Launch instance
- Select ubuntu server 16.04
- Version dependent on environment wanted
- Deploy to the vpc DevOps student network
- Create a subnet of EU west 1a.
- Enable Public IP
- Add storage
- Select 8GiB
- Next, add tags
- Name, Then appropriate name
- Security groups
- Create new group
- If already created a group, skip the below instructions previously created group
- Source for all will be My IP
- Add the below rows:
- SSH
- HTTP
- HTTPS
- Custom TCP. Port range: 3000
- Custom TCP. Port range: 8080
- Custom TCP. Port Range: 1024-65535
- This last port is the ephermal port, allowing installation of software
- Create new group
- Review and launch
- Upon launch it will ask for key pair.
- Select DevOps student.
- Normally an individual key pair would be created
- Download the relevant SSH key
- Place it an easy to reference location
- Navigate to AWS Instance
- Select actions with your instance selected
- Select networking
- Change security groups
- Add the relevant group
- This gives access the to person with that security group
Core data overload on Mongod
- If mongod shuts down once the app tries to connect to it you may not have correct inbound rules set up
- The error shown on mongod with the below command will be "core data overload"
sudo systemctl status mongod
- To fix this go to DB_README and make sure inbound rules are set per image in the file.
Infastructure as a service
- AWS provides server space and computing capacity amongst many other services it offers
What is EC2
- EC2 is Amazon Elastic Compute Cloud Capacity. It provides computing capacity over the cloud
What is a security group
- A type of firewall
- A list of IPs allowed and not allowed
Definition
- Environments are where code is run
Types
- Production is where the developers test it
- Testing - Where the code is tested vigorously
- Deployment - Where code is deployed to customers from