Skip to content
Snippets Groups Projects
Commit 363e0020 authored by balameb's avatar balameb
Browse files

Adds EFS

parent 933088d2
No related branches found
No related tags found
1 merge request!46High Availability on AWS
Loading
Loading
@@ -162,6 +162,22 @@ subnet and security group and
 
***
 
## Elastic File System
This new AWS offering allows us to create a file system accessible by 

EC2 instances within a VPC. Choose our VPC and the subnets will be

automatically configured assuming we don't need to set explicit IPs.
The 
next section allows us to add tags and choose between General
Purpose or 
Max I/O which is a good option when being accessed by a
large number of 
EC2 instances.


![Network and Security](/images/high-availability/elastic-file-system.png)
To actually mount and install the NFS client we'll use the User Data
section when adding our Launch Configuration.
***
## Initiate AMI
 
We are going to launch an EC2 instance and bake an image so that we can
Loading
Loading
@@ -202,13 +218,10 @@ and add a custom TCP rule for port 6379 accessible within itself.
To connect through SSH you will need to have the `pem` file which you
chose available and with the correct permissions such as `400`.
 
After accessing your server don't forget to update and install the nfs
client.
After accessing your server don't forget to update and upgrade your
packages.
 
```
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install nfs-common
```
sudo apt-get update && sudo apt-get upgrade -y
 
Then follow installation instructions from
[GitLab](https://about.gitlab.com/downloads-ee/#ubuntu1404), but before
Loading
Loading
@@ -249,15 +262,19 @@ Next we only need to configure the Redis section by adding the host and
uncommenting the port.
 
![Network and Security](/images/high-availability/redis-cluster.png)
The last configuration step is to [change the default file locations ](http://docs.gitlab.com/ee/administration/high_availability/nfs.html)
to make the EFS integration easier to manage.
![Network and Security](/images/high-availability/change_file_loc.png)
Finally run reconfigure, you might find it useful to run a check and
a service status to make sure everything has been setup correctly.
 
```
sudo gitlab-ctl reconfigure
sudo gitlab-rake gitlab:check
sudo gitlab-ctl status
```
sudo gitlab-ctl reconfigure
sudo gitlab-rake gitlab:check
sudo gitlab-ctl status
 
If everything looks good copy the Elastic IP over to your browser and
test the instance manually.
Loading
Loading
@@ -304,9 +321,24 @@ Scaling Group.
This option is also available through the EC2 dashboard on the left
sidebar. Press on the create button. Select the new image on My AMIs and
give it a `t2.medium` size. There are no requirements on the details
other than a name but the Advanced Details has a User Data section which
allows you to add a custom script for startup and other neat options.
give it a `t2.medium` size. To be able to use Elastic File System we need
to add a script to mount EFS automatically at launch. We'll do this at
the Advanced Details section where we have a [User Data](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html)
text area that allows us to add a lot of custom configurations which
allows you to add a custom script for when launching an instance. Let's
add the following script to the User Data section:
#cloud-config
package_upgrade: true
packages:
- nfs-common
runcmd:
- mkdir -p /gitlab-data
- chown ec2-user:ec2-user /gitlab-data
- echo "$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone).file-system-id.aws-region.amazonaws.com:/ /gitlab-data nfs defaults,vers=4.1 0 0" >> /etc/fstab
- mount -a -t nfs
- sudo gitlab-ctl reconfigure
 
On the security group section we can chosse our existing
`gitlab-ec2-security-group` group which has already been tested.
Loading
Loading
source/images/high-availability/change_file_loc.png

130 B

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment