Skip to content

Commit 0e3467a

Browse files
Update Blog “highly-available-nfs-workload-on-hpe-greenlake-for-private-cloud-enterprise-using-serviceguard-for-linux”
1 parent ba9343e commit 0e3467a

File tree

1 file changed

+42
-27
lines changed

1 file changed

+42
-27
lines changed

content/blog/highly-available-nfs-workload-on-hpe-greenlake-for-private-cloud-enterprise-using-serviceguard-for-linux.md

Lines changed: 42 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -479,24 +479,26 @@ This completes the Serviceguard software installation.
479479

480480
Serviceguard for Linux Flex Storage Add-on is a software-based, shared-nothing, replicated storage solution that mirrors the content of block devices. NFS server export data will be replicated to all Serviceguard cluster nodes using this add-on. Ansible snippet below can be used to configure the replication.
481481

482-
* hosts: sglx-storage-flex-add-on-hosts
482+
```
483+
- hosts: sglx-storage-flex-add-on-hosts
483484
tasks:
484-
485-
* name: Populate /etc/drbd.d/global_common.conf file
485+
- name: Populate /etc/drbd.d/global_common.conf file
486486
become: True
487487
shell: |
488488
echo "global { usage-count yes; } common { handlers { disconnected /usr/local/cmcluster/conf/scripts/sgenss/replication_software/drbd/drbd_disconnect_handler.sh; } options { auto-promote no; } }" > /etc/drbd.d/global_common.conf
489-
* name: Create first part of drbd config file
489+
490+
- name: Create first part of drbd config file
490491
become: True
491492
shell: |
492493
echo "resource drbd0 {" >/etc/drbd.d/drbd0.res
493494
echo " disk /dev/sdb;" >> /etc/drbd.d/drbd0.res
494495
echo " device /dev/drbd0;" >> /etc/drbd.d/drbd0.res
495496
echo " meta-disk internal;" >> /etc/drbd.d/drbd0.res
496-
* name: Create second part of drbd config file
497+
498+
- name: Create second part of drbd config file
497499
become: True
498500
vars:
499-
this_nodename: "{{ hostvars\[item] }}"
501+
this_nodename: "{{ hostvars[item]['ansible_hostname'] }}"
500502
shell: |
501503
echo " on {{ this_nodename }} {" >> /etc/drbd.d/drbd0.res
502504
echo " address {{ item }}:7789;" >> /etc/drbd.d/drbd0.res
@@ -505,46 +507,59 @@ Serviceguard for Linux Flex Storage Add-on is a software-based, shared-nothing,
505507
loop: "{{ ansible_play_batch }}"
506508
loop_control:
507509
index_var: my_index
508-
* name: Set initial empty mesh list
510+
511+
- name: Set initial empty mesh list
509512
set_fact:
510513
mesh: ""
511-
* name: Build list of nodes for connection-mesh entry
514+
515+
- name: Build list of nodes for connection-mesh entry
512516
loop: "{{ ansible_play_batch }}"
513517
set_fact:
514-
mesh: "{{ mesh + hostvars\[item] + ' ' }}"
515-
* name: Check mesh nodes
518+
mesh: "{{ mesh + hostvars[item]['ansible_hostname'] + ' ' }}"
519+
520+
- name: Check mesh nodes
516521
debug: var=mesh
517-
* name: Create connection-mesh portion of config file
522+
523+
- name: Create connection-mesh portion of config file
518524
become: True
519525
shell: |
520526
echo " connection-mesh {" >> /etc/drbd.d/drbd0.res
521527
echo " hosts {{ mesh|trim }};" >> /etc/drbd.d/drbd0.res
522528
echo " }" >> /etc/drbd.d/drbd0.res
523-
* name: Create last part of drbd config file
529+
530+
- name: Create last part of drbd config file
524531
become: True
525532
shell: |
526533
echo "}" >> /etc/drbd.d/drbd0.res
527-
* name: Create drbd0 device
528-
become: True
529-
shell: |
530-
drbdadm create-md drbd0
531-
when: res.rc != 0
532-
* name: Start DRBD service
533-
become: True
534-
systemd:
535-
name: drbd
536-
enabled: True
537-
state: started
538-
* hosts: primary
539-
tasks:
540534
541-
* name: Enable this node as Primary
535+
- name: Create drbd0 device
536+
become: True
537+
shell: |
538+
drbdadm create-md drbd0
539+
when: res.rc != 0
540+
541+
- name: Start DRBD service
542+
become: True
543+
systemd:
544+
name: drbd
545+
enabled: True
546+
state: started
547+
548+
- hosts: primary
549+
tasks:
550+
- name: Enable this node as Primary
542551
become: True
543552
shell: |
544553
drbdadm primary drbd0 --force
545554
when: res.rc != 0
546555
547-
Configuring LVM
556+
```
557+
558+
559+
560+
## Configuring LVM
561+
562+
548563
Once data replication is configured on the nodes, we can now configure LVM on top of the DRBD disk /dev/drbd0. The following Ansible snippet can be used to configure the LVM volume group named nfsvg and an logical volume names nfsvol of size 45GB
549564

550565
- - -

0 commit comments

Comments
 (0)