Data exchange between SuperMUC and Linux Cluster
This tutorial is dedicated to users who need to move files from SuperMUC to the Linux Cluster, or the other way round. For this purpose, a GridFTP server has been setup on smuc2cluster.drg.lrz.de, accessible only from SuperMUC. Before showing the details on how to perform a transfer, we would like to stress that some prerequisites are necessary:
- a certain degree of familiarity with the Globus Toolkit and grid certificates;
- you should have access to SuperMUC [see the section Registering IP address for the Internet firewall (SuperMUC only) on this page];
- a grid enabled account on the Linux Cluster;
Let's now consider some practical use cases.
File transfer from SuperMUC to Linux Cluster via globus-url-copy (command line)
login07:~> module load globus load tgftp 0.6.1 (PATH, MANPATH) load gtransfer 0.2.3 (PATH, MANPATH) load globus
If already loaded the previous command will not give any output (nor error). If the user gained access through gsissh, then a proxy is already available locally, as a consequence of the successful login. On the other hand, on a regular ssh shell, it is necessary to fetch a grid proxy certificate. Since the file system on SuperMUC is shared, it is not advisable (sometimes it is also illegal) to save the certificate (private key and public certificate) locally on the machine and then use grid-proxy-init to generate a proxy. In this case, it is much safer to use MyProxy. Supposing that a proxy is needed (because of the ssh login) and there is one available on myproxy.lrz.de under the username uname, then just type the following to retrieve it:
login07:~> myproxy-logon -l uname Enter MyProxy pass phrase: A credential has been received for user uname in /tmp/x509up_p19317.fileOEgPUY.1.
All the prerequisites have been fulfilled and it is possible to proceed with the transfer of a single file (let's say smuc.file in the user's $HOME folder) from SuperMUC to the Linux Cluster by means of the command line tool globus-url-copy:
login07:~> globus-url-copy -vb smuc.file gsiftp://smuc2cluster.drg.lrz.de/~/ Source: file:///home/hpc/[...]/ Dest: gsiftp://smuc2cluster.drg.lrz.de/~/ smuc.file 302903 bytes 1.28 MB/sec avg 1.28 MB/sec inst
- the -vb option to show the progress of the transfer;
- the tilde (~) to identify the home folder on the remote system;
- the source file has been identified using the relative path with respect to the current folder.
Let's assume now that the folder folder1 should be moved to the Linux Cluster. The command to use (and the related output) is
login07:~> globus-url-copy -vb -r -cd folder1/ gsiftp://smuc2cluster.drg.lrz.de/~/folder1/ [...] Source: file:///home/hpc/[...]/folder1/subfolder/ Dest: gsiftp://smuc2cluster.drg.lrz.de/~/folder1/subfolder/ file1 [...]
Please note that, in order to move folders:
- the options -r (recursive) and -cd (create directory) are mandatory;
- the source (folder1/) and the destination (gsiftp://smuc2cluster.drg.lrz.de/~/folder1/) need the trailing slash (the / at the end, identifying them as directories). If the character is skipped on either one or both sides, the transfer will fail;
- if the destination were simply gsiftp://smuc2cluster.drg.lrz.de/~/, the the content of folder1/ is would be copied in the root of $HOME. Specifying the destination as gsiftp://smuc2cluster.drg.lrz.de/~/folder1/ tells globus-url-copy that the folder should be created and then filled with the content found at the source side.
More options can be added (for both file and folder transfer) in order to increase the number of streams (and gain some speed) or to improve the reliability. Please refer to the section Advanced usage and performance enhancement in this page.
In case the user's grid certificate is linked to multiple accounts (i.e., account1 and account2) on the Linux Cluster, by default the first one is selected. If it necessary to use a specific one, different from the default, then it has to be specified to globus-url-copy together with the destination's address. For example, the command to copy a single file becomes globus-url-copy -vb smuc.file gsiftp://firstname.lastname@example.org/~/
File transfer from Linux Cluster to SuperMUC via globus-url-copy (command line)
Also this operation should be performed from SuperMUC. It is not possible to get a shell on smuc2cluster.drg.lrz.de. Once again, it is necessary to access SuperMUC and to obtain a grid proxy certificate, as explained in the previous section.
In order to move the file cluster.file from the Linux Cluster to SuperMUC, the command to issue on SuperMUC is:
login07:~> globus-url-copy -vb gsiftp://smuc2cluster.drg.lrz.de/~/cluster.file ./ Source: gsiftp://smuc2cluster.drg.lrz.de/~/ Dest: file:///home/hpc/[...]/ cluster.file 302903 bytes 2.51 MB/sec avg 2.51 MB/sec inst
Please note that to copy the file in the current folder preserving the name, the destination is simply ./. Should you need to copy a file to a different location, let's say alt_folder located in the current directory, renaming te file as from.cluster.file, then the whole command would be globus-url-copy -vb gsiftp://smuc2cluster.drg.lrz.de/~/cluster.file alt_folder/from.cluster.file.
The same applies to fetch the folder folder2 from the Linux Cluster:
login07:~> globus-url-copy -vb -r -cd gsiftp://smuc2cluster.drg.lrz.de/~/folder2/ folder2/; [...] Source: gsiftp://smuc2cluster.drg.lrz.de/~/folder2/subfolder/ Dest: file:///home/hpc/[...]/tfolder2/subfolder/ file2 [...]
Once again, if the source and the destination are folders, then the trailing slash (the /sign following the source and destination parameters of globus-url-copy) are needed.
If it is necessary to specify a specific account linked to the user's certificate on the Linux Cluster, the right command to copy a file is globus-url-copy -vb gsiftp://email@example.com/~/cluster.file ./