Samba connections after migration to CentOS 7.6-1810 from 7.3 became slow and unworkable

Issues related to configuring your network
Post Reply
Oso
Posts: 14
Joined: 2014/12/20 03:56:52

Samba connections after migration to CentOS 7.6-1810 from 7.3 became slow and unworkable

Post by Oso » 2019/03/19 09:41:50

I have returned to CentOS 7.3-1611 (latest Samba 4.8.3) and this has resolved my problem below. If anyone else has seen this, I'd be interested to know.

I have been running Samba 4.4.4 on CentOS 7.3-1611 for a couple of years — and before that, CentOS 7.0-1406. Both gave solid reliable performance. Neither machine was ever updated.

However, I've been trying CentOS 7.6-1810 with Samba 4.8.3 for a few days, on a new physical machine and in a VM, using broadly the same smb.conf configuration file from the old CentOS 7.3-1611 machine. Both the physical machine and the VM give identical terrible connection performance from Windows clients. It takes at least 30 seconds to make a connection to it and sometimes it struggles to connect at all. Once connected, Samba appears to work fine. I've more or less carried out the same installation as I've done for previous versions of CentOS, disabling SELinux, then opening the firewall as follows —

# firewall-cmd --permanent --zone=public --add-service=samba

I also see exactly the same slowness on Fedora 27 and on 29, whereas I didn't when I ran Fedora 23. So Fedora and CentOS both show this issue. Note that my older CentOS 7.3-1611 copy which I've just tested, is running the latest Samba 4.8.3 (the same version of Samba that's unsuccessful for me under CentOS 7.6-1810 and therefore might suggest the problem is with CentOS/Fedora and not with Samba).

I have also just installed FreeBSD 12 with Samba 4.6. It worked immediately, no problems whatsoever. In fact it's noticeably quicker to make a Samba connection than I've ever since under Linux. Does anyone have an idea what this might be?
Attachments
SMB_CONF.txt
(737 Bytes) Downloaded 81 times

Oso
Posts: 14
Joined: 2014/12/20 03:56:52

Re: Samba connections after migration to CentOS 7.6-1810 from 7.3 became slow and unworkable

Post by Oso » 2019/03/22 18:26:53

I just thought I'd add a couple of Samba log files, in case anyone else has also experienced unreliability with Samba since moving to CentOS 7.6. As can be seen, the system is going through an endless attempt at a long list of possible protocols before it finally establishes a means of communication with the client, and responds with:— "set_remote_arch: Client arch is 'UNKNOWN'"

The "UNKNOWN" is simply a Windows Server 2016 client machine. It shouldn't be that difficult I wouldn't have thought. Unfortunately this takes ages to establish — close on a minute, so it's unusable in a working environment. It used to work fine with CentOS 7.3 and earlier.

We've now moved to FreeBSD instead and the connection with Samba is now instantaneous. I don't really want to drop CentOS, but I've proved this is a problem since CentOS 7.6 and other platforms running the same version of Samba, don't cause the same issue. Any ideas?

Oso
Posts: 14
Joined: 2014/12/20 03:56:52

Re: Samba connections after migration to CentOS 7.6-1810 from 7.3 became slow and unworkable

Post by Oso » 2019/03/22 20:32:22

I have resolved this, finally, and post my answer, in the hope it might save others from struggling.

The reason, it appears, is that in CentOS 7.6, the /etc/hosts file must be modified in order to work. Despite the fact that during installation, I specified my host name and domain (and they appeared correctly from a "uname -a" query) the /etc/hosts contained the below and these appear to stop Samba from working successfully.

vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

I changed this to reflect the following:

127.0.0.1 centos7test centos7test.mydomain
::1 centos7test centos7test.mydomain

# uname -a
Linux centos7test.mydomain[/b] 3.10.0-957.el7.x86_64 #1 SMP Thu Nov 8 23:39:32 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Earlier platforms such as CentOS 7.3, do not require this /etc/hosts change.

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Samba connections after migration to CentOS 7.6-1810 from 7.3 became slow and unworkable

Post by TrevorH » 2019/03/22 21:09:04

Your hosts file was correct before you changed it.

What happens if you change it back to how it was then add lines to it to point to you the actual ip address of the machine itself - e.g.

192.168.1.2 centos7test.mydomain centos7test

(assuming 192.168.1.2 is the ip of the problem machine).
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Oso
Posts: 14
Joined: 2014/12/20 03:56:52

Re: Samba connections after migration to CentOS 7.6-1810 from 7.3 became slow and unworkable

Post by Oso » 2019/03/23 17:07:51

Many thanks for the reply, that's interesting. Yes, it works perfectly (and connects quickly) if I restore the machine's original /etc/hosts and then add the local machine's name and domain as you said:

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.0.123 centos7test.mydomain centos7test

It also continued to work fine if I replace 192.168.0.123 with 127.0.0.1

To be certain, I then removed the host 192.168.0.123, rebooted and found the connection problem immediately returned. I made the same change to another test machine running Fedora 27 that had showed the same issue and it resolved that too.

I also checked my earlier CentOS 7.3 machine. That machine connects like lightening, no problems at all, and it's /etc/hosts file is just original:

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

In other words, CentOS 7.3 works fine with the above original /etc/hosts, whereas CentOS 7.6 requires the local machine's name. Similarly, Fedora 23 worked fine as I recall (a couple of years ago) but Fedora 27 doesn't work without the addition. I think I experienced a long delay yesterday when I executed hostname, but in the midst of confusion I can't recall if that's so. Just an idea anyway - the two findings might be linked.

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Samba connections after migration to CentOS 7.6-1810 from 7.3 became slow and unworkable

Post by TrevorH » 2019/03/23 17:46:58

Check your machine name is registered in dns somewhere, failing that then /etc/hosts is the next best stop.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Oso
Posts: 14
Joined: 2014/12/20 03:56:52

Re: Samba connections after migration to CentOS 7.6-1810 from 7.3 became slow and unworkable

Post by Oso » 2019/03/23 18:49:44

Thanks. I've just found something interesting though.

If /etc/host contains...
127.0.0.1 centos7test.mydomain centos7test

... then a DNS name enquiry with # hostname -d returns nothing, even though # uname -a gives the full host and domain.

But if I set this to the machine's IP, exactly as you mentioned
192.168.0.114 centos7test.mydomain centos7test

... then # hostname -d correctly returns
mydomain

It seems that setting up /etc/hosts is essential.

Post Reply