41 Commits

Author SHA1 Message Date
Kotresh HR
4a339be28a geo-rep: Copy geo-rep hook-script during source install
The hook-script S56glusterd-geo-rep-create-post.sh was not
copying to glusterd working directory when geo-rep is
installed through source. Hence the geo-rep create fails
unless the script is manually copied. This patch addresses
the issue by copying the hook-script during make install.

Change-Id: I185a877ed720e8300f0e888ab481d0c8c23bf815
BUG: 1207201
Signed-off-by: Kotresh HR <khiremat@redhat.com>
Reviewed-on: http://review.gluster.org/10051
Reviewed-by: Aravinda VK <avishwan@redhat.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Tested-by: Vijay Bellur <vbellur@redhat.com>
2015-04-02 03:06:58 -07:00
Aravinda VK
7e98a0e0b1 feature/glusterfind: A tool to find incremental changes
Documentation is available in patch:
http://review.gluster.org/#/c/9800/

A tool which helps to get list of modified files or list of all files in
GlusterFS Volume using Changelog or find command.

Usage
=====
glusterfind --help

Create:
-------
glusterfind create --help

The tool creates status file $GLUSTERD_WORKDIR/SESSION/VOLUME/status
and records current timestamp to initiate the session. This timestamp
will be used as start time for next runs.

As part of create also generates ssh key and distributes to all peers.
and enables build.pgfid and changelog using volume set command.

Pre:
----
glusterfind pre --help

This command is used to generate the list of files modified after session
creation time or after last run. To get list of all files/dirs in Volume,
run pre command with `--full` argument.

The tool gets all nodes details using gluster volume info and runs node
agent for each brick in respective nodes via ssh command. Once these node
agents generate the output file, tool copies to local using scp. Merges all
the output files to generate the final output file.

Post:
-----
glusterfind post --help

After consuming the list, this sub command is called to update the session
time based on pre command status file.

List:
-----
glusterfind list --help

To view all the sessions

Delete:
-------
glusterfind delete --help

Delete session.

Known Issues
------------
1. Deleted files will not get listed, since we can't convert GFID to
   Path if file/dir is deleted.
2. Only new name will get listed if Renamed.
3. All hardlinks will get listed.

Change-Id: I82991feb0aea85cb6ec035fddbf80a2b276e86b0
BUG: 1193893
Signed-off-by: Aravinda VK <avishwan@redhat.com>
Reviewed-on: http://review.gluster.org/9682
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
Reviewed-by: Prashanth Pai <ppai@redhat.com>
Reviewed-by: Kotresh HR <khiremat@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2015-03-18 02:54:25 -07:00
Kotresh HR
f3ad194918 geo-rep: Handle copying of common_secret.pem.pub to slave correctly.
Current Behaviour:
    1. Geo-replication gsec_create creates common_secret.pem.pub file
       containing public keys of the all the nodes of master cluster
       in the location /var/lib/glusterd/
    2. Geo-replication create push-pem copies the common_secret.pem.pub
       to the same location on all the slave nodes with same name.

Problem:
    Wrong public keys might get copied on to slave nodes in multiple
    geo-replication sessions simultaneosly.

     E.g.
      A geo-rep session is established between Node1(vol1:Master) to
      Node2 (vol2:Slave). And one more geo-rep session where
      Node2 (vol3) becomes master to Node3 (vol4) as below.

      Session1: Node1 (vol1) ---> Node2 (vol2)
      Session2: Node2 (vol3) ---> Node3 (vol4)

      If steps followed to create both geo-replication session is as
      follows, wrong public keys are copied on to Node3 from Node2.

      1. gsec_create is done on Node1 (vol1) -Session1
      2. gsec_create is done on Node2 (vol3) -Session2
      3. create push-pem is done Node1 - Session1.
          -This overwrites common_secret.pem.pub in Node2
           created by gsec_create in second step.
      4. create push-pem on Node2 (vol3) copies overwrited
         common_secret.pem.pub keys to Node3. -Session2

Consequence:
      Session2 fails to start with Permission denied because of wrong
      public keys

Solution:
      On geo-rep create push-pem, don't copy common_secret.pem.pub
      file with same name on to all slave nodes. Prefix master and
      slave volume names to the filename.

NOTE: This brings change in manual steps to be followed to setup
      non-root geo-replication (mountbroker). To copy ssh public
      keys, extra two arguments needs to be followed.

      set_geo_rep_pem_keys.sh <mountbroker_user> <master vol name> \
      <slave vol name>
      
      Path to set_geo_rep_pem_keys.sh:
      Source Installation: 
              /usr/local/libexec/glusterfs/set_geo_rep_pem_keys.sh
      Rpm Installatino: 
              /usr/libexec/glusterfs/set_geo_rep_pem_keys.sh

Change-Id: If38cd4e6f58d674d5fe2d93da15803c73b660c33
BUG: 1183229
Signed-off-by: Kotresh HR <khiremat@redhat.com>
Reviewed-on: http://review.gluster.org/9460
Reviewed-by: Aravinda VK <avishwan@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
Tested-by: Venky Shankar <vshankar@redhat.com>
2015-01-21 22:58:41 -08:00
Raghavendra Talur
1800fba112 extras/hookscripts: Fix set behaviour for user.cifs and user.smb
Setting either of user.cifs or user.smb to disable should disable smb
shares when the smb share is already available.

Change-Id: I213ffca9cedc14107daeb30271d1f41dd9d7fcf4
BUG: 1105147
Signed-off-by: Raghavendra Talur <rtalur@redhat.com>
Reviewed-on: http://review.gluster.org/9042
Reviewed-by: Lalatendu Mohanty <lmohanty@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jose A. Rivera <jarrpa@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
2014-11-11 22:39:05 -08:00
Meghana Madhusudhan
a7a8a7507c Hooks : Infinite while loop introduced by another change.
A change made to all the hook scripts introduced an
infinite while loop in the script S31ganesha-reset.sh.
It resulted in 100% CPU usage by this script.

Change-Id: If62d8f0e065c6e6511363b8b26eae433f59bc5c3
BUG: 1155489
Signed-off-by: Meghana Madhusudhan <mmadhusu@redhat.com>
Reviewed-on: http://review.gluster.org/8966
Reviewed-by: soumya k <skoduri@redhat.com>
Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-10-24 01:16:54 -07:00
Meghana Madhusudhan
9816fe18e8 Hook scripts should exit with correct exit status.
When volume set options other than nfs-ganesha.host and nfs-ganesha.enable
are executed, the hook script S31ganesha-set.sh should exit with
exit status 0. The present behaviour results in an error message in
one of the logs that could be  misleading.

Similarly, hook script S30samba-set.sh should exit with
exit status 0 if samba is not installed. Fixing the issue
with a minor change in the script.

Change-Id: I35d1dc8400bb7043385800ed97adc5321829437f
BUG: 1122978
Signed-off-by: Meghana Madhusudhan <mmadhusu@redhat.com>
Reviewed-on: http://review.gluster.org/8385
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-08-31 11:05:04 -07:00
Emmanuel Dreyfus
33be39b42f Regression test portability: mktemp
Linux mktemp accepts to run without a template, NetBSD mandates it. Since
the template option has the same syntax, add it everywhere. While there,
also do this in scripts outside of regression testing.

BUG: 764655
Change-Id: I3ec140afbc9009257c81a56d77afcc21fef74cc4
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/8432
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Harshavardhana <harsha@harshavardhana.net>
Tested-by: Harshavardhana <harsha@harshavardhana.net>
2014-08-20 13:46:44 -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
Meghana Madhusudhan
866a9b9621 gluster vol set nfs-ganesha.enable off fails to unexport volume.
Due to a parameter type change in upstream nfs-ganesha
( v2.1 and above ), gluster vol set <volname> nfs-ganesha.enable
 off doesn't unexport the volume in question if it was already
exported.
A minor change in the hook script would result in the
expected behaviour.

Change-Id: I46f76f3cde6b6ebd7a94d5ee16f05a3648a2840f
BUG: 1124711
Signed-off-by: Meghana Madhusudhan <mmadhusu@redhat.com>
Reviewed-on: http://review.gluster.org/8390
Reviewed-by: soumya k <skoduri@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-08-05 03:33:40 -07:00
Meghana Madhusudhan
2e831d70c7 Changing the position of nfs-ganesha.log
Changing the position of ganesha.log from /tmp/ganesha.log
to /var/log/nfs-ganesha/ganesha.nfsd.log

Change-Id: Iff95fbc7fc690f4fdbc1789d84f3e41aaca9045b
BUG: 1116723
Signed-off-by: Meghana Madhusudhan <mmadhusu@redhat.com>
Reviewed-on: http://review.gluster.org/8249
Reviewed-by: soumya k <skoduri@redhat.com>
Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com>
Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-07-09 23:38:04 -07:00
Raghavendra Talur
8a2454d449 extras/hookscripts: When set option disables smb, don't start smb.
When user.smb or user.cifs option is set to disable, we remove the
share options from smb.conf. If smb process is running, a sighup is
required but we should not start the process if its not running.

Change-Id: I1e2163ff209ba858380f7da459ff1dba3cf673f2
BUG: 1105123
Signed-off-by: Raghavendra Talur <rtalur@redhat.com>
Reviewed-on: http://review.gluster.org/7994
Reviewed-by: Poornima G <pgurusid@redhat.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Tested-by: Vijay Bellur <vbellur@redhat.com>
2014-06-12 03:57:14 -07:00
Harshavardhana
f0c8be68ca scripts: CTDB lockvol ping-timeout should be 10secs
commit "4044e387dd40e2d12145fd32d5fd715406fcec8e" approach
to this led to deadlocks instead we rely on an old trick at
client side - without any need to modifying the volume globally.

Change-Id: I6e3c6bf9c0a3a0dd99a51b5d2a6c1f050ed2384c
BUG: 1091600
Signed-off-by: Harshavardhana <harsha@harshavardhana.net>
Reviewed-on: http://review.gluster.org/8007
Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
Reviewed-by: Poornima G <pgurusid@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-06-11 23:08:36 -07:00
Meghana M
294b954848 Hooks/nfs-ganesha:Change the hook script to enable new function signature of add export.
Minor changes in the hook script to avoid some
possible confusion when volume set options are used.
Adding a few additional checks to ensure correct behaviour.

Edited a few config parameters that have changed in upstream
ganesha recently.

Change-Id: I85b842cbbd4b35b7f72f3beb60abf6532ddaa8c7
BUG: 1101416
Signed-off-by: Meghana M <mmadhusu@redhat.com>
Reviewed-on: http://review.gluster.org/7890
Reviewed-by: soumya k <skoduri@redhat.com>
Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-06-02 22:32:32 -07:00
Avra Sengupta
f6677d1e30 glusterd/geo-rep: Use getent passwd instead of $HOME
$HOME might not be set in the env variables, as is the case
when these scripts are executed using the runner framework.
Hence using getent passwd instead of $HOME

Change-Id: I99f6bcd788d727be534b3040600d66c8dbb7ee92
BUG: 1099041
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/7803
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-by: Kotresh HR <khiremat@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
Tested-by: Venky Shankar <vshankar@redhat.com>
2014-05-20 03:21:30 -07:00
Meghana
6a9a52c932 Hooks:Modified S31ganesha-set.sh to enable dynamic exports via NFS-ganesha
Dbus signals have to be sent to add and remove exports on the fly,
 without restarting nfs-ganesha server. Adding those signals in
 the hook script to enable the same.

 Adding another to check to enable IP modification,
 without restarting nfs-ganesha.Adding checks to find the
 configuration file in /etc/glusterfs-ganesha.

 Removing nested volume set options. This introduces
 some issues that will be documented clearly.

Signed-off-by: Meghana <mmadhusu@redhat.com>
Change-Id: I28f7983f2d18529dc813ddc9773b33c6caee1ad4
BUG: 1095656
Signed-off-by: Meghana <mmadhusu@redhat.com>
Reviewed-on: http://review.gluster.org/7709
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-05-16 10:01:36 -07:00
Avra Sengupta
09e9775127 glusterd/geo-rep: Allow gverify.sh and S56glusterd-geo-rep-create-post.sh
to operate for non-root privileged slave volume

Mounting the slave-volume on local node, to perform disk checks
in order to allow gverify.sh to operate for non-root privileged
slave volume

Allowing the hook script S56glusterd-geo-rep-create-post.sh
to operate for non-root privileged slave volume

Modified peer_add_secret_pub.in to accept username as argument
and add the pem keys to the users's_home_dir/.ssh/authorized_keys

Wrote set_geo_rep_pem_keys.sh which accepts username as argument
and copies the pem keys from the user's home directory to
$GLUSTERD_WORKING_DIR/geo-replication/ and then copies the keys
to other nodes in the cluster and add them to the respective
authorized keys. The script takes as argument the user name and
assumes that the user will be present in all the nodes in the
cluster. It is not needed for root.

To summarize:
For a privileged slave user, execute the following on master node as super user:
gluster system:: execute gsec_create
gluster volume geo-replication <master_vol> [root@]<slave_ip>::<slave_vol> create push_pem

For a non-privileged slave user execute the following on master node as super user:
gluster system:: execute gsec_create
gluster volume geo-replication <master_vol> <slave_user>@<slave_ip>::<slave_vol> create push_pem
then on the slave node execute the following as super user:
/usr/local/libexec/glusterfs/set_geo_rep_pem_keys.sh <slave_user>

BUG: 1077452
Change-Id: I88020968aa5b13a2c2ab86b1d6661b60071f6f5e
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/7744
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
Tested-by: Venky Shankar <vshankar@redhat.com>
2014-05-14 10:24:25 -07:00
Meghana M
0088e318c1 cli/hooks : Add volume set options to enable/disable nfs-ganesha support.
1. gluster volume set nfs-ganesha.enable ON/OFF
If the option is set to ON, the volume field in the nfs-ganesha configuartion file is
edited. Gluster-nfs is disabled on that volume and the volume is exported using
nfs-ganesha.

2.gluster volume set nfs-ganesha.host IP
This is used to provide the IP of the nfs-ganesha host.

Note : nfs-ganesha.host MUST be set before using nfs-ganesha.enable ON

The switch from gluster-nfs to nfs-ganesha is mostly done by the hook-scripts
in the post phase of the 'set' option. As a result, gluster volume reset does not
function as it is expected to. By default, nfs-ganesha will be set to off but the
process  will not be killed.

Hence, a few changes have to be made post 'reset' option as well. Those changes
also have been added.

Change-Id: I7fdc14ee49d1724af96eda33c6a3ec08b1020788
BUG: 1092283
Signed-off-by: Meghana <mmadhusu@redhat.com>
Reviewed-on: http://review.gluster.org/7321
Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
Reviewed-by: Santosh Pradhan <spradhan@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-05-03 07:24:07 -07:00
Raghavendra Talur
f48656b32e extras/hookscripts: Remove %P from smb share path value.
We had added %P in the value for path in smb share definitions to
avoid ctdb errors. However, %P does not work well for windows
clients and they fail to access the share.

Solution for the original problem:
The error messages were being generated by a monitoring script that ctdb
runs. The script reads the path value from testparm and tests if it exists
in the local machine. This particular check does not hold valid for
virtual file system backends like gluster. There is no harm in asking
ctdb to not to check the existence of such backend and can be done by
setting the following config in ctdb.conf:

CTDB_SAMBA_SKIP_SHARE_CHECK=YES.

Change-Id: I91627c8a279126a5cc24c6347847f9bfbad53dd5
BUG: 1068776
Signed-off-by: Raghavendra Talur <rtalur@redhat.com>
Reviewed-on: http://review.gluster.org/7598
Reviewed-by: Jose A. Rivera <jarrpa@redhat.com>
Reviewed-by: Poornima G <pgurusid@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Harshavardhana <harsha@harshavardhana.net>
2014-05-02 20:42:30 -07:00
Harshavardhana
4044e387dd scripts: CTDB lockvol ping-timeout should be 10secs
Users often forget to update the ping-timeout, perhaps
we should take care of this automatically

Change-Id: I6d14df8aa52665847233cb1760dfd54f41baadec
BUG: 1091600
Signed-off-by: Harshavardhana <harsha@harshavardhana.net>
Reviewed-on: http://review.gluster.org/7569
Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Jose A. Rivera <jarrpa@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-05-02 08:52:40 -07:00
AkshataDM
9565ac3328 Made spelling changes to 19 files
Change-Id: If91cf44578fe0b5176ea01ae5c5962e31606f640
BUG: 1075417
Signed-off-by: AkshataDM <oxta28@gmail.com>
Reviewed-on: http://review.gluster.org/7280
Reviewed-by: Varun Shastry <vshastry@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Tested-by: Anand Avati <avati@redhat.com>
2014-03-16 11:57:21 -07:00
Harshavardhana
3076f75e57 scripts: CTDB hooks should add _netdev for network mounts
Change-Id: I86ad5e9ed291866a8d478768fb447e269f51c39e
BUG: 1075182
Signed-off-by: Harshavardhana <harsha@harshavardhana.net>
Reviewed-on: http://review.gluster.org/7221
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Jose A. Rivera <jarrpa@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-03-11 23:45:14 -07:00
Raghavendra Talur
ecc475d0a5 hook-scripts: Move smb hooks to right place.
Moved the hook-scripts to dirs corresponding to event.
Also, edited S30samba-set.sh to with changes in
other two hook scripts to bring uniformity.

Change-Id: Ib98c0a18d4bb5d0ba4b881b2e19b40d72580b1c2
BUG: 1073468
Signed-off-by: Raghavendra Talur <rtalur@redhat.com>
Reviewed-on: http://review.gluster.org/7201
Reviewed-by: Poornima G <pgurusid@redhat.com>
Reviewed-by: Bala FA <barumuga@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2014-03-10 06:38:21 -07:00
Harshavardhana
fc01b0293b extras/hookscripts: Add %P as default relative root
ctdb in its monitoring script looks for the "path" variable
values at the system level not at share level.

This relative root path, if any should be default for all
volumes, to avoid issues with ctdb when doing subdirectory shares.

Error:
2014/02/21 12:50:34.355754 [41083]: ERROR: samba directory "/foodir" not available

Fix: Add %P in your smb.conf

[gluster-foodir]
...
...
    path = %P/foodir
...
...

Change-Id: If3c110d844ba8301c901dbce40b23cac99d6d55b
BUG: 1068776
Signed-off-by: Harshavardhana <harsha@harshavardhana.net>
Reviewed-on: http://review.gluster.org/7147
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jose A. Rivera <jarrpa@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2014-02-24 19:56:31 -08:00
Varun Shastry
c0a14c00bf features/quota: Make grep search more accurately
The hook script was searching the info file for "features.quota" to know the
quota status (enable/disabled). When features.quota-deem-statfs the grep is not
accurate. Fixed this issue.

Change-Id: I4104a93c1c1e0ac9fd7ef7bfef993425ab50e651
BUG: 969461
Signed-off-by: Varun Shastry <vshastry@redhat.com>
Reviewed-on: http://review.gluster.org/6380
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-01-16 21:30:32 -08:00
Varun Shastry
50a6e9a740 features/quota: Add the quota config xattr to newly added brick
Issue:
Quota directory limit configuration is stored in the xattrs. When a new brick
is added these 'limit-set' xattrs have to be created to the directory in the
new brick. This is done by the dht directory healing when the directory is
created in the new brick. Since 'root' directory is already created DHT doesn't
heal the limit-set xattr root.

Solution:
When the add-brick command is issued run the below hook script to heal the
'limit-set' xattr. The hook script does the following only if limit is
configured on root.
    1. Create an auxiliary mount.
    2. getxattr 'limit-set' on the root
    3. setxattr the same value on the root
But this script needs the volume to be started to make the auxiliary mount.

To handle the case when the add-brick is issued when the volume was stopped,
symlink is created by the 'master' script to the corresponding location and
these two are by default disabled.

So, a 'master' script is added in the add-brick/pre. When add-brick command is
issued, it enables one of the scripts mentioned above based on the condition,
    if volume is started - enable add-brick/post script
    else                 - enable start/post script
After the actual script completes its job, it disables itself.

Note:
The enabling and disabling of the script is based on the glusterd's logic, that
it only runs the scripts which starts its name with 'S'. So,
    Enable     - symlink the file to 'S'*
    Disable    - unlink the symlink.

Change-Id: I2d3947a4d686c54417ec95f530af3bdd3444f4e2
BUG: 969461
Signed-off-by: Varun Shastry <vshastry@redhat.com>
Reviewed-on: http://review.gluster.org/6104
Reviewed-by: Brian Foster <bfoster@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2013-11-26 11:57:11 -08:00
Poornima
f063951d75 extras/hook-scripts: Enable per client logging for gluster shares served by SAMBA
Edited hook scrips to add a variable in the option 'log file', which will be
substituted for client IP.

Change-Id: I50f143bb3114eb00afab2e1237d749804c885ca6
BUG: 1020848
Signed-off-by: Poornima <pgurusid@redhat.com>
Reviewed-on: http://review.gluster.org/6109
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2013-10-22 12:55:37 -07:00
Raghavendra Talur
11bb1fc584 extras/hookscripts: Fix the multiple entries in smb.conf problem.
Problem:
1. Force starts and user.smb sets were adding multiple entries to
the smb.conf file for the same volume.
Make a check for the entry and search with exact name.

2. Again, while deleting the share name from smb.conf search with
exact name so that volumes with names which are substrings of ones to
be deleted don't get deleted.

3. We don't need to use a tmp file while using sed -i, fixed that.

Change-Id: Ie0f7c9d4790ef9a177a043378a761c9ffe1628e5
BUG: 994727
Signed-off-by: Raghavendra Talur <rtalur@redhat.com>
Reviewed-on: http://review.gluster.org/6043
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Lalatendu Mohanty <lmohanty@redhat.com>
Tested-by: Lalatendu Mohanty <lmohanty@redhat.com>
2013-10-08 09:22:00 -07:00
Lalatendu Mohanty
31cacce770 hookscripts: Changes in hook scripts to make it work on all Linux/GNU distribution
Removed the hard coded values for smb.conf, smb logfile location and smbd.pid.
The current hook scripts also work for manully compiled (make, make install)
instance of gluster and Samba. But we have to manually copy the hook scripts
to respective locations.

Change-Id: I14056830fcd2ecb48b3c4df89265f4408c8de3e3
Signed-off-by: Lalatendu Mohanty <lmohanty@redhat.com>
Reviewed-on: http://review.gluster.org/5947
Reviewed-by: poornima g <pgurusid@redhat.com>
Reviewed-by: susant palai <spalai@redhat.com>
Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
Tested-by: Raghavendra Talur <rtalur@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2013-10-04 17:05:35 -07:00
Venky Shankar
3bfa0dde13 glusterd/gverify.sh: Stops session being created with invalid slave details
create force will fail with proper message, if the ip is not
reachable, or is unable to fetch slave details.

Change-Id: I44a3ba777b37702ffd0e48e9cb46c51e293327d4
BUG: 988314
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Signed-off-by: Venky Shankar <vshankar@redhat.com>
Reviewed-on: http://review.gluster.org/5516
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2013-09-04 19:29:17 -07:00
Raghavendra Talur
00a73eb528 extras/hookscripts: Add default logfile for glusterfs vfs plugin.
Glusterfs vfs plugin for samba makes call into gfapi which brings
up complete client process stack of gluster. Not having default
log file means not logging client process at all.

This patch adds default logfile and loglevel for vfs plugin.

Change-Id: Ie0fb6bbb445d6f3349fc35c713743094c0f08915
BUG: 999910
Signed-off-by: Raghavendra Talur <rtalur@redhat.com>
Reviewed-on: http://review.gluster.org/5685
Reviewed-by: Anand Avati <avati@redhat.com>
Tested-by: Anand Avati <avati@redhat.com>
2013-08-22 12:49:26 -07:00
Raghavendra Talur
993001dadf extras/hook-scripts: Don't add multiple entries in smb.conf
When volume is force started, there may be entry in smb.conf
for that volume. Always check for entry before adding one.

Change-Id: I44f893174a993abaa31c24c1a81bb38a58617808
BUG: 994727
Signed-off-by: Raghavendra Talur <rtalur@redhat.com>
Reviewed-on: http://review.gluster.org/5526
Reviewed-by: Anand Avati <avati@redhat.com>
Tested-by: Anand Avati <avati@redhat.com>
2013-08-07 14:56:33 -07:00
Avra Sengupta
5757ed2727 glusterd/cli changes for distributed geo-rep
Commands:
gluster system:: execute gsec_create
gluster volume geo-rep <master> <slave-url> create [push-pem] [force]
gluster volume geo-rep <master> <slave-url> start [force]
gluster volume geo-rep <master> <slave-url> stop [force]
gluster volume geo-rep <master> <slave-url> delete
gluster volume geo-rep <master> <slave-url> config
gluster volume geo-rep <master> <slave-url> status

The geo-replication is distributed. The session will be created, and
gsyncd will be spawned on all relevant nodes, instead of only one
node.

geo-rep: Collecting status detail related data

Added persistent store for saving information about
TotalFilesSynced, TotalSyncTime, TotalBytesSynced

Changes in the status information in socket:
Existing(Ex):
FilesSynced=2;BytesSynced=2507;Uptime=00:26:01;

New(Ex):
FilesSynced=2;BytesSynced=2507;Uptime=00:26:01;SyncTime=0.69978;
TotalSyncTime=2.890044;TotalFilesSynced=6;TotalBytesSynced=143640;

Persistent details stored in
/var/lib/glusterd/geo-replication/${mastervol}/${eSlave}-detail.status

Change-Id: I1db7fc13ffca2e415c05200b0109b1254067f111
BUG: 847839
Original Author: Avra Sengupta <asengupt@redhat.com>
Original Author: Venky Shankar <vshankar@redhat.com>
Original Author: Aravinda VK <avishwan@redhat.com>
Original Author: Amar Tumballi <amarts@redhat.com>
Original Author: Csaba Henk <csaba@redhat.com>
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/5132
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Tested-by: Vijay Bellur <vbellur@redhat.com>
2013-07-26 13:19:18 -07:00
Avra Sengupta
b13c483dca gsyncd: distribute the crawling load
* also consume changelog for change detection.
* Status fixes
* Use new libgfchangelog done API
* process (and sync) one changelog at a time

Change-Id: I24891615bb762e0741b1819ddfdef8802326cb16
BUG: 847839
Original Author: Csaba Henk <csaba@redhat.com>
Original Author: Aravinda VK <avishwan@redhat.com>
Original Author: Venky Shankar <vshankar@redhat.com>
Original Author: Amar Tumballi <amarts@redhat.com>
Original Author: Avra Sengupta <asengupt@redhat.com>
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/5131
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Tested-by: Vijay Bellur <vbellur@redhat.com>
2013-07-26 13:18:57 -07:00
Raghavendra Talur
ac62c953e4 extras/hook-scripts: Set of changes for new samba share method.
New method of creating a share of gluster volume
through samba eliminates the requirement of fuse
mount and changes in fstab.

glusterfs vfs plugin has to be specified as required
vfs object.
Path now is relative to the root of gluster volume.
/ signifies complete volume.

Change-Id: I3d80452cd58513ef59d6a816c1ab62ebc3b76a62
BUG: 953694
Signed-off-by: Raghavendra Talur <rtalur@redhat.com>
Reviewed-on: http://review.gluster.org/5247
Reviewed-by: José Rivera <jrivera@redhat.com>
Tested-by: José Rivera <jrivera@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2013-06-28 09:25:07 -07:00
Mohammed Junaid
6a6ec98042 object-storage: Store the lock file in /var/run/swift.
* Openstack swift uses the /var/run/swift directory to store the pid files
  for all the servers.

* Also, added a script that would unmount the gluster client on a volume stop.

Change-Id: Ib5b9a2964987ca7696d9a2570f1f7af8490b2168
BUG: 861497
Signed-off-by: Mohammed Junaid <junaid@redhat.com>
Reviewed-on: http://review.gluster.org/4417
Reviewed-by: Peter Portante <pportant@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2013-02-07 14:02:19 -08:00
Avra Sengupta
b8d5fd2b88 glusterfs : Moved option files, and statedumps from /tmp
Change-Id: Ibdede396c4d6859225937316b7a59a661bcaf9f5
BUG: 764890
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/4422
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2013-01-29 15:27:29 -08:00
Niels de Vos
22fdadad06 extras: hook scripts should not start Samba if it is not running
If the smb service was turned off by the administrator, the hook scripts
should not start the service on starting/stopping a volume.

By calling the service script with "condrestart" instead of plain
"start", the service script checks if samba actually was running.

Change-Id: I93408050a65445d98d2f9bb61992e216e04e0b04
BUG: 861506
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/4015
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-10-02 01:18:13 -07:00
Krishnan Parthasarathi
352f09f8eb extras/hook-scripts: Fixed EXTRA_DIST to explicitly list *.sh files
Change-Id: I48785317b42e37a6e7768c89bdb7ca8ac41220fa
BUG: 806996
Signed-off-by: Krishnan Parthasarathi <kp@gluster.com>
Reviewed-on: http://review.gluster.com/3271
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-05-03 23:49:13 -07:00
Krishnan Parthasarathi
7ee1c22353 extras: Added hook script to help in CTDB setup
Change-Id: Ib43cd3583e791aabc8cc25fe4eea43a620f73d01
BUG: 806996
Signed-off-by: Krishnan Parthasarathi <kp@gluster.com>
Reviewed-on: http://review.gluster.com/3188
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-05-02 22:56:24 -07:00
Krishnan Parthasarathi
fdcbf065a9 glusterfs.spec: Added hook-scripts in server rpm
Change-Id: Idd0ed2a72ea9ec947eaf142b889730e8d4be63c1
BUG: 806996
Signed-off-by: Krishnan Parthasarathi <kp@gluster.com>
Reviewed-on: http://review.gluster.com/3211
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-04-23 05:31:02 -07:00
Krishnan Parthasarathi
64177411f7 extras: Added (hook) scripts to start/stop samba on volume start and stop
These are example/helper scripts that demonstrate how one could
leverage the recently added hooks interface in glusterd.
The scripts are in 'beta'.

Change-Id: I7aaf999f3bdfb276ef64e115a57cbdb36c7a896e
BUG: 806996
Signed-off-by: Krishnan Parthasarathi <kp@gluster.com>
Reviewed-on: http://review.gluster.com/3086
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-04-19 00:12:35 -07:00