Créer un volume physique, un groupe de volumes et un volume logique LVM (les deux nœuds)Les commandes ci-dessous supposent que /dev/sdb sera utilisé pour le DRBD en plus de la configuration LVM, et que les disques sont EXACTEMENT la même taille. Create LVM Physical Volume, Volume Group and Logical Volume (Both Nodes)The commands below assume that /dev/sdb will be used for the DRBD on top of LVM configuration, and that the disks are EXACTLY the same size. Code Block |
---|
# Create the phsyical volume - this is based on sdb assuming it is the second drive on the system |
# 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 |
| Configure Firewall (Both Nodes)
Translations Ignore |
---|
Prepare thePréparez le pare-feu firewall |
firewall-cmd --zone=public --add-port=7788-7799/tcp -- | permanent
firewallpermanentfirewall-cmd --reload |
| Install
Installer elrepo to à yum (Both Nodes)les deux nœuds) Translations Ignore |
---|
Code Block |
---|
# Install elrepo |
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org |
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm |
| Install and enable
Installer et activer DRBD (Both Nodesles deux nœuds) Translations Ignore |
---|
yum -y install drbd84-utils kmod-drbd84 lsof |
# Enable drbd at boot, and in this session |
| Configure
Both NodesNOTE: The following commands requires the hostname of both machines and the IP Address. These are obtained as follows: NOTE : Les commandes suivantes nécessitent le nom d'hôte des deux machines et l'adresse IP. Ceux-ci sont obtenus comme suit : Create a DRBD config file for jtelshared on
Créer un fichier de configuration DRBD pour jtelshared sur /dev/sdb Translations Ignore |
---|
Code Block |
---|
title | /etc/drbd.d/jtelshared.res |
---|
| # Configure DRBD |
cat <<EOFF > /etc/drbd.d/jtelshared.res |
on acd-store1.jtel.local { |
/dev/vg_drbd_jtelshared/lv_drbd_jtelshared; |
address 10.42.14.98:7789; |
on acd-store2.jtel.local { |
/dev/vg_drbd_jtelshared/lv_drbd_jtelshared; |
address 10.42.14.198:7789; |
}
}
|
Note : it has been observed, that the fully qualified host name is required in the configuration file.il a été observé que le nom d'hôte entièrement qualifié est requis dans le fichier de configuration. Créer des métadonnées et démarrer (les deux nœuds) Code Block |
---|
# Create metadata and start DRBD |
drbdadm create-md jtelshared |
|
Make one node primary (First Node)
Faire un nœud primaire (premier nœud) Translations Ignore |
---|
Code Block |
---|
drbdadm primary jtelshared --force |
| Tune the transfer (Second Node)
Régler le transfert (deuxième nœud) Translations Ignore |
---|
Code Block |
---|
drbdadm disk-options --c-plan-ahead=0 --resync-rate=110M jtelshared |
| Wait for initial sync to complete (Either Node)
Attendre la fin de la synchronisation initiale (l'un ou l'autre des nœuds) Translations Ignore |
---|
When not yet done:
Quand ce n'est pas encore fait: version: 8.4.10-1 (api:1/proto:86-101) |
GIT-hash: a4d5de01fffd7e4cde48a080e2c686f9e8cebf4c build by mockbuild@, 2017-09-15 14:23:22 |
1: cs:SyncTarget ro:Secondary/Primary ds:Inconsistent/UpToDate C r----- |
ns:0 nr:3955712 dw:3950592 dr:0 al:8 bm:0 lo:5 pe:0 ua:5 ap:0 ep:1 wo:f oos:264474588 |
[>....................] sync'ed: |
finish: 2:08:08 speed: 34,388 (25,652) want: 112 | ,
When done:
version Quand c'est fait : version : 8.4.10-1 (api:1/proto:86-101) |
GIT-hash: a4d5de01fffd7e4cde48a080e2c686f9e8cebf4c build by mockbuild@, 2017-09-15 14:23:22 |
1: cs:Connected ro:Secondary/Primary ds:UpToDate/UpToDate C r----- |
ns:0 nr:15626582 dw:284051762 dr:0 al:8 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0 |
| Untune the transfer and make primary
Désaccorder le transfert et faire le primaire (Second Node) Translations Ignore |
---|
Code Block |
---|
drbdadm adjust jtelshared |
drbdadm primary jtelshared |
|
Create filesystem (First Node)
Créer un système de fichiers (premier nœud) Translations Ignore |
---|
Code Block |
---|
mkfs.xfs -L data /dev/drbd/by-res/jtelshared/0 |
|
Create fstab entry for file system (Both Nodes)Add the following line to
Créer une entrée fstab pour le système de fichiers (les deux nœuds)Ajouter la ligne suivante à /etc/fstab Translations Ignore |
---|
Code Block |
---|
/dev/drbd/by-res/jtelshared/0 | xfs noauto,noatime,nodiratime | |
Mount the file system (First Node)
Monter le système de fichiers (premier nœud) Translations Ignore |
---|
Code Block |
---|
mkdir /srv/jtel |
chown -R jtel:jtel /srv/jtel |
| Create a test file and Unmount (First Node)
Créer un fichier test et le démonter (premier nœud) Translations Ignore |
---|
Code Block |
---|
cat <<EOFF > /srv/jtel/shared/test.txt |
| Mount the file system and check the test file
Monter le système de fichiers et vérifier le fichier test (Second Node) Translations Ignore |
---|
Code Block |
---|
mkdir /srv/jtel |
chown -R jtel:jtel /srv/jtel |
cat /srv/jtel/shared/test.txt |
# Check contents of file before proceeding |
rm /srv/jtel/shared/test.txt |
| Install
Installer Samba and et lsof (Both Nodesles deux nœuds) Translations Ignore |
---|
| Install | yum -y install samba samba-client lsof |
| Configure Configurer Samba (les deux nœuds) Both Nodes Translations Ignore |
---|
| Configure | cat <<EOFF > /etc/samba/smb.conf |
workgroup = SAMBA security = user passdb | workgroupSAMBA
tdbsam printing = cups printcap name = cups | security=user
= yes cups options = raw min protocol | passdb backend tdbsam
NT1 ntlm auth = yes [homes] comment | printing cups
Home Directories valid users = %S, %D%w%S browseable | printcap name cups
No read only = No inherit acls = | loadyes
All Printers path = /var/tmp printable = Yes | cupsoptionsraw
min protocol = NT1
ntlm auth = yes
[homes]
comment = Home Directories
valid users = %S, %D%w%S
browseable = No
read only = No
inherit acls = Yes
[printers]
comment = All Printers
path = /var/tmp
printable = Yes
create mask = 0600
browseable = No
[print$]
No [print$] comment = Printer Drivers |
path = /var/lib/samba/drivers |
write list = root
write list = root create mask = 0664 |
comment = jtel ACD Shared Directory |
acl allow execute always = True |
| Setup
Configuration de SeLinux, jtel User access and Firewall for Samba (Both Nodes)Accès utilisateur et pare-feu pour Samba (les deux nœuds)Remplacez <password> par le mot de passe réel de l'utilisateur de jtel : Replace <password> with the actual password for the jtel user: Code Block |
---|
title | SeLinux, utilisateur jtel |
---|
|
| User | Firewall | setsebool -P samba_enable_home_dirs=on samba_export_all_rw=on use_samba_home_dirs=on use_nfs_home_dirs=on |
printf '<password>\n<password>\n' | smbpasswd -a -s jtel |
firewall-cmd --zone=public --add-port=445/tcp --add-port=139/tcp --add-port=138/udp --add-port=137/udp --permanent |
| If necessary, add further users to
Si nécessaire, ajoutez d'autres utilisateurs à samba : Translations Ignore |
---|
| More Plus d'utilisateurs de SAMBA |
|
| users
printf 'F1r3B²11\nF1r3B²11\n' | smbpasswd -a -s Administrator |
| Test
Tester SAMBA (Both Nodesles deux nœuds)This test should be performed on the node which currently has Ce test doit être effectué sur le nœud qui a actuellement /srv/jtel/shared mountedmonté : Translations Ignore |
---|
| Test
# Now check access to the SMB share via (for example) one of the windows machines. |
# do same again on other node |
| Unmount and disable
Démonter et désactiver SAMBA (Both Nodesles deux nœuds) Translations Ignore |
---|
| Unmount
| Install
Installer les services PCS Services (Both Nodesles deux nœuds)See Voir Redundancy - Installing PCS Cluster. Setup virtual (One Node OnlyChange the following to set the virtual IP which should be shared between the nodes. Modifiez les éléments suivants pour définir l'IP virtuel qui doit être partagé entre les nœuds. Translations Ignore |
---|
| Set virtual | Configure
Resources (One Node OnlyConfigure the PCS resources with the following commands: Configurez les ressources PCS à l'aide des commandes suivantes : Translations Ignore |
---|
| Configure Configurer les ressources PCS |
|
| Resources | pcs resource create ClusterDataJTELSharedMount ocf:heartbeat:Filesystem device="/dev/drbd/by-res/jtelshared/0" directory="/srv/jtel/shared" fstype="xfs" --group=jtel_portal_group |
pcs resource create ClusterIP ocf:heartbeat:IPaddr2 ip=${KE_VIP} cidr_netmask=32 op monitor interval=30s --group=jtel_portal_group |
pcs resource create samba systemd:smb op monitor interval=30s --group=jtel_portal_group |
pcs constraint order start ClusterDataJTELSharedMount then ClusterIP |
pcs constraint order start ClusterIP then samba |
|
TestTest as followsTester comme suit : Translations Ignore |
---|
| Test pcs status
showsthestatusofthenewlycreatedresourcesonboth nodesonenodeshouldbeactive
Cluster name
Current DC : uk-acd-store2 (version 1.1.16-12.el7_4.8-94ff4df) - partition | with
Last updated: Mon Dernière mise à jour : Lun 19 Mar | 19
LastchangeMon 19byon
nodesconfigured
resources configured
Online ressources configurées en ligne : [ uk-acd-store1 uk-acd-store2 ] |
Full list of resources:
Resource Group Liste complète des ressources : Groupe de ressources: jtel_portal_group |
ClusterDataJTELSharedMount (ocf::heartbeat:Filesystem): |
ClusterIP ocf::heartbeat:IPaddr2
Started
Daemon Status:
corosync: active/enabled
pacemaker: active/enabled
pcsd: active/enabled | Test the file mount: Statut du démon : corosync : actif/activé pacemaker : actif/activé pcsd : actif/activé |
|
Tester la monture du fichier : Translations Ignore |
---|
| Test file mountTester la monture du fichier |
| # | Fromthe windows
|
Test manual failover:de basculement manuel : Translations Ignore |
---|
| Test file mountTester la monture du fichier |
| # Failover to node 2 |
pcs cluster standby uk-acd-store1 |
# Then test the availability of the files from the windows machines. |
# Create a new file before failing back (to make sure DRBD working ok). |
pcs cluster unstandby uk-acd-store1 |
pcs cluster standby uk-acd-store2 |
# Then test the availability of the files from the windows machines. |
# Check that the new file created above is available. |
pcs cluster unstandby uk-acd-store2 |
| Manually link
Lier manuellement /home/jtel/shared (Both Nodes)les deux nœuds) Translations Ignore |
---|
| link | ln -s /srv/jtel/shared /home/jtel/shared |
|
|