• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 336
  • 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

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