0

I have two cluster nodes server1 and sever2 running on CENTOS7 and I configured DRBD. I have DRBD running on both servers and data is being replicated. The issue is when I perform a test failover the user and group ownership (mysql:mysql) are not consistent when mounted on server2 and this causes MySQL not to start untill the ownership is changed to mysql:msyql manually. please help. Anyone faced this error before?

/proc/drbd server1:

[root@sis1 ~]# cat /proc/drbd
version: 8.4.11-1 (api:1/proto:86-101)
GIT-hash: 66145a308421e9c124ec391a7848ac20203bb03c build by mockbuild@, 2020-04-05 02:58:18
 0: cs:Connected ro:Primary/Secondary ds:UpToDate/UpToDate C r-----
    ns:21101 nr:2070 dw:23171 dr:4377 al:8 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0

/proc/drbd server2:

[root@sis2 ~]# cat /proc/drbd
version: 8.4.11-1 (api:1/proto:86-101)
GIT-hash: 66145a308421e9c124ec391a7848ac20203bb03c build by mockbuild@, 2020-04-05 02:58:18
 0: cs:Connected ro:Secondary/Primary ds:UpToDate/UpToDate C r-----
    ns:2070 nr:21101 dw:23171 dr:2916 al:2 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0
Matt Kereczman
  • 477
  • 4
  • 9
  • 1
    The UID of the mysql user likely needs to be the same on both host. Check that the UID numbers match in the /etc/passwd file. – Dok Jul 21 '21 at 16:24
  • @Dok Thanx lots. the UIDs were different but it was the last thing on my mind. I Just changed UID and GID on server1 to match those in server2 and it worked!! – Honest Phiri Jul 21 '21 at 18:00

1 Answers1

1

As was already determined from the comments in the original post, I suspect that the UID and GID of the mysql user on both host do not match. Thus after a failover the files are owned by the UID of the mysql user on node1, but not the mysql user on node2.

Making sure that the UID and GID of the mysql user (all users ideally) match on both host should avoid this issue.

Dok
  • 411
  • 3
  • 6