gluster / libgfapi-jni

Java Native Interface (JNI) bindings for libgfapi (the GlusterFS client API)
https://github.com/gluster/libgfapi-jni
Other
8 stars 12 forks source link

Can someone upload the latest target jar conatining a x86_64 so library #3

Open xiaoyu1985ban opened 9 years ago

xiaoyu1985ban commented 9 years ago

hi, semiosis can you give the latest target jar conatining a x86_64 so library ? I have tried a long time but just can not get the target jar. Thanks very much !

louiszuckerman commented 9 years ago

Do you have glusterfs installed? The build process will look in /usr/include/glusterfs or GLFS_HOME (env var) for the native library. On debian/ubuntu this is provided by the glusterfs-common package from the PPA (https://launchpad.net/~gluster). On redhat/fedora I think it's provided by the glusterfs-api/glusterfs-api-devel packages.

eskuai commented 4 years ago

Hi @louiszuckerman

I am trying to apply the gluster library from a running pod And i've upgrade dockerio/openjdk:8 with the following dockerfile:

FROM docker.io/openjdk:8 
RUN apt-get update
RUN apt-get install glusterfs-server -y

I think that installing glusterfs-server , commons are included ...

Into the pod we find :

root@67b0ae436f25:/usr/include/glusterfs# ls
api           cluster-syncop.h  defaults.h       gfchangelog        glusterfs.h    libglusterfs-messages.h  mem-types.h           rot-buffs.h  strfd.h                        trie.h
byte-order.h  common-utils.h    dict.h           gfdb               graph-utils.h  list.h                   options.h             rpc          syncop-utils.h                 tw.h
call-stub.h   compat-errno.h    event-history.h  gidcache.h         hashfn.h       lkowner.h                parse-utils.h         run.h        syncop.h                       upcall-utils.h
changelog.h   compat-uuid.h     event.h          glfs-message-id.h  iatt.h         locking.h                quota-common-utils.h  server       syscall.h                      xlator.h
checksum.h    compat.h          fd-lk.h          globals.h          inode.h        logging.h                rbthash.h             stack.h      template-component-messages.h  y.tab.h
circ-buff.h   daemon.h          fd.h             glusterfs-acl.h    iobuf.h        lvm-defaults.h           refcount.h            statedump.h  timer.h
client_t.h    default-args.h    gf-dirent.h      glusterfs-fops.h   latency.h      mem-pool.h               revision.h            store.h      timespec.h

And


root@67b0ae436f25:~# find / -name libgfapi* -print
find: ‘/proc/1/map_files’: Operation not permitted
find: ‘/proc/19/map_files’: Operation not permitted
/usr/lib/x86_64-linux-gnu/libgfapi.so
/usr/lib/x86_64-linux-gnu/libgfapi.so.0
/usr/lib/x86_64-linux-gnu/libgfapi.la
/usr/lib/x86_64-linux-gnu/libgfapi.so.0.0.0

Do we need to config GLFS_HOME , which dicrectory?? export GLFS_HOME=/usr/lib/x86_64-linux-gnu

Running glusterfs example into a pod, we got the following error:

Picked up JAVA_TOOL_OPTIONS: -Xmx1024m -Xms1024m -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -Duser.timezone=Europe/Madrid -XX:-TieredCompilation -XX:TieredStopAtLevel=1 -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -Xverify:none  -XX:+AggressiveOpts -XX:+UseG1GC -XX:+UseStringDeduplication
sun.nio.fs.LinuxFileSystemProvider@1d81eb93
com.sun.nio.zipfs.ZipFileSystemProvider@7291c18f
com.peircean.glusterfs.GlusterFileSystemProvider@34a245ab
gluster://10.0.1.213:gv0/
Exception in thread "main" java.lang.IllegalArgumentException: Failed to initialize glusterfs client: 10.0.1.213:gv0
    at com.peircean.glusterfs.GlusterFileSystemProvider.glfsInit(GlusterFileSystemProvider.java:87)
    at com.peircean.glusterfs.GlusterFileSystemProvider.newFileSystem(GlusterFileSystemProvider.java:47)
    at java.nio.file.FileSystems.newFileSystem(FileSystems.java:326)
    at java.nio.file.FileSystems.newFileSystem(FileSystems.java:276)
    at mk.task.adobe.analitycs.AdobeAnalyticsApplication.writeFile2Gluster(AdobeAnalyticsApplication.java:56)
    at mk.task.adobe.analitycs.AdobeAnalyticsApplication.main(AdobeAnalyticsApplication.java:32)

The code is:

 public static void main(String[] args) throws URISyntaxException, IOException, InterruptedException {
        Properties properties = new Properties();
        properties.load(Example.class.getClassLoader().getResourceAsStream("example.properties"));
        String vagrantBox ="10.0.1.213" ;// properties.getProperty("glusterfs.server");
        String volname ="gv0" ;//properties.getProperty("glusterfs.volume");
        System.out.println(getProvider("gluster").toString());
        String mountUri = "gluster://" + vagrantBox + ":" + volname + "/";
        String testUri = "gluster://" + vagrantBox + ":" + volname + "/baz";
        Path mountPath = Paths.get(new URI(mountUri));
        // Failed to run the following
        --> FileSystem fileSystem = FileSystems.newFileSystem(new URI(mountUri), null);<--
        FileStore store = fileSystem.getFileStores().iterator().next();

But, running from bash shell,

[ec2-user@k8s-master glusterfs-java-filesystem-example]$ mvn exec:exec
[INFO] Scanning for projects...
[INFO]
[INFO] ------< com.peircean.glusterfs:glusterfs-java-filesystem-example >------
[INFO] Building glusterfs-java-filesystem-example 1.0.5-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- exec-maven-plugin:1.2.1:exec (default-cli) @ glusterfs-java-filesystem-example ---
sun.nio.fs.LinuxFileSystemProvider@2503dbd3
com.sun.nio.zipfs.ZipFileSystemProvider@4b67cf4d
com.peircean.glusterfs.GlusterFileSystemProvider@7ea987ac
com.peircean.glusterfs.GlusterFileSystemProvider@7ea987ac
TOTAL SPACE: 934953332736
USABLE SPACE: 887356583936
UNALLOCATED SPACE: 934873358336
gluster://10.0.1.213:gv0
class com.peircean.glusterfs.GlusterPath
/baz
gluster://10.0.1.213:gv0
File exists, created at 2019-11-04T16:41:14Z
SIZE: 13
Hello, world! == Hello, world!
Last modified: 2019-11-04T17:04:27Z (should be now)
Can read & write file
Can't execute file, that's good.

can we install the gluster client into all k8s nodes?