filmov
tv
Rsync for syncing the files and folders between two CentOS 7 Linux EC2 Instance

Показать описание
This video describes Rsync for syncing the files and folders between two CentOS7 EC2 Instance.
Crontab For scheduling rsync between to Centos7 Linux EC2 instance
Command in this video:
* Both server means here both server as a node1 and node2 users
* Both servers as root users mean the command needs to run as a root user.
* server1 or node1 IP: 172.31.14.207 and server2 or node2 IP: 172.31.15.99
* Instead of use private ip we can use here public IP or public dns of aws.
* The command "clear" is used for clearing window and ls or ls -al to check list of directory.
1) useradd node1(both servers. For server 2 replace node1 with node2),
2) su - node1 or su - node2 to access either server user.
3) pwd(both server)(This command shows which folder or path you are situated now)
4) ssh-keygen(both server) and press enter 3 times, don't put password or anything anywhere.
5) cd .ssh (both server)
6) touch ~/.ssh/authorized_keys(both server)
7) chmod 600 ~/.ssh/authorized_keys(both server)
Now a very important time...
and vice versa. Let's do it. Keep checking whether anything missing at the time of copying..here you sees I missed "s" of ssh
9) Run the command "vi authorized_keys" and press I (Both server) to edit.
10) press esc, type :wq! and hit enter
11) check the content: "cat authorized_keys" (Both server)..Looks good..
12) service sshd restart (both server as a root user)..now su - node1 or su - node2 to access either server user.
15) mkdir /test (both server as a root user) and touch file1 file2 file3 (Server1) and
chown -R node1:node1 /test (both server as a root user)
chmod -R 750 /test(both server as a root user)
Lets again su - node1 or su - node2 to check sync...Before that, we check both server /test folder via ls command..
Server 1 /test folder contains 3 files but server 2 /test folder is empty..lets sync
17) cd /test and touch file4 (Server2).
Note: by running command "man rsync" you find different switch and use case except "-avr". "-avr --update" is used to sync only the changes not full folder and it's content.
Crontab For scheduling rsync between to Centos7 Linux EC2 instance
Command in this video:
* Both server means here both server as a node1 and node2 users
* Both servers as root users mean the command needs to run as a root user.
* server1 or node1 IP: 172.31.14.207 and server2 or node2 IP: 172.31.15.99
* Instead of use private ip we can use here public IP or public dns of aws.
* The command "clear" is used for clearing window and ls or ls -al to check list of directory.
1) useradd node1(both servers. For server 2 replace node1 with node2),
2) su - node1 or su - node2 to access either server user.
3) pwd(both server)(This command shows which folder or path you are situated now)
4) ssh-keygen(both server) and press enter 3 times, don't put password or anything anywhere.
5) cd .ssh (both server)
6) touch ~/.ssh/authorized_keys(both server)
7) chmod 600 ~/.ssh/authorized_keys(both server)
Now a very important time...
and vice versa. Let's do it. Keep checking whether anything missing at the time of copying..here you sees I missed "s" of ssh
9) Run the command "vi authorized_keys" and press I (Both server) to edit.
10) press esc, type :wq! and hit enter
11) check the content: "cat authorized_keys" (Both server)..Looks good..
12) service sshd restart (both server as a root user)..now su - node1 or su - node2 to access either server user.
15) mkdir /test (both server as a root user) and touch file1 file2 file3 (Server1) and
chown -R node1:node1 /test (both server as a root user)
chmod -R 750 /test(both server as a root user)
Lets again su - node1 or su - node2 to check sync...Before that, we check both server /test folder via ls command..
Server 1 /test folder contains 3 files but server 2 /test folder is empty..lets sync
17) cd /test and touch file4 (Server2).
Note: by running command "man rsync" you find different switch and use case except "-avr". "-avr --update" is used to sync only the changes not full folder and it's content.