2

I have two servers running Linux, namely A and B. There is a large amount of data on A, but I want to use the program x on B to process those data. It would be inefficient to transfer all data from A to B, while it is also annoying to solve all dependencies to get x working on A. Therefore, the best solution should be to fetch x and its library dependencies from B into memory of A and run x on A locally.

So I would like to ask, is there any convenient way or existing tool to execute a remote program to process local data?

My idea is to mount the root directory of B on A using tools like sshfs, bind mount the data directory into the root dir, and chroot into it. However, this is not very convenient and requires additional setup for file systems like /proc, /dev.

To be more clear, there are mainly three inconvenient aspects:

  1. I need root permission on A, which is usually not granted for a typical user of a server.
  2. I need to setup various kernel file systems in the mounted root dir of B on A, like /proc, /sys, /dev. Running as root on a server also requires additional carefulness.
  3. After chroot, my personal configurations on A are all replaced by those on B. I only want to use x to process my data and would like to stay in a familiar environment :)

BTW, I need chroot because I need to run program x, which is on B; I could not mount data directory in A onto B because I want to avoid transferring data; so I could only transfer program from B to A, and I need chroot because x needs different libraries which are not available on A.

12
  • How about VFS? Commented Feb 27, 2014 at 7:46
  • @SparKotॐ could you give more details? Do you mean chroot into a VFS? thanks:)
    – jiakai
    Commented Feb 27, 2014 at 7:49
  • 1
    You could use samba or nfs
    – Graeme
    Commented Feb 27, 2014 at 10:01
  • Did you try your own idea of mounting B:/ on A? What is so inconvenient about it?
    – grebneke
    Commented Feb 27, 2014 at 11:19
  • 1
    @terdon because I need to run program x, which is on B; I could not mount data directory in A onto B because I want to avoid transferring data; so I could only transfer program from B to A, and I need chroot because x needs different libraries which are not available on A
    – jiakai
    Commented Feb 27, 2014 at 15:33

1 Answer 1

1

If the only problem is shared libraries, then the simplest thing is to recompile the program with static linking, giving you one big executable which doesn't need any shared libraries.

Alternatively, you could find the shared libraries (with ldd) and copy them over. Use LD_LIBRARY_PATH (see the ld.so man page) to point the executable to the location of the shared libraries.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .