13 Commits

Author SHA1 Message Date
Aravinda VK
5a1abd235d eventsapi: Add Init scripts for different distributions
Added init scripts for
- SysvInit(CentOS 6 or Red Hat 6)
- rc.d (FreeBSD)

Most of the latest distributions are using systemd. Support to be
added for other distributions which are not using systemd.

Removed systemctl wrapper functions(start/stop/status) from
gluster-eventsapi CLI(peer_eventsapi.py). Status and Reload
re-implemented using pid file check.

Added pid file support for glustereventsd.

Following dependencies removed
python-flask - Only used for example dashboard. User can install
if required.
python-fasteners - Not available for EPEL 6, added custom code using
fcntl as replacement.

BUG: 1365395
Change-Id: I26792eae9b11e93304f70b3997cd7d8d03b067f4
Signed-off-by: Aravinda VK <avishwan@redhat.com>
Reviewed-on: http://review.gluster.org/15367
Smoke: Gluster Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
2016-09-09 03:29:33 -07:00
Aravinda VK
f463c4615b packaging/eventsapi: Make Python site-packages variable global
Python site-packages path is assigned when glupy is enabled.
Eventsapi will not work as expected if glupy is disabled using
./configure --disable-glupy.

With this patch, all the Python variables are moved out of glupy
and used inside it.

systemd services will fail if we import gluster.cliutils python library
which is installed in /usr/local/lib/python.2.7/site-packages or some
other location. With this patch, Environment variable is added in
systemd service file.

BUG: 1369721
Change-Id: I9416240f03889e3bbcb4cd375e27c784fa9ca277
Signed-off-by: Aravinda VK <avishwan@redhat.com>
Reviewed-on: http://review.gluster.org/15305
Smoke: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Tested-by: Atin Mukherjee <amukherj@redhat.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
2016-08-29 00:28:30 -07:00
Niels de Vos
9f22282795 build: systemd unit should not be marked executable
systemd complains about the unit for GlusterD when it is executable:

  Configuration file /usr/lib/systemd/system/glusterd.service is marked executable. Please remove executable permission bits. Proceeding anyway.

The Makefile that installs the unit has some scripted commands. These
are not needed and standard "*dir" and "*DATA" postfixes for variables
can be used instead.

The EXTRA_DIST variable is needed for building the 'make dist' tarball
on systems where there is no systemd. The unit would be missing from the
tarball if it is not explicitly included.

BUG: 1354489
Change-Id: I5e72ec201036906b9b2458bc8931ccebf9a8c6b4
Reported-by: Sergej Pupykin <ml@sergej.pp.ru>
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/14892
Smoke: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
2016-08-07 18:05:05 -07:00
Aravinda VK
5ed781ecf5 eventsapi: Gluster Eventing Feature implementation
[Depends on http://review.gluster.org/14627]

Design is available in `glusterfs-specs`, A change from the design
is support of webhook instead of Websockets as discussed in the design

http://review.gluster.org/13115

Since Websocket support depends on REST APIs, I will add Websocket support
once REST APIs patch gets merged

Usage:
Run following command to start/stop Eventsapi server in all Peers,
which will collect the notifications from any Gluster daemon and emits
to configured client.

    gluster-eventsapi start|stop|restart|reload

Status of running services can be checked using,

    gluster-eventsapi status

Events listener is a HTTP(S) server which listens to events emited by
the Gluster. Create a HTTP Server to listen on POST and register that
URL using,

    gluster-eventsapi webhook-add <URL> [--bearer-token <TOKEN>]

For example, if HTTP Server running in `http://192.168.122.188:9000`
then add that URL using,

    gluster-eventsapi webhook-add http://192.168.122.188:9000

If it expects a Token then specify it using `--bearer-token` or `-t`

We can also test Webhook if all peer nodes can send message or not
using,

    gluster-eventsapi webhook-test <URL> [--bearer-token <TOKEN>]

Configurations can be viewed/updated using,

    gluster-eventsapi config-get [--name]
    gluster-eventsapi config-set <NAME> <VALUE>
    gluster-eventsapi config-reset <NAME|all>

If any one peer node was down during config-set/reset or webhook
modifications, Run sync command from good node when a peer node comes
back. Automatic update is not yet implemented.

    gluster-eventsapi sync

Basic Events Client(HTTP Server) is included with the code, Start
running the client with required port and start listening to the
events.

    /usr/share/glusterfs/scripts/eventsdash.py --port 8080

Default port is 9000, if no port is specified, once it started running
then configure gluster-eventsapi to send events to that client.

Eventsapi Client can be outside of the Cluster, it can be run event on
Windows. But only requirement is the client URL should be accessible
by all peer nodes.(Or ngrok(https://ngrok.com) like tools can be used)

Events implemented with this patch,
- Volume Create
- Volume Start
- Volume Stop
- Volume Delete
- Peer Attach
- Peer Detach

It is easy to add/support more events, since it touches Gluster cmd
code and to avoid merge conflicts I will add support for more events
once this patch merges.

BUG: 1334044
Change-Id: I316827ac9dd1443454df7deffe4f54835f7f6a08
Signed-off-by: Aravinda VK <avishwan@redhat.com>
Reviewed-on: http://review.gluster.org/14248
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
2016-07-18 13:52:20 -07:00
Kaushal M
23440a73bc glusterd.service: Ensure rpcbind is started before glusterd
Having the rpcbind.service under the `After` option only ensures that
glusterd.service is started after rpcbind.service if both are
enabled/started at the same time. It doesn't ensure that starting
glusterd.service will start rpcbind.service.

The systemd.unit(5) man page suggests to use both the `Requires` and
`After` options to ensure that rpcbind is started before glusterd,
whenever glusterd is started.

BUG: 1282915
Change-Id: Iee69965486be08711299aba235f7b00c3e2fe7e9
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.org/12605
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-by: Anand Nekkunti <anekkunt@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
2015-11-18 02:21:05 -08:00
Niels de Vos
4ac2ff18db build: MKDIR_P is not defined for Makefiles, use mkdir_p instead
Change-Id: Id6d5263eb7b1c53e72a7668e716e9cc4e34b82cd
Reported-by: Milind Changire <mchangir@redhat.com>
BUG: 1198849
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/12553
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Milind Changire <mchangir@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2015-11-10 00:57:44 -08:00
anand
63e3806ba3 systemd/spec/glusterd: Adding EnvironmentFile in glusterd systemctrl service file.
Issue: glusterd was not running in debug mode, this is because of
"systemctrl start glusterd" was not reading configuration from glusterd-sysconfig file.

Fix: Set glusterd-sysconfig file as "EnvironmentFile"  and pass args to glusterd.

Change-Id: I6a032a2e86e5a25c39199ddf953bfbd6590d53b6
BUG: 1263087
Signed-off-by: anand <anekkunt@redhat.com>
Reviewed-on: http://review.gluster.org/12175
Reviewed-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2015-09-15 06:08:38 -07:00
Emmanuel Dreyfus
1fbcecb72e Fix case mistake for MKDIR_P in Makefiles
Some makefiles used $(mkdir_p) instead of the corectly defined $(MKDIR_P).
The former is substituted as an empty string, leading to possible failures
depending of the user shell tolerance. NetBSD's /bin/sh seems to choke
more easily than Linux's /bin/bash, but if the later does not fail, it
does not created the intended directories anyway.

BUG: 1129939
Change-Id: I8caed4000f3c91cb3a685453848fb854793945ed
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/10276
Tested-by: NetBSD Build System
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
2015-04-20 04:29:26 -07:00
Harshavardhana
2ec6ea43f2 build: make GLUSTERD_WORKDIR rely on localstatedir
- Break-way from '/var/lib/glusterd' hard-coded previously,
  instead rely on 'configure' value from 'localstatedir'
- Provide 's/lib/db' as default working directory for gluster
  management daemon for BSD and Darwin based installations
- loff_t is really off_t on Darwin
- fix-off the warnings generated by clang on FreeBSD/Darwin
- Now 'tests/*' use GLUSTERD_WORKDIR a common variable for all
  platforms.
- Define proper environment for running tests, define correct PATH
  and LD_LIBRARY_PATH when running tests, so that the desired version
  of glusterfs is used, regardless where it is installed.
  (Thanks to manu@netbsd.org for this additional work)

Change-Id: I2339a0d9275de5939ccad3e52b535598064a35e7
BUG: 1111774
Signed-off-by: Harshavardhana <harsha@harshavardhana.net>
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/8246
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2014-08-07 01:17:29 -07:00
Kaleb S. KEITHLEY
2e4064fe08 glusterd.service (systemd), ensure glusterd starts before local mounts
NOTICE: this patch was accepted onto the release-3.4 branch for 3.4.1,
but this same patch for master is languishing here in review.

Try (emphasis on the try) to ensure that glusterd starts, and in turn
starts glusterfsd before init attempt to mount any gluster (or gluster
NFS) volumes in /etc/fstab.

N.B. Joe Julian says this doesn't fix the problem for him, although it
worked for me in kvm. Lennart Poettering says it should, and we should
file a BZ against systemd if it doesn't. See
https://lists.fedoraproject.org/pipermail/devel/2013-July/185870.html

Change-Id: I4d8061217d8301beb0da485dc63a1984a7c57c37
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
BUG: 1004795
Reviewed-on: http://review.gluster.org/5823
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2013-09-20 11:50:15 -07:00
Justin Clift
90ec091755 Fix typo in systemd service definition file
Change-Id: Ia9dac04ad508fbaafbed24b2137b09872a1ca53c
BUG: 1010352
Signed-off-by: Justin Clift <jclift@redhat.com>
Reviewed-on: http://review.gluster.org/5981
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Tested-by: Anand Avati <avati@redhat.com>
2013-09-20 11:03:22 -07:00
Kaleb S. KEITHLEY
e216e2e6fc build: sync glusterfs.spec.in with Fedora glusterfs.spec
* fix the hardening fix for shlibs
* use %{__sed} macro
* better short ChangeLog
* fix hard-coded path in extras/systemd/glusterd.service in, use @prefix@

Change-Id: I267244b68a97cbcd6f6ab62fc322c78db45023bb
BUG: 950083
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.org/5264
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
2013-06-28 09:23:17 -07:00
Kaleb S. KEITHLEY
f7b1245ca2 build: sync glusterfs.spec.in with Fedora glusterfs.spec
* add glusterfs-api and glusterfs-api-devel sub-packages
 * add extras/systemd/glusterd.service. Use it (or extras/init.d/glusterd)
   instead of the Fedora versions.
 * restores ability to build glusterfs RPMs from the dist tarball with
   'rpmbuild {-ts,-tb,-ta} glusterfs-XXX.tar.gz'
 * other minor cleanups mostly to sync with fedora .spec and to build
   from the dist tarball. Any differences will be resolved in the fedora
   .spec in the next release (i.e. beta4 or GA).

(still considering whether to add fedora glusterfsd.{init,service} files
to glusterfs or remove them from fedora.)

BUG: 950083
Change-Id: Ibda3cd57b24ef5c2a27446703e718e5044ec546c
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.org/5230
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Bala FA <barumuga@redhat.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
2013-06-26 04:36:47 -07:00