welcome back to another video about hybrid storage and data migration with aws storage gateway now
in this particular lab we are going to review the lab architecture and we will create a primary and
a secondary assettory bucket and we will enable a cross region replication then we will configure a
file gateway and create an nfs file share and we will mount the file share to the linux instance
and migrate the data and then we will verify that the data is successfully mic rated
so let's get into it and then the first thing we will do is to basically start looking at the
lab architecture here as you can see we have a three aws region we have usb1 where we have an
amazon ec2 instance and we will create an nfs file share with the aws storage gateway service and
these will be replicated to two different assetty bucket we have the amazon ac3 binary bucket
in usb2 and amazon sa3 bucket in us west 2. the primary bucket is going to get the data from
the linux host and copied to this bucket and the secondary one is going to be the target for the
cross region replication and the idea behind the cross register replication is if the bucket the
first bucket is lost we can get our data from the replicated secondary bucket so the first
thing we need to do in task 2 is to go to acety and from asi 3 we are going to create a bucket
and let me call this first
bucket and i will give this the date of today
and we will create this rocket in us east 2 so this is will be here in ohio
and then we will enable in this bucket versioning and then we create a buggy next
thing is going to create another bucket and we are going to call this second
market and the date of today
which can give me an identical packet name which could be a unique across aws region
and this is will be in us west 2 and we will enable as well version click on create bucket
and now we want to enable cross region replication now when you enable cross region replication
you want to enable it from the first pocket to be replicated to the second bucket so let us
now go and select the bucket that we have in ohio us east
and we need to go to management and we will create a new replication rule
and we will call this rule cr full bucket replication the status enabled and this rule
should apply to all object in the bucket and now the destination we need to specify and here we can
specify a bucket in the same aws account or even sometimes you need to replicate this with another
aws account especially when you have account especially when you have multiple uh or multi
multi account pattern or when you have multi organization with multiple team
now this replication need a role and the lab sheet here is giving
us a 3d made role called acety-ssr role and we need to click on save
so now the replication is basically enabled between the source and the destination
bucket and now we need to add a file and that file should goes to the first packet in us ohio
we will upload any file so let me upload now any file that has no sensitive information in it
you could use any file i'm going to upload my certificate badge a png file and then upload
so this could be any file that you have in your computer so now click close and now if you want
to go and check the secondary bucket you will find that the replication only started after the first
modification now let us go and look at the second bucket and this is as i said this will take time
to see the file replicated here and you can see now the file that i uploaded the first bucket is
automatically replicated in the second one and let us now go to task four where we need to configure
a file gateway and create an nfs file share so we need to go to services and from services
we need to go to storage gateway and from the storage gateway we need to create a gateway
and now that gateway if you look here in step 20 you need to select amazon asset 3 file gateway
choose an amazon ec2 and this is basically will launch an instance
this now launch an ac2 instance and that ec2 instance it should be a t2 xlr
machine and that t2x large we want to select a few configuration here based on the lap sheet so
the first thing we need to do is to put this t2x large on the on premise vpc on a premise subnet i
need to add a new volume which is elastic flicker storage and this should be mount in the slash div
slash sdb and the size of this volume is going to be 100 150
with a delete on termination
enabled and we need to add tag and we will call this name
and we will call this a file gateway appearance
now in the security group we want to select an existing security group and as you can see the
lab has created for us a security group so we need to select the on the premise as well to attach
to this machine and review and launch now this should launch our ec2 instance so it is in
pending a state so we need to wait for it to be available now let us go to the aws gateway once
we have the ec2 machine ready and basically this is going to be click next and choose the service
endpoint and we click next now we need to copy the ip address of this machine the public ip
and paste it here in the ik address window now the gateway time zone is going to be gmt minus five
and the gateway name is going to be a file gate way
and then we go and activate gateway
and then we click save and continue on the gateway log group we want to disable
the login and then we want to select finish now we need to wait for the file gateway status to change
to running and this is will take like two minutes as you can see now the file gateway
is ready and the status is running so in step 49 after we managed to get the file gateway running
now what we need to do we need to basically select the file gateway
and we create a file share and that file share is going to be it will be first bucket dash 21-12-21
now the access object is going to be an nfs which is the default for audit we will keep the default
and now we click on next
now once you click uh on the next button in step 52
we want to add the amazon s3 storage configuration to configure the following settings the storage
class is going to be standard and we want to give bucket owner full control and we
guess the m-i-m-e type which is the type of the objects we have like json html and so on
and we need to enable request page this is will be disabled which means
the request of that file storage is going to pay for aws in our case we are going to pay
and we need to create an im so we need to paste the fgw in policy arn
and that basically we get it from the lab sheet so if we go to the show
you will find there is a fgw i am policy er and so we're going to copy that
and we click next
click next
let's go back i think we need to
put the iron here in this page
so that's the i am role that we need to paste it here in this
step then click next and then next and then agree
so at this step here we will monitor now the status of the deployment and we need to
wait to for the status to be available and so that so now in task five we want to mount the
file share to a linux instance and we will migrate the data and now we need to connect
to the on-premise linux server this means that we need to go to ec2 and get the public ip address
of the linux server i'm going to use the lab terminal here just for simplicity because as
you know the keys are there put ssh labs user is there so i'm going to call that directory and then
ssh minus i that's user at pim file put pen file and now ec2 user is the username
at the public ip of the on premise linux server that we have in the lab sheet created for us
click connect yes and now i am inside the terminal connecting to the labs user so i could now
basically skip to step 78 so we can just for example see the mounted data so if we go
less less command media which is ils data i will be able that there is a few images
in that folder now we need to create a directory that will be used to synchronize the data with
our assetted bucket using the following command so we're going to create a new directory and
mnt nfs ac3 so i'm going to copy for some reason that command is still there clear
so when you copy to this terminal maybe you need to consider doing the right click and paste
and now we want to mount the file share on the linux instance by using the command that
you copied at the end of the last task now this is basically the command that we copy
in the last task here so it's going to be amount minus 3 nfs minus o no
lookup hard and i p address with the first bucket path and then we will basically put
here the mount path which is the one we just created in the previous step so we'll go copy that
right click and now we need to map to put this here this is our mount target so we're
going to copy that a path here and paste it in the terminal and then press enter
let's go back and basically use the sudo because this command need
a root user and now the copy is finished now let us verify the file share we did df minus h
and you can see now that there is a new folder
for the bucket which is mounted to slash mnt slash nfs
sc3 and now that folder we can see it is mounted correctly
so let us now in step 82 copy the data that
we want to migrate to amazon sd3 into the share by using this command so we are going to copy
all the media that we have in the media folder slash data slash
star dot png which means i'm going to copy all the images to the destination mnt
nfs slash s3
and now from the terminal i managed to basically use the terminal in order to copy the data to
the mnt nfs s3 3 now and from the s3 we want to verify that we can see all the content of the data
in the bucket so let us go now to the first bucket you can see all the
images i copied in the previous step are here and also those files are replicated
as well in the second bucket in the replication so this is pretty much what you need to do
for this lab thank you for for seeing this video and see you in the next one