mkdir /srv/jtel
mkdir
chown -R jtel:jtel /srv/jtel
drbdadm primary jtelshared
mount/test.txt
umount /srv/jtel/shared |
|
Install Samba and lsof (Both Nodes)| Translations Ignore |
|---|
| Code Block |
|---|
| yum -y install samba samba-client lsof |
|
| Translations Ignore |
|---|
| Code Block |
|---|
| cat <<EOFF > /etc/samba/smb.conf
[global]
workgroup = SAMBA
security = user
passdb backend = tdbsam
printing = cups
printcap name = cups
load printers = yes
cups options = raw
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$]
comment = Printer Drivers
path = /var/lib/samba/drivers
write list = root
create mask = 0664
directory mask = 0775
[shared]
comment = jtel ACD Shared Directory
read only = no
public = yes
writable = yes
locking = yes
path = /srv/jtel/shared
guest ok = yes
create mask = 0644
directory mask = 0755
force user = jtel
force group = jtel
acl allow execute |
| always = True
EOFF
sed -i -e "s/MYGROUP/WORKGROUP/g" /etc/samba/smb.conf
Setup SeLinux, jtel User access and Firewall for Samba (Both Nodes)Replace <password> with the actual password for the jtel user: | Translations Ignore |
|---|
| Code Block |
|---|
| title | SeLinux, 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 ' |
| fireballnfireballn<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
firewall-cmd --reload |
|
If necessary, add further users to samba: | Translations Ignore |
|---|
| Code Block |
|---|
| useradd -m Administrator
printf 'F1r3B²11\nF1r3B²11\n' | smbpasswd -a -s Administrator
|
|
Test SAMBA (Both Nodes)This test should be performed on the node which currently has /srv/jtel/shared mounted: | Translations Ignore |
|---|
| Code Block |
|---|
| mount /srv/jtel/shared
service nmb start
service smb start
# Now check access to the SMB share via (for example) one of the windows machines.
service smb |
| stop
service nmb stop
umount /srv/jtel/shared
# do same again on other node |
|
Unmount and disable SAMBA (Both Nodes)| Translations Ignore |
|---|
| Code Block |
|---|
| service smb stop
|
| service nmb stop
umount /srv/jtel/shared
systemctl disable smb |
|
Install PCS Services (Both Nodes)See Redundancy - Installing PCS Cluster. Setup virtual IP (One Node Only!)Change the following to set the virtual IP which should be shared between the nodes. | Translations Ignore |
|---|
| Code Block |
|---|
| KE_VIP=10.4.8.22 |
|
Configure the PCS resources with the following commands: | Translations Ignore |
|---|
| Code Block |
|---|
| title | Configure 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 follows: | Translations Ignore |
|---|
| Code Block |
|---|
| pcs status
--> shows the status of the newly created resources on both nodes, one node should be active.
Cluster name: portal
Stack: corosync
Current DC: uk-acd-store2 (version 1.1.16-12.el7_4.8-94ff4df) - partition with quorum
Last updated: Mon Mar 19 15:40:24 2018
Last change: Mon Mar 19 15:40:16 2018 by root via cibadmin on uk-acd-store1
2 nodes configured
3 resources configured
Online: [ uk-acd-store1 uk-acd-store2 ]
Full list of resources:
Resource Group: jtel_portal_group
ClusterDataJTELSharedMount (ocf::heartbeat:Filesystem): Started uk-acd-store1
ClusterIP (ocf::heartbeat:IPaddr2): Started uk-acd-store1
samba (systemd:smb): Started uk-acd-store1
Daemon Status:
corosync: active/enabled
pacemaker: active/enabled
pcsd: active/enabled |
|
Test the file mount: | Translations Ignore |
|---|
| Code Block |
|---|
| # From the windows machines:
dir \\uk-acd-store\shared |
|
Test manual failover: | Translations Ignore |
|---|
| Code Block |
|---|
| # Failover to node 2
pcs cluster standby uk-acd-store1
# ... (wait)
pcs status
# Then test the availability of the files from the windows machines.
# Create a new file before failing back (to make sure DRBD working ok).
# Fail back to node 1
pcs cluster unstandby uk-acd-store1
pcs cluster standby uk-acd-store2
# ... (wait)
pcs status
# Then test the availability of the files from the windows machines.
# Check that the new file created above is available.
# Unstandby node 2
pcs cluster unstandby uk-acd-store2 |
|
Manually link /home/jtel/shared (Both Nodes)| Translations Ignore |
|---|
| Code Block |
|---|
| title | link /home/jtel/shared |
|---|
| ln -s /srv/jtel/shared /home/jtel/shared |
|
|