UNSOLVED

bubstep816

updated

13 years ago

B

bubstep816

12 Posts

0

2947

April 22nd, 2014 09:00

Linux System Accessing Isilon SMB

We are in the process of migrating archive data from DiskXtender/Centera to Isilon.   We have an application that accesses this data via jcifs.  This is now not working with the Isilon.

Here is the error from the application:

SmbService | Fetching by using jcifs: [\\isilon\sharepath]

RemoteMethodCallHandler | START: remote method call

RemoteMethodCallHandler | Reading request

DiagnosticInputStream | Closing: 554 total bytes read

X00114 | UtilitiesException |

com.xxxxxxxx.eig.common.util.UtilitiesException: An error occured sending the request.

jcifs.smb.SmbException: An error occured sending the request.

java.net.ConnectException: Connection refused

        at java.net.PlainSocketImpl.socketConnect(Native Method)

        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)

        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)

        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)

Any thoughts???

Thanks!

  • Yan_Faubert

    117 Posts

    1384

    0

    Posted April 25th, 2014 06:00

    Just to add for completeness how I compile and run this program:

    root@yfvm-deb1:~/jcifs/jcifs-krb5-1.3.17# cat setcp

    export CLASSPATH=~/jcifs/jcifs-krb5-1.3.17/jcifs-krb5-1.3.17.jar:.

    root@yfvm-deb1:~/jcifs/jcifs-krb5-1.3.17# . setcp

    root@yfvm-deb1:~/jcifs/jcifs-krb5-1.3.17#

    root@yfvm-deb1:~/jcifs/jcifs-krb5-1.3.17# javac NetworkShareFileCopy.java

    root@yfvm-deb1:~/jcifs/jcifs-krb5-1.3.17# java NetworkShareFileCopy

    User: faubert:xxxxxxx

    Path: smb://static.vm7027.yfisi.local/ifs_data_oplock/testFile.txt

    Successful: true

    And I did validate the file actually got created on the cluster!

    yfvm-7027-2# pwd

    /ifs/data/oplock

    yfvm-7027-2# ls -latr testFile.txt

    -rwx------ +  1 faubert  YFISI\clusteruse  29 Apr 25 09:34 testFile.txt

    yfvm-7027-2#

  • bubstep816

    12 Posts

    1384

    0

    Posted April 25th, 2014 06:00

    I will test these out and let you know.

  • peglarr

    2 Intern

    •

    99 Posts

    1384

    0

    Posted April 25th, 2014 06:00

    Thanks Yan - nicely done.

    Interesting comparison on the # of lines of code needed for this technique versus doing a RESTful PUT of a given file.

  • Yan_Faubert

    117 Posts

    1384

    0

    Posted April 25th, 2014 06:00

    I did a test with basic jcifs program and was able to create a file over SMB to a cluster that is joined to AD.

    My environment:

    OneFS (7.0.2.7):

    Isilon OneFS yfvm-7027-2 v7.0.2.7 Isilon OneFS v7.0.2.7 B_7_0_2_263(RELEASE): 0x700025000700107:Thu Feb 27 12:40:26 PST 2014    root@fastbuild-05.west.isilon.com:/build/mnt/obj.RELEASE/build/mnt/src/sys/IQ.amd64.release amd64

    Linux:

    Debian Wheezy

    Linux yfvm-deb1 3.2.0-4-amd64 #1 SMP Debian 3.2.41-2 x86_64 GNU/Linux

    Java:

    java version "1.7.0_55"

    Java(TM) SE Runtime Environment (build 1.7.0_55-b13)

    Java HotSpot(TM) 64-Bit Server VM (build 24.55-b03, mixed mode)

    Sample code I used with jcifs-krb5-1.3.17.jar:

    root@yfvm-deb1:~/jcifs/jcifs-krb5-1.3.17# cat NetworkShareFileCopy.java

    import jcifs.smb.NtlmPasswordAuthentication;

    import jcifs.smb.SmbFile;

    import jcifs.smb.SmbFileOutputStream;

    public class NetworkShareFileCopy {

        static final String DOMAIN = "YFISI";

        static final String USER_NAME = "my_domain_id";

        static final String PASSWORD = "my_domain_pass";

        //e.g. Assuming your network folder is: \\my.myserver.net\ifs_data_oplock\

        static final String NETWORK_FOLDER = "smb://static.vm7027.yfisi.local/ifs_data_oplock/";

        public static void main(String args[]) {

            String fileContent = "This is a test file some data";

            new NetworkShareFileCopy().copyFiles(fileContent, "testFile.txt");

        }

        public boolean copyFiles(String fileContent, String fileName) {

            boolean successful = false;

            try{

                    String user = USER_NAME + ":" + PASSWORD;

                    System.out.println("User: " + user);

                    NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(DOMAIN, USER_NAME, PASSWORD);

                    String path = NETWORK_FOLDER + fileName;

                    System.out.println("Path: " +path);

                    SmbFile sFile = new SmbFile(path, auth);

                    SmbFileOutputStream sfos = new SmbFileOutputStream(sFile);

                    sfos.write(fileContent.getBytes());

                    successful = true;

                    System.out.println("Successful: " + successful);

                } catch (Exception e) {

                    successful = false;

                    e.printStackTrace();

                }

            return successful;

        }

    }

  • Yan_Faubert

    117 Posts

    1384

    0

    Posted April 25th, 2014 07:00

    This is my 'python' equivalent of what the previous sample is doing but using the RAN API.

    yfaubert@yfvm-deb1:~/ran$ cat create_file.py

    import requests

    ran_url = "https://yfvm-7027.yfisi.local:8080/namespace/ifs-data-ran"

    filename = file_to_send = "file_to_send.dd"

    authinfo = ('papiuser', 'papi_password')

    if __name__ == "__main__":

        fullpath = ran_url + "/" + file_to_send

        param = {"overwrite": True}

        headers = {'content-type': 'binary/octet-stream', 'x-isi-ifs-target-type': 'object', 'x-isi-ifs-access-control': '0644'}

        with open(filename) as file:

            create_reply = requests.put(fullpath, data=file, verify=False, headers=headers, params=param, auth=authinfo)

        print "Create reply: " + str(create_reply.text)