Author Topic: Zentyal 4 HA  (Read 907 times)

Gilberto Ferreira

  • Zen Hero
  • *****
  • Posts: 516
  • Karma: +12/-1
    • View Profile
Zentyal 4 HA
« on: November 06, 2019, 12:53:35 pm »
Hi there

I have set two servers, working with HA and so far so good... I have tested powered off one server and the secondary server got the IP and DHCP services...  But, when secondary server assume this services, I needed to restart samba manually, in order to get backup folders shares work properly. So my question is, how can I set samba into HA service like ip or dhcp does, in order to samba restart automatic when primary server gone away?
I also tryied to use hooks scripts but when do so, the DHCP return fail status in crm_mon 1

Thanks for any kind of help!
« Last Edit: November 06, 2019, 01:16:23 pm by Gilberto Ferreira »

Gilberto Ferreira

  • Zen Hero
  • *****
  • Posts: 516
  • Karma: +12/-1
    • View Profile
Re: Zentyal 4 HA
« Reply #1 on: November 07, 2019, 12:59:37 pm »
I managed to solved this issue, creating the script bellow:

#!/bin/bash


statusip=$(crm_mon -1 | grep IPHALOCAL | grep servidor2)

status="$?"

echo $status

if [[ $status -eq 1 ]]
then
 echo "That's great :-)"
elif [[ $status -eq 0 ]]
then
 echo "(exit status=$status)"
/etc/init.d/samba force-reload
fi

And add to crontab, to run every minute...

« Last Edit: November 07, 2019, 01:06:10 pm by Gilberto Ferreira »