Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Content imported from a Scroll Translations translation file.

...

Sv translation
languagede

Status
colourRed
titleTHIS PAGE IS ONLY AVAILABLE IN ENGLISH

Sv translation
languagefr

Code Block
# Create the phsyical volume - this is based on sdb assuming it is the second drive on the system lvm pvcreate /dev/sdb   # Create the volume group lvm vgcreate "vg_drbd_jtelshared" /dev/sdb   # Create the logical volume lvm lvcreate -l +100%FREE vg_drbd_jtelshared -n lv_drbd_jtelshared
Code Block
# Prepare the firewall firewall-cmd --zone=public --add-port=7788-7799/tcp --permanent firewall-cmd --reload

Code Block
languagebash
mkdir /srv/jtel mkdir /srv/jtel/shared chown -R jtel:jtel /srv/jtel

Code Block
languagebash
dnf -y install https://www.elrepo.org/elrepo-release-8.el8.elrepo.noarch.rpm rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org dnf -y install drbd90-utils kmod-drbd90 systemctl enable drbd semanage permissive -a drbd_t systemctl start drbd

Status
colourRed
title

Code Block
# Configure DRBD cat <<EOFF > /etc/drbd.d/jtelshared.res resource jtelshared { protocol C; meta-disk internal; device /dev/drbd0; syncer { verify-alg sha1; } net { allow-two-primaries; } on acd-store1.jtel.local { disk /dev/vg_drbd_jtelshared/lv_drbd_jtelshared; address 10.1.1.1:7789; } on acd-store2.jtel.local { disk /dev/vg_drbd_jtelshared/lv_drbd_jtelshared; address 10.1.1.2:7789; } } EOFF
Code Block
# Create metadata and start DRBD drbdadm create-md jtelshared drbdadm up jtelshared
Code Block
# Make ONE node primary drbdadm primary jtelshared --force

Code Block
drbdadm status jtelshared

Code Block
jtelshared role:Primary disk:UpToDate acd-store2 role:Secondary replication:SyncSource peer-disk:Inconsistent done:7.19

Code Block
drbdadm primary jtelshared
Code Block
mkfs.xfs -L data /dev/drbd/by-res/jtelshared/0

Code Block
cat << EOFF >> /etc/fstab /dev/drbd/by-res/jtelshared/0 /srv/jtel/shared xfs noauto,noatime,nodiratime 0 0 EOFF

Code Block
mount /srv/jtel/shared
Code Block
cat <<EOFF > /srv/jtel/shared/test.txt test 123 EOFF umount /srv/jtel/shared
Code Block
mount /srv/jtel/shared cat /srv/jtel/shared/test.txt # Check contents of file before proceeding      rm /srv/jtel/shared/test.txt umount /srv/jtel/shared

Warning

Code Block
sed -i '/jtelshared/s/^/#/' fstab systemctl disable drbd umount /srv/jtel/shared
Info

Translations Ignore


Code Block
dnf -y install samba samba-client lsof


Translations Ignore


Code Block
# SMB Conf cat <<EOFF > /etc/samba/smb.conf [global] workgroup = JTEL security = user passdb backend = tdbsam min protocol = SMB3 reset on zero vc = yes [shared] comment = jtel ACD Shared Directory public = no read only = no writable = yes locking = yes path = /srv/jtel/shared create mask = 0644 directory mask = 0755 force user = jtel force group = jtel acl allow execute always = True EOFF


Translations Ignore


Code Block
setsebool -P samba_enable_home_dirs=on samba_export_all_rw=on use_samba_home_dirs=on use_nfs_home_dirs=on firewall-cmd --zone=public --add-port=445/tcp --add-port=139/tcp --add-port=138/udp --add-port=137/udp --permanent firewall-cmd --reload


Translations Ignore


Code Block
ln -s /srv/jtel/shared /home/jtel/shared


Status
colourRed
title

Translations Ignore


Code Block
printf '<password>\n<password>\n' | smbpasswd -a -s jtel 


Status
colourRed
title

Translations Ignore


Code Block
useradd -m Administrator printf '<password>\n<password>\n' | smbpasswd -a -s Administrator 


Status
colourRed
title

Code Block
JT_VIP=10.1.1.100

Code Block
# Configure using a file jtel_cluster_config cd pcs cluster cib jtel_cluster_config # DRBD Primary Secondary pcs -f jtel_cluster_config resource create DRBDClusterMount ocf:linbit:drbd drbd_resource=jtelshared op monitor interval=60s pcs -f jtel_cluster_config resource promotable DRBDClusterMount promoted-max=1 promoted-node-max=1 clone-max=2 clone-node-max=1 notify=true # DRBD File System Mount pcs -f jtel_cluster_config resource create DRBDClusterFilesystem ocf:heartbeat:Filesystem device="/dev/drbd/by-res/jtelshared/0" directory="/srv/jtel/shared" fstype="xfs" # Colocation of File System Mount with Primary DRBD instance pcs -f jtel_cluster_config constraint colocation add DRBDClusterFilesystem with DRBDClusterMount-clone INFINITY with-rsc-role=Master # Promote first, then start filesystem pcs -f jtel_cluster_config constraint order promote DRBDClusterMount-clone then start DRBDClusterFilesystem # Resource for Samba pcs -f jtel_cluster_config resource create Samba systemd:smb op monitor interval=30s # Resource for virtual IP pcs -f jtel_cluster_config resource create ClusterIP ocf:heartbeat:IPaddr2 ip=${JT_VIP} cidr_netmask=32 op monitor interval=30s # Samba must be with active DRBD filesystem pcs -f jtel_cluster_config constraint colocation add Samba with DRBDClusterFilesystem INFINITY # Cluster IP must be with Samba pcs -f jtel_cluster_config constraint colocation add ClusterIP with Samba INFINITY # Start DRBD File system then start Samba pcs -f jtel_cluster_config constraint order DRBDClusterFilesystem then Samba # Start Samba then start Cluster IP pcs -f jtel_cluster_config constraint order Samba then ClusterIP

Code Block
# Check the config file pcs -f jtel_cluster_config config

Code Block
# Push the config to the cluster pcs cluster cib-push jtel_cluster_config --config

Code Block
pcs status

Code Block
Cluster name: jtel_cluster Cluster Summary: * Stack: corosync * Current DC: acd-lb1 (version 2.0.3-5.el8_2.1-4b1f869f0f) - partition with quorum * Last updated: Sat Oct 3 12:59:34 2020 * Last change: Sat Oct 3 12:31:22 2020 by root via cibadmin on acd-lb2 * 2 nodes configured * 5 resource instances configured Node List: * Online: [ acd-lb1 acd-lb2 ] Full List of Resources: * Clone Set: DRBDClusterMount-clone [DRBDClusterMount] (promotable): * Masters: [ acd-lb1 ] * Stopped: [ acd-lb2 ] * DRBDClusterFilesystem (ocf::heartbeat:Filesystem): Started acd-lb1 * Samba (systemd:smb): Started acd-lb1 * ClusterIP (ocf::heartbeat:IPaddr2): Started acd-lb1 Daemon Status: corosync: active/enabled pacemaker: active/enabled pcsd: active/enabled

Code Block
pcs node standby acd-lb1 # TEST pcs node unstandby acd-lb1 # TEST pcs node standby acd-lb1 # TEST pcs node unstandby acd-lb1 # TEST 
Code Block
pcs cluster stop acd-lb1 # TEST pcs cluster start acd-lb1 # TEST pcs cluster stop acd-lb2 # TEST pcs cluster start acd-lb2 # TEST