- Select pin on top of the page and drag VPC, EDS, ElasticCache and EC2 to it.
- Create VPC in Your VPC menu
- Create Subnet
- Create Gateway
- Associate subnet with gateway
- Associate routing table with subnets
- Create security group for each instance (VPC, EDS, etc.)
- Setup inbound rules for each group
- Create subnet group for RDS
- Create DB instance
- On the last step select the RDS security group
- Select
No
on monitoring
- Create subnet group
- Redis Setting
- config your custom port
- Add keypair to EC2
# Create key pair on your machine
$ ssh-keygen -C workshop-YOUR_NAME -f ~/.ssh/workshop-YOUR_NAME
$ ssh-keygen -C workshop-YOUR_NAME-deployer -f ~/.ssh/workshop-YOUR_NAME-deployer
- Launch EC2 instance
- Choose subnet
- Add Elastic IP (remember it!)
- 13.113.140.115
- Create a load balancer
- Configure ELB target
- Add hostname to ssh
Host workshop.YOUR_NAME.app1 XXX.XXX.XXX.XXX
HostName XXX.XXX.XXX.XXX
IdentityFile ~/.ssh/workshop-YOUR_NAME
- Connect to the db through ssh
$ ssh [email protected]_NAME.app1
$ ssh -Cfo ExitOnForwardFailure=yes -NL 5433:POSTGRES_HOSTNAME:5432 [email protected]_NAME.app1
# Try accesing the db on RDS
$ psql -v -d oozou -h localhost -p 5433 - U oozou
Note: Capistrano for deployment and Ansible for config environment
3. Config -> config/deployer/integration.rb with your host name and stuffs
4. Run EDITOR=vi ansible-vault edit devops/hosts/integration/group_vars/all
to open the config file
5. Get elastic load balancer hostname
6. Change the configuration. Use your own hostname
7. Use ansible to install env on host
# Run playbook
$ ansible-playbook -i devops/hosts/integration/hosts --ask-vault-pass devops/playbooks/app_server_setup.yml
- Try
ssh [email protected]_NAME.app1
(app instance host name) - Deploy!
bundle exec cap cap integration deploy
- You need to install correct Ruby version and install
Bundle
gem