TABLE OF CONTENT
1. Introduction to Amazon DataSync2. Step to covert your Linux machine into an Samba Server3. Create a DataSync agent on EC2 in a VPC4. Create the agent in DataSync in AWS Portal5. Create a Task6. Start the Transfer7. Summary8. CloudThat 9. FAQsIntroduction To AWS DataSync
Increased demand for backups to cloud environments has led to increased demand for long-term storage. This is to protect against any disaster-related events. Customers need reliable utility tools to help them securely migrate their data. They also want to automate these tasks using a reliable method to transfer their data to cloud-like AWS In S3, EFS or Windows file server.
AWS DataSync allows you to connect your on-prem storage with S3 and many other services through a reliable automation architecture. AWS DataSync now integrates file share systems such as NFS (network File System) and SMB(Server Message Block) to transfer your files.
DataSync allows you transfer all files or just the changed data when you start transferring. It uses metadata from previous data captures to reduce the size of the transfer and the associated time. AWS DataSync uses a DataSync Agent, which can be installed on either on-premises hardware like Hyper-V or VMware, or on an EC2 machine with AWS-provided AMI. This server connects the target server to the source server on S3 EFS.
I will show you how to transfer files from SMB (Samba server) into the S3 using AWS Data DataSync.
Step 2: Cover your Linux machine to become a Samba Server
Here, I am using an Amazon Linux VPC AMI to act as a remote Samba Server.
Launch Linux EC2 here. I am using Amazon Linux to install SMB server.
Open port 22 and port 445 in the security group to any location, i.e., the 0.0.0.0/0 range (later we can change this to a dedicated Ip).
It is an Amazon Linux 2 AMI; we need to follow the below steps to change the hostname to a user-friendly namesudo vi /etc/cloud/cloud.cfg1sudo vi /etc/cloud/cloud.cfg
At the end of the file, add the below line and savepreserve_hostname: true1preserve_hostname: true
Change Hostname$ sudo hostnamectl set-hostname samba-server$ sudo yum update -y$ sudo reboot123$ sudo hostnamectl set-hostname samba-server$ sudo yum update -y$ sudo reboot
Install Samba, Samba client, and cifs–utils$ sudo sudo su–# yum installation -y Samba samba–client cifs–utils12$ sudo sudo su–# yum yum -y Samba samba–client cifs–utils
Configuration file changes# vim /etc/samba/smb.conf1# vim /etc/samba/smb.confsecurity = user hosts allow = ip address of Data DataSync agent VM *** Add the loopback IP and the VPC starting ip as shown above interfaces = lo eth0 passdb backend = smbpasswd:/etc/samba/sambapasswd.txt printing = cups printcap name = cups load printers = yes cups options = raw[homes] comment = Home Directories valid users = %S, %D%w%S browseable = No read only = No inherit acls = Yesprinters] comment = All Printers path = /var/tmp printable = Yes create mask = 0600 browseable = No[print$] comment = Printer Drivers path = /var/lib/samba/drivers write list = @printadmin root force group = @printadmin create mask = 0664 directory mask = 0775[samba] comment = Development documentation read only = no available = yes path = /smbfolder public = yes valid users = sambauser write list = sambauser writable = yes browseable = yes123456789101112131415161718192021222324252627282930313233343536security = userhosts allow = ip address of Data DataSync agent VM*** Add the loopback IP and the VPC starting ip as shown aboveinterfaces = lo eth
Simplify Cloud Data Migration With AWS DataSync – Amazon’s Online Data Transfer Service
TABLE OF CONTENT