Comments (6)
You need to have the libgfapi C library installed, usually from your distro's glusterfs packages.
from glusterfs-java-filesystem.
Thank you very much for you reply, so I think is mandatory a unix/linux environment, not windows right?
from glusterfs-java-filesystem.
If the libgfapi C library works on windows, then the libgfapi-jni library could be built to link with it. I don't know if libgfapi supports windows.
from glusterfs-java-filesystem.
Thank you very much! I installed libgfapi on linux machine and tried to create a new file (not existing), but seems it's not working. No error log on gluster machine.
gluster://10.192.2.6:myvolume/test2
Cannot create file!
java.nio.file.FileAlreadyExistsException: /test2
at com.peircean.glusterfs.GlusterFileChannel.init(GlusterFileChannel.java:78)
from glusterfs-java-filesystem.
I haven't worked on this project in a few years so I may not be much help here. I would check the following...
- Ensure the file does not already exist
- Check the permissions on the gluster volume & the glusterd service. Last time I worked on this, you had to do a couple of steps on gluster to allow "insecure" connections like from this java library, and also set the mode to 0777 on the gluster volume root directory. See this script for details of how to set up permissions for your volume to allow Java clients.
- Test with a native glusterfs FUSE client to ensure your volume is working properly.
Good luck.
from glusterfs-java-filesystem.
I am trying to apply the gluster library on k8s 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?
from glusterfs-java-filesystem.
Related Issues (9)
- glusterfs-java-filesystem-example exception throws
- How to fix the Exception "java.lang.UnsatisfiedLinkError "? HOT 3
- java.nio.file.FileSystemNotFoundException: Provider \"gluster\" not installed" HOT 7
- glusterfs-java-filesystem for output plugin in logstash HOT 2
- Having trouble in creating a file HOT 3
- Can't add to JBoss (EAP) as part of a web app (WAR) HOT 3
- cannot find GlusterfsFileSystemProvider HOT 1
- Springboot + GlusterFS : Unable to build DLL from 'glusterfs-java-filesystem/tree/combined-with-libgfapi' on windows 10 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from glusterfs-java-filesystem.