summaryrefslogtreecommitdiffstats
path: root/glusterfs.spec.in
diff options
context:
space:
mode:
authorAravinda VK <avishwan@redhat.com>2016-05-05 18:34:41 +0530
committerJeff Darcy <jdarcy@redhat.com>2016-07-18 13:52:20 -0700
commit5ed781ecf531b7916e51c174426e222dab717fb8 (patch)
tree62fdb63045d4bc9350713aeaa3a8639a316b24ed /glusterfs.spec.in
parent386340967926fa062e2c1eee4784f951846167b3 (diff)
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>
Diffstat (limited to 'glusterfs.spec.in')
-rw-r--r--glusterfs.spec.in43
1 files changed, 42 insertions, 1 deletions
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
index 6a29895a093..4f388f74ba3 100644
--- a/glusterfs.spec.in
+++ b/glusterfs.spec.in
@@ -90,6 +90,11 @@
%global _with_tmpfilesdir --without-tmpfilesdir
%endif
+# Eventing
+%if ( 0%{?rhel} && 0%{?rhel} < 6 )
+%global _without_events --disable-events
+%endif
+
# From https://fedoraproject.org/wiki/Packaging:Python#Macros
%if ( 0%{?rhel} && 0%{?rhel} <= 5 )
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
@@ -569,6 +574,23 @@ is in user space and easily manageable.
This package provides the translators needed on any GlusterFS client.
+%if ( 0%{!?_without_events:1} )
+%package events
+Summary: GlusterFS Events
+Group: Applications/File
+Requires: %{name}-server%{?_isa} = %{version}-%{release}
+Requires: python python-fasteners python-requests python-flask
+Requires: python-prettytable
+Requires: python-gluster = %{version}-%{release}
+%if ( 0%{?rhel} && 0%{?rhel} <= 6 )
+Requires: python-argparse
+%endif
+
+%description events
+GlusterFS Events
+
+%endif
+
%prep
%setup -q -n %{name}-%{version}%{?prereltag}
@@ -595,7 +617,8 @@ export CFLAGS
%{?_without_ocf} \
%{?_without_rdma} \
%{?_without_syslog} \
- %{?_without_tiering}
+ %{?_without_tiering} \
+ %{?_without_events}
# fix hardening and remove rpath in shlibs
%if ( 0%{?fedora} && 0%{?fedora} > 17 ) || ( 0%{?rhel} && 0%{?rhel} > 6 )
@@ -1195,7 +1218,25 @@ exit 0
%{_sbindir}/gf_logdump
%{_sbindir}/gf_recon
+# Events
+%if ( 0%{!?_without_events:1} )
+%files events
+%config %attr(0600, root, root) %{_sysconfdir}/glusterfs/eventsconfig.json
+%dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/events
+%{_libexecdir}/glusterfs/events
+%{_libexecdir}/glusterfs/peer_eventsapi.py*
+%{_sbindir}/glustereventsd
+%{_sbindir}/gluster-eventsapi
+%{_datadir}/glusterfs/scripts/eventsdash.py*
+%if ( 0%{?_with_systemd:1} )
+%{_unitdir}/glustereventsd.service
+%endif
+%endif
+
%changelog
+* Wed Jul 15 2016 Aravinda VK <avishwan@redhat.com>
+- Added new subpackage events(glusterfs-events) (#1334044)
+
* Fri Jul 15 2016 Aravinda VK <avishwan@redhat.com>
- Removed ".py" extension from symlink(S57glusterfind-delete-post)(#1356868)