• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 349
  • Last Modified:

Replication

Hi Experts,

How do I replicate my application located on IP1server ( /opt/myapp) to IP2server (/opt/myapp) ?

Thank you.
0
fpoyavo
Asked:
fpoyavo
1 Solution
 
owensleftfootCommented:
There are several differnt ways - ftp,samba,nfs,uucp. What distro are the boxes running?
0
 
fpoyavoAuthor Commented:
I have redhat 8. Both machines have samba (there is no nfs, ftp is installed).
0
 
owensleftfootCommented:
Set up your application directory as a share in smb.conf Restart samba - service smb restart. In the other box create a mountpoint for it under /mnt, ie
mkdir /mnt/box1
Mount it with mount -t smbfs //machinename/sharename /mnt/box1
Go to /mnt/box1 and copy the files wherever you want.
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
fpoyavoAuthor Commented:
What if I would replicate starting from root ? How it can be done ?
0
 
owensleftfootCommented:
Set up root as a share. In the file /etc/samba/smb.conf of the server you want to copy files from add the following.

[root]
comment = root partition
path = /
browseable = yes
public = yes

Restart samba ie service samba (or smb) restart
From the other box issue the command mount -t smbfs //otherbox/root /mnt/yourmountpoint.
0
 
fpoyavoAuthor Commented:
What happens if some directories already exist ?
0
 
fpoyavoAuthor Commented:
Another thing I have noticed that some executables don't have X attribute after copied via samba. Why ? How to avoid it ?
0
 
jlevieCommented:
In the general case transferring an application from one system to another via Samba is unlikely to work. File/dir ownership and permissions won't be preserved with a direct copy. It is possible to use Samba shares or FTP as a transport media by tar'ing up an application directory on one system, copying the tar image to the other, and upacking it there, something like:

1) On system A

# cd /opt
# tar cvzf myapp.tar.gz myapp

2) Use FTP or Samba to copy /opt/myap.tar.gz to system B and there execute:

# cd /opt
# tar xvpf /path-to/myapp.tar.gz

Note that this may not be completely successful if the application requires specific things (config files, data dirs, special user accounts) to exist outside of /opt/myapp. Any of that must also be copied and/or set up on the target system.
0
 
patrick24Commented:
use rsync :)

cheers
0
 
da99rmdCommented:
Do you have ssh installed then use scp its safer and easy just do like this:
scp (filename) user@(ip):(path)
and you are done if this must be made automatic just add the host_keys to the host then you dont have to put in a pass and can be run from for example cron.

/Rob
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now