Bug 194409 - [new port] sysutils/glusterfs: GlusterFS distributed file system
Summary: [new port] sysutils/glusterfs: GlusterFS distributed file system
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Hiroki Sato
URL:
Keywords:
Depends on: 201066
Blocks:
  Show dependency treegraph
 
Reported: 2014-10-16 19:01 UTC by craig001
Modified: 2016-02-24 19:48 UTC (History)
19 users (show)

See Also:


Attachments
glusterfs port shar (12.20 KB, text/plain)
2014-10-16 19:01 UTC, craig001
no flags Details
updated glusterfs shar (12.00 KB, text/plain)
2014-11-09 23:27 UTC, craig001
no flags Details
Commit candidate of GlusterFS port (3.20 KB, application/x-gzip)
2014-11-24 21:02 UTC, Hiroki Sato
no flags Details
unified diff to bring port candidate upto glusterfs 3.6.2 (5.56 KB, patch)
2015-02-16 22:08 UTC, craig001
no flags Details | Diff
unified diff to bring port candidate upto gluster 3.6.2 with georeplication disabled (4.05 KB, patch)
2015-02-24 00:01 UTC, craig001
no flags Details | Diff
unified diff to bring port candidate upto gluster 3.7.2 with georeplication disabled (9.29 KB, patch)
2015-06-23 00:37 UTC, craig001
no flags Details | Diff
unified diff to bring port candidate upto gluster 3.7.6 with georeplication disabled and fuse mount patched (15.93 KB, patch)
2015-11-26 01:14 UTC, craig001
no flags Details | Diff
glusterfs 3.7.6 port tarball (3.85 KB, application/x-compressed-tar)
2015-11-26 01:17 UTC, craig001
no flags Details
patch make the port 'poudriere testport' clean (9.41 KB, patch)
2015-12-03 08:59 UTC, KIKUCHI Koichiro
no flags Details | Diff
patch make the port 'poudriere testport' clan and freebsd 9 build support (9.58 KB, patch)
2015-12-03 13:13 UTC, KIKUCHI Koichiro
no flags Details | Diff
unified diff to bring port candidate upto gluster 3.7.6 with georeplication disabled and fuse mount patched (10.61 KB, patch)
2015-12-04 00:41 UTC, craig001
no flags Details | Diff
glusterfs 3.7.6 port tarball (3.98 KB, application/gzip)
2015-12-04 00:43 UTC, craig001
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description craig001 2014-10-16 19:01:24 UTC
Created attachment 148379 [details]
glusterfs port shar

port for GlusterFS  (gluster.org)

GlusterFS is a unified, poly-protocol, scale-out filesystem serving many PBs of data.

I originally lifted this from the FreeNAS team and updated to the latest upstream release.

I am also looking to maintain the FreeNAS port as well to stop double touching the same codebase.

Credit and hats off to Baptiste Daroussin <bapt@freebsd.org> and the FreeNAS team for the original work.

I have emailed Baptiste regarding maintainership, happy for me to go ahead.

Regards

Craig Butler
Comment 1 Hiroki Sato freebsd_committer freebsd_triage 2014-10-16 20:44:31 UTC
I will handle this.
Comment 2 craig001 2014-11-09 23:27:59 UTC
Created attachment 149233 [details]
updated glusterfs shar

bump PR, and sync with latest improvements from github as suggested by Harshavardhana <harsha@harshavardhana.net> with thanks.
Comment 3 Hiroki Sato freebsd_committer freebsd_triage 2014-11-24 21:02:26 UTC
Created attachment 149791 [details]
Commit candidate of GlusterFS port

Hi,

 I reviewed the patch and fixed several issues of them.  Can you try the
 attached one?  Changes include: 

  - Fix package name.  beta3 is not allowed in the version string.
  - Add more dependency.  GlusterFS depends on glib-2.0, gettext, and readline.
  - Use libargp from ports as dependency.
  - Use USES=python instead of USE_PYTHON.
  - Fix Python.h detection.
  - Add etc/rc.d/glusterd startup script.

 Just putting the line

  glusterd_enable="YES"

 into /etc/rc.conf will enable a GlusterFS server.

 I tried some simple configurations and they worked fine so far.  I am
 double-checking the functionality by using more complex ones now.
 A bug I noticed at this moment was that NFS export did not unregister
 RPC entries of mountd, nfs, and nfs_acl upon shutdown. 

 One question: I removed autotools because the stock configure scripts
 worked without a problem.  Is there any speicific reason to rebuild them?
Comment 4 craig001 2014-12-13 05:38:32 UTC
http://bsdtec.com/freebsd/poudriere/logs/bulk/latest-per-pkg/glusterfs/3.6.1/

Summary;
10.1-RELEASE amd64   -- pass
10.1-RELEASE x86     -- fail
10.1-RELEASE sparc64 -- fail
9.3-RELEASE amd64    -- fail
9.3-RELEASE x86      -- fail
Comment 5 craig001 2015-02-16 22:08:02 UTC
Created attachment 153091 [details]
unified diff to bring port candidate upto glusterfs 3.6.2

updated Makefile, pkg-plist and distinfo to reflect newer glusterfs release..
modified patch-configure as some changes have made it upstream
Comment 6 craig001 2015-02-16 22:24:03 UTC
http://bsdtec.com/freebsd/poudriere/logs/bulk/latest-per-pkg/glusterfs/3.6.2/

Summary;
10.1-RELEASE amd64   -- pass

testing continues...
Comment 7 Marin Bernard 2015-02-21 21:18:49 UTC
GlusterFS 3.6.2 port candidate builds fine on FreeBSD 10.1-RELEASE amd64.

However the GlusterFS daemon (glusterd) and management tool (gluster) crash at startup because parts of the Python code rely on the ENODATA syscall error return code (errno), which FreeBSD does not implement. References to ENODATA should be replaced by ENOMSG.

Detailed debug log of glusterd startup is available on the FreeBSD forums:
https://forums.freebsd.org/threads/freebsd-support-being-added-to-glusterfs.46923/page-2#post-282793
Comment 8 craig001 2015-02-22 14:41:10 UTC
Something broke between beta3 and 3.6.2 (and 3.6.1)...
after contacting Harsha and Justin I was advised to open up a bug report on their redhat bugzilla;
https://bugzilla.redhat.com/show_bug.cgi?id=1195053
Comment 9 craig001 2015-02-24 00:01:56 UTC
Created attachment 153404 [details]
unified diff to bring port candidate upto gluster 3.6.2 with georeplication disabled

disable georeplication until portability issues have been fixed upstream.
Comment 10 Nils Beyer 2015-03-26 09:33:39 UTC
It seems that an user has no privileges to access the glusterfs mount point:

---------------------------------------------------------------------------------
root@aldi-nas:/root/#ls -la /dev/fuse
crw-rw-rw-  1 root  operator  0x7d Mar 26 10:26 /dev/fuse


root@aldi-nas:/root/#su -m nobody -c 'ls -la /mnt/gv0'
total 2
drwxr-xr-x   2 root  wheel   2 Mar 25 09:17 .
drwxr-xr-x  11 root  wheel  12 Mar 25 09:17 ..


root@aldi-nas:/root/#mount_glusterfs 10.0.0.134:/gv0 /mnt/gv0
mountpoint: /mnt/gv0
fsname: 10.0.0.134:/gv0
mnt_param: default_permissions,allow_other,max_read=131072


root@aldi-nas:/root/#su -m nobody -c 'ls -la /mnt/gv0'
total 0
ls: /mnt/gv0: Operation not permitted


root@aldi-nas:/mnt/#ls -la /mnt/gv0
total 5
drwxrwxrwx   5 root    wheel   5 Oct 21 08:00 .
drwxr-xr-x  11 root    wheel  12 Mar 25 09:17 ..
drwxrwxrwx   3 nobody  wheel  40 Mar 17 14:14 4all
drwxr-xr-x  12 root    wheel  12 Mar 11 14:42 homes
---------------------------------------------------------------------------------

Any ideas how to fix that? '/mnt/gv0' will be a storage area for SAMBA, and the share "4all" is being guest accessed as the UNIX user "nobody"...
Comment 11 craig001 2015-04-06 09:05:00 UTC
Hello Nils

I am working on the permissions issue now.  I can confirm that I am experiencing the same.  
I am currently rolling back to beta3 to see if it is a code change that has caused it.

Report back soon

Regards

Craig Butler
Comment 12 craig001 2015-04-06 10:00:14 UTC
strange... 
I can get freebsd bricks and centos client to work.
but freebsd bricks and freebsd client fails.
Comment 13 craig001 2015-06-22 23:17:59 UTC
working on getting 3.7.2 diff.... some new lib depends, and needs to be built with GCC for now.
Comment 14 craig001 2015-06-23 00:37:58 UTC
Created attachment 158002 [details]
unified diff to bring port candidate upto gluster 3.7.2 with georeplication disabled
Comment 15 craig001 2015-06-23 02:24:57 UTC
unfortunately 3.7.2 is still not letting users access the mount.

I'll open another PR for this and hopefully get some more eye's on the case.
Comment 16 andrew 2015-11-24 21:55:47 UTC
(In reply to craig001 from comment #15)

Strictly speaking, it is not a problem of GlusterFS itself, but different behaviour of FreeBSD and Linux implementation of FUSE: by default, Linux adds 'allow_other' mount option to FUSE mounts while FreeBSD does not.
So, it is rather simple to spin things around: just add missing mount option. :)

diff --git a/contrib/fuse-lib/mount.c b/contrib/fuse-lib/mount.c
index 1edde86..521a571 100644
--- a/contrib/fuse-lib/mount.c
+++ b/contrib/fuse-lib/mount.c
@@ -256,6 +256,7 @@ fuse_mount_sys (const char *mountpoint, char *fsname,
         build_iovec (&iov, &iovlen, "from", "/dev/fuse", -1);
         build_iovec (&iov, &iovlen, "volname", source, -1);
         build_iovec (&iov, &iovlen, "fd", fdstr, -1);
+        build_iovec (&iov, &iovlen, "allow_other", NULL, -1);
         ret = nmount (iov, iovlen, mountflags);
 #else
         ret = mount (source, mountpoint, fstype, mountflags,

That's all, I run GlusterFS on FreeBSD for a quite time.
Comment 17 craig001 2015-11-26 00:09:15 UTC
thank you Andrew !!
I'll bump the revision upto 3.7.6 (the latest) and push your patch in.
Comment 18 craig001 2015-11-26 01:14:23 UTC
Created attachment 163544 [details]
unified diff to bring port candidate upto gluster 3.7.6 with georeplication disabled and fuse mount patched

bump upto glusterfs 3.6.7, add patch as submitted by andrew@rinet.ru
Comment 19 craig001 2015-11-26 01:17:19 UTC
Created attachment 163545 [details]
glusterfs 3.7.6 port tarball
Comment 20 craig001 2015-11-26 01:19:06 UTC
will run this through with poudriere shortly when I have upgraded the platform to 10.2-RELEASE
Comment 21 Nick Evans 2015-12-02 21:25:10 UTC
Port build fails on new 10.2-RELEASE:

checking for GLIB... yes
checking for ibv_get_device_list in -libverbs... no
checking for rdma_create_id in -lrdmacm... no
checking for ZLIB... yes
features requiring zlib enabled: yes
checking for SQLITE... no
configure: error: pass --disable-tiering to build without sqlite
===>  Script "configure" failed unexpectedly.
Please report the problem to craig001@lerwick.hopto.org [maintainer] and
attach the "/usr/ports/net/glusterfs/work/glusterfs-3.7.6/config.log" including
the output of the failure of your make command. Also, it might be a good idea
to provide an overview of all packages installed on your system (e.g. a
/usr/local/sbin/pkg-static info -g -Ea).
*** Error code 1

Stop.
make: stopped in /usr/ports/net/glusterfs


If I install sqlite3 manually the glusterfs build works.
Comment 22 KIKUCHI Koichiro 2015-12-03 08:59:10 UTC
Created attachment 163805 [details]
patch make the port 'poudriere testport' clean

Attached port (glusterfs.tgz) does't pass 'poudriere testport'.

I fixed this this issue. changes made are:

- Added 'sysutils' to CATEGORIES
  I don't know which is correct, sysutils/glusterfs or net/glusterfs
- Use shebangfix for some scripts
- Added USE_SQLITE=yes
- Fixed version number in PLIST_SUB and remove @commnet from pkg-plist
Comment 23 KIKUCHI Koichiro 2015-12-03 13:13:08 UTC
Created attachment 163811 [details]
patch make the port 'poudriere testport' clan and freebsd 9 build support

patch updated. add support for freebsd 9.

patched port is tested on 10.2-RELEASE amd64 and 9.3-RELEASE amd64.
Comment 24 Nick Evans 2015-12-03 17:27:14 UTC
Excellent. Builds now on 10.2-RELENG and glusterfsd starts on its own with the default install. The original 3.7.6 patch did not.
Comment 25 craig001 2015-12-03 23:56:59 UTC
thanks for the effort folks... I'll check KIKUCHI's diff now.

I think it was decided by Kiroki that the port was to fall into net/ and not as originally sysutils/. I think that may be the only thing I end up changing.
Comment 26 craig001 2015-12-04 00:41:23 UTC
Created attachment 163830 [details]
unified diff to bring port candidate upto gluster 3.7.6 with georeplication disabled and fuse mount patched

applied KIKUCHI Koichiro diff
Comment 27 craig001 2015-12-04 00:43:37 UTC
Created attachment 163831 [details]
glusterfs 3.7.6 port tarball

applied KIKUCHI Koichiro diff
Comment 28 craig001 2015-12-04 03:04:25 UTC
created phabricator differential review;
https://reviews.freebsd.org/D4367

(hopefully correctly and assigned to the right folk, sorry if it's not...)
Comment 29 KIKUCHI Koichiro 2015-12-04 06:18:45 UTC
Thx merging my patch.

then I have one question. I use binaries built with clang on my FreeBSD 10 machines
and they seem to work fine. So I think we can remove USE_GCC=any line from
Makefile. Is there any specific reason to use gcc?
Comment 30 craig001 2015-12-04 08:40:07 UTC
Hello KIKUCHI

I suspect it's legacy issue that may now have been resolved.  I'll keep it GCC for now and get it into the ports tree then sort it out.

I am currently running it through a local poudriere here atm with GCC enabled.  Will try with clang after.

My biggest worry about clang is that it has not yet supported all archs that I am hoping to get gluster running on.
Comment 31 craig001 2015-12-04 09:49:29 UTC
http://bsdtec.com/freebsd/poudriere/logs/bulk/latest-per-pkg/glusterfs/3.7.6/

Summary;
10.2-RELEASE amd64   -- pass

testing continues...
Comment 32 craig001 2015-12-04 11:10:31 UTC
http://bsdtec.com/freebsd/poudriere/logs/bulk/latest-per-pkg/glusterfs/3.7.6/

Summary;
10.2-RELEASE amd64   -- pass
9.3-RELEASE amd64    -- pass
Comment 33 Nick Evans 2015-12-04 18:45:53 UTC
Can confirm that on 10.2-RELENG AMD64 in addition to building and glusterfsd running, we can mount shares via fusefs from a remote 10.2-RELENG AMD64 client.
Comment 34 rainer 2015-12-09 23:03:31 UTC
Is there a reason why this isn't in FreeBSD ports, yet?
There's lot's of "experimental"-type ports marked as such in the tree that might or might not deserve actually being in ports.

If it was in the tree, I (and probably others) could just build it as part of my regular (quarterly) build and play with it.
Comment 35 Rick Macklem freebsd_committer freebsd_triage 2015-12-10 00:35:42 UTC
I just tried the glusterfs 3.7.6 port tarball (2015-12-04) and it all
seemed to work. (I used an end of November FreeBSD11 on an amd64.)

The only issue I ran into is that glusterd wouldn't start because there
was no /usr/local/etc/glusterfs/glusterd.vol file.

I did this trivial patch to the glusterd script for /etc/rc.d, which
is one simple way to fix it:
--- glusterd.sav	2015-12-09 16:09:50.226225000 -0500
+++ glusterd	2015-12-09 16:14:20.116241000 -0500
@@ -16,6 +16,11 @@ glusterd_prestart()
 {
 
 	mkdir -p /var/db/glusterd /var/log/glusterfs
+	if ! [ -f /usr/local/etc/glusterfs/glusterd.vol ]; then
+		cp -n /usr/local/etc/glusterfs/glusterd.vol.sample \
+		    /usr/local/etc/glusterfs/glusterd.vol
+		echo "Copying sample /usr/local/etc/glusterfs/glusterd.vol"
+	fi
 }
 
 load_rc_config $name

Thanks everyone for working on this, rick.
Comment 36 Nick Evans 2016-02-02 22:09:14 UTC
Is there a holdup on getting this committed? This has been functional for almost 2 months now.
Comment 37 craig001 2016-02-08 19:32:48 UTC
Hiroki -- is there anything else we need to do to get this committed ??
Comment 38 Rick Macklem freebsd_committer freebsd_triage 2016-02-08 22:57:28 UTC
Just fyi, if you are going to use the fuse interface, you probably
want the 2 patches found in PR#206238.
And, yes, I do feel this can go in ports now and would appreciate
that happening.

Thanks everyone for your work on this, rick
Comment 39 Mark Felder freebsd_committer freebsd_triage 2016-02-24 15:48:16 UTC
This has been sitting idle for 3 weeks. Any objections to committing it to ports?
Comment 40 craig001 2016-02-24 16:17:54 UTC
hay Mark...

Is there such thing as committer time out ??

Hiroki had claimed it, but has been radio silent via bugzilla and offlist emails.

Is there someone else with a commit bit that can get it in for us ?
Comment 41 Hiroki Sato freebsd_committer freebsd_triage 2016-02-24 18:52:10 UTC
(In reply to craig001 from comment #40)

I am very sorry for not handling this in an appropriate manner.  I will commit it as soon as possible this time around...
Comment 42 commit-hook freebsd_committer freebsd_triage 2016-02-24 19:45:23 UTC
A commit references this bug:

Author: hrs
Date: Wed Feb 24 19:44:46 UTC 2016
New revision: 409479
URL: https://svnweb.freebsd.org/changeset/ports/409479

Log:
  Add net/glusterfs, an open source, distributed file system capable of
  scaling to several petabytes and handling thousands of clients.

  Submitted by:	Craig Butler (maintainer)
  PR:		194409

Changes:
  head/net/Makefile
  head/net/glusterfs/
  head/net/glusterfs/Makefile
  head/net/glusterfs/distinfo
  head/net/glusterfs/files/
  head/net/glusterfs/files/glusterd.in
  head/net/glusterfs/files/patch-configure
  head/net/glusterfs/files/patch-contrib-fuse-lib-mount.c
  head/net/glusterfs/files/patch-extras-Makefile.in
  head/net/glusterfs/pkg-descr
  head/net/glusterfs/pkg-plist
Comment 43 Hiroki Sato freebsd_committer freebsd_triage 2016-02-24 19:48:08 UTC
Committed.  Thank you all for your contributions, and I am sorry for the looong delay.  Please reopen this or open another PR if there is a problem.