Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1194596

Summary: [geo-rep]: In a mountbroker setup, set_geo_rep_pem_keys.sh fails to copy keys to its slave peers.
Product: [Community] GlusterFS Reporter: Aravinda VK <avishwan>
Component: geo-replicationAssignee: Aravinda VK <avishwan>
Status: CLOSED NOTABUG QA Contact:
Severity: unspecified Docs Contact:
Priority: high    
Version: mainlineCC: aavati, bugs, csaba, gluster-bugs, nlevinki, rhs-bugs, sanandpa, storage-qa-internal
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1194574 Environment:
Last Closed: 2015-02-25 05:58:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1194574    
Bug Blocks:    

Description Aravinda VK 2015-02-20 10:20:58 UTC
+++ This bug was initially created as a clone of Bug #1194574 +++

Description of problem:

While setting up a geo-rep mountbroker setup, a shell script (set_geo_rep_pem_keys.sh) is run on one of the slave nodes, which copies the keys to other slave nodes in the cluster. That errors out as it is not able to recognize the global variable $GLUSTERD_WORKING_DIR. 

Version-Release number of selected component (if applicable): 
3.6.0.44-1

How reproducible:
Always

Steps to Reproduce:
1. Create a mountbroker setup with the following steps. Create a group (groupadd <groupname) and a user (useradd <username> -g <groupname>) in each of the slave nodes.
e.g., groupadd geogroup
      useradd geoacc -g geogroup
2. Create a directory on all the slave nodes, owned by the root with the permissions 0711. 
e.g., mkdir /var/mountbroker-root
      chmod 711 /var/mountbroker-root
3. Add the following options to the glusterd volfile present at /etc/glusterfs/glusterd.vol
    option mountbroker-root /var/mountbroker-root
    option mountbroker-geo-replication.geoaccount <slavevolume>
    option geo-replication-log-group geogroup
    option rpc-auth-allow-insecure on
4. Restart glusterd on all the slave nodes
e.g., service glusterd restart
5. Setup a password-less ssh from the masternode to the non-root user on one of the slave node. 
e.g., ssh-keygen
      ssh-copy-id geoacc@<slavenode>
6. Create a geo-rep account from the master to the non-root useraccount on the slave
e.g., gluster volume geo-rep <mastervolume> geoacc@<slavenode>::<slavevolume> create push-pem
7. In the slavenode which is used to create relationship, run /usr/libexec/glusterfs/set_geo_rep_pem_keys.sh as root, with username, mastervolume and slavevolume as arguments.
e.g., /usr/libexec/glusterfs/set_geo_rep_pem_keys.sh geoacc master slave
8. Start the geo-rep session
e.g.,   gluster volume geo-rep <mastervolume> geoacc@<slavenode>::<slavevolume> start


Actual results:

At step7, it fails with the below error: 
[root@dhcp42-130 ~]#  /usr/libexec/glusterfs/set_geo_rep_pem_keys.sh geoacc master slave
cp: cannot create regular file `/geo-replication/': Is a directory
Successfully copied file.
Command executed successfully.
[root@dhcp42-130 ~]#

This seems to be regression. It used to work on an earlier build, as per Shilpa.

Expected results:
The command should have passed (if it would have correctly resolved gluster_working_directory) and the following step8 would have resulted in success

Additional info:

Comment 1 Anand Avati 2015-02-20 10:32:08 UTC
REVIEW: http://review.gluster.org/9720 (geo-rep: Substitute GLUSTERD_WORKDIR in set_geo_rep_pem_keys.sh) posted (#1) for review on master by Aravinda VK (avishwan)

Comment 2 Aravinda VK 2015-02-25 05:58:03 UTC
Before executing /usr/libexec/glusterfs/set_geo_rep_pem_keys.sh script export GLUSTERD_WORKING_DIR

export GLUSTERD_WORKING_DIR=/var/lib/glusterd
/usr/libexec/glusterfs/set_geo_rep_pem_keys.sh <NON_ROOT_GEOREP_USER> <MASTERVOL> <SLAVEVOL>