Have you got three separate mqtt broker nodes all pointing to the same broker? Two with localhost and one with the ip address? You should delete two of them and just use one.
What version of mosquitto are you using? V2.x requires access via ip address to be enabled in the config.
sudo apt policy mosquitto