Closed tamer-hassan closed 5 years ago
While following the waves of log lines in /var/log/cluster/corosync.log , I noticed an interesting warning, because the hostname was truncated ("prometheus" instead of "prometheus-dev01" or "-dev02")
pgsqlms(postgres)[21947]: Feb 13 02:44:32 WARNING: "prometheus" is not connected to the primary
Traced it down to the regex pattern line in "sub _get_all_cluster_nodes", particularly this one: https://github.com/YanChii/ansible-role-postgres-ha/blob/master/files/pgsqlms-2.2.1-geo-patched#L843
$_ =~ m/\d\s([a-zA-Z0-9_]+).*$/;
Underscore is not valid char in hostnames, so I removed the underscore, and added the missing dot "." and dash "-" , since hostnames can also have dashes or dots; "example-host.name.com" :) so the correct line of code would look like:
$_ =~ m/\d\s([a-zA-Z0-9\-\.]+).*$/;
reran playbook on clean VMs and problem solved.
Thank you @tamer-hassan! I didn't catch this one. Fixed in master. Jan
on fresh run on CentOS 7.
If I managed to catch the log from the start (as soon as the db data is initialized on master)