Skip to content

Commit

Permalink
Merge pull request #165 from gluster-deploy/master
Browse files Browse the repository at this point in the history
Fix xfs options
  • Loading branch information
sac authored Sep 14, 2016
2 parents 62d6f9b + 94eb2f7 commit ad61b35
Show file tree
Hide file tree
Showing 8 changed files with 108 additions and 6 deletions.
1 change: 0 additions & 1 deletion examples/enable-samba.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ action=smb-setup
volname=samba1
force=yes
smb_username=smbuser
smb_password=smbuser
smb_mountpoint=/mnt/smb
23 changes: 23 additions & 0 deletions examples/glusterd-slice.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[hosts]
10.70.37.47
10.70.37.147

# when slice_setup=yes is set for service glusterd, the following
# additional changes are done.
#
# Creates a file /etc/systemd/system/glusterd.service.d/99-cpu.conf with
# [Service]
# CPUAccounting=yes
# Slice=glusterfs.slice
#
# Creates a file /etc/systemd/system/glusterfs.slice with contents
# [Slice]
# CPUQuota=400%
#
# And runs:
# systemctl daemon-reload

[service]
action=start
service=glusterd
slice_setup=yes
1 change: 1 addition & 0 deletions examples/hc.conf
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ vgname=RHGS_vg1
poolname=lvthinpool
cache_lv=lvcache
cache_lvsize=5GB
# cachemode=writeback

[service3]
action=stop
Expand Down
21 changes: 21 additions & 0 deletions examples/ssl-on-existing-vol.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[hosts]
10.70.37.147
10.70.37.47

# This is important. Clients have to be unmounted before setting up SSL
[clients1]
action=unmount
hosts=10.70.37.173,10.70.37.107
client_mount_points=/mnt/data

[volume]
action=enable-ssl
volname=ssl
ssl_clients=10.70.37.107,10.70.37.173

[clients2]
action=mount
hosts=10.70.37.173,10.70.37.107
volname=ssl
fstype=glusterfs
client_mount_points=/mnt/data
27 changes: 27 additions & 0 deletions examples/ssl_enable.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[hosts]
10.70.37.147
10.70.37.47

[backend-setup]
devices=/dev/vdb
vgs=vg1
pools=pool1
lvs=lv1
mountpoints=/mnt/brick

[volume]
action=create
volname=ssl
transport=tcp
replica_count=2
force=yes
enable_ssl=yes
ssl_clients=10.70.37.107,10.70.37.173
brick_dirs=/data/1

[clients]
action=mount
hosts=10.70.37.173,10.70.37.107
volname=ssl
fstype=glusterfs
client_mount_points=/mnt/data
15 changes: 14 additions & 1 deletion gdeploycore/backend_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,20 @@ def write_lvol_names(self):
zip(self.vgs, self.lvs)]
if lvols:
self.section_dict['lvols'] = lvols
self.section_dict['opts'] = "-f -K -i size=512 -d sw=10,su=128k -n size=8192"
# If RAID data is provided use it to set the stripe_width and
# stripe_unit_size from the config.
disktype = self.config_get_options('disktype', False)
if disktype:
sw = self.config_get_options('diskcount', True)
su = self.config_get_options('stripesize', False)
if not su:
# No stripe size given assuming 256
su = 256
self.section_dict['opts'] = "-f -K -i size=512 -d sw=%s,su=%sk\
-n size=8192"%(sw[0],su[0])
else:
self.section_dict['opts'] = "-f -K -i size=512 -n size=8192"

self.section_dict['fstype'] = "xfs"
Global.logger.info("Creating %s filesystem on %s with options %s"\
%(self.section_dict['fstype'],
Expand Down
20 changes: 19 additions & 1 deletion gdeployfeatures/lv/lv.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,25 @@ def get_mount_data(section_dict, devices, vgnames):
if section_dict.get('mkfs-opts'):
section_dict['opts'] = section_dict['mkfs-opts']
elif fstype == 'xfs':
section_dict['opts'] = "-f -K -i size=512 -d sw=10,su=128k -n size=8192"
# If RAID data is provided use it to set the stripe_width and
# stripe_unit_size from the config.
disktype = helpers.config_get_options('disktype', False)
if disktype:
sw = helpers.config_get_options('diskcount', True)
su = helpers.config_get_options('stripesize', False)
if not su:
# No stripe size given assuming 256
su = 256
section_dict['opts'] = "-f -K -i size=512 -d sw=%s,su=%sk\
-n size=8192"%(sw[0],su[0])
else:
section_dict['opts'] = "-f -K -i size=512 -n size=8192"

Global.logger.info("Creating %s filesystem on %s with options %s"\
%(section_dict['fstype'],
section_dict['lvols'],
section_dict['opts']))


mountpoint = helpers.listify(section_dict.get('mount'))
if not mountpoint:
Expand Down
6 changes: 3 additions & 3 deletions playbooks/georep_common_public_key.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@

- name: Copy the public key to the local
fetch: src=~/.ssh/id_rsa.pub
dest=/tmp/id_rsa.tmp
dest="{{ base_dir }}"/id_rsa.tmp
flat=yes

- name: Copying local key to slave node
local_action: shell cat /tmp/id_rsa.tmp | ssh "{{user}}"@{{ item }} "cat >> ~/.ssh/authorized_keys"
local_action: shell cat "{{ base_dir }}"/id_rsa.tmp | ssh "{{user}}"@{{ item }} "cat >> ~/.ssh/authorized_keys"
with_items: "{{ groups['georep_slave'] }}"

- name: Deleting temporal files
local_action: file path=/tmp/id_rsa.tmp state=absent
local_action: file path="{{ base_dir }}"/id_rsa.tmp state=absent

0 comments on commit ad61b35

Please sign in to comment.