vitabaks / postgresql_cluster

PostgreSQL High-Availability Cluster (based on "Patroni" and DCS "etcd" or "consul"). Automating with Ansible.
MIT License
1.29k stars 352 forks source link

Setting HA true switched alma9 from init 3 to init 5 and wiped out ssh keys causing man in the middle banner and failure #630

Closed dtdionne closed 1 month ago

dtdionne commented 1 month ago

I don't have any idea how any of this happened. And again, im new so please extend some grace :)

The first try failed trying to change selinux so i just disabled selinux on all hosts and re-ran from scratch. That's when the "PLAY [deploy_pgcluster.yml | PostgreSQL Cluster Deployment ** TASK [Gathering Facts] **

tripped over a "(man-in-the-middle attack)!" banner from the cluster manager. So i switched to the vm console and it was running xwindows! All of which i find fascinating.

I grep'd the app for init, inittab, graphical.TARGET and have begun looking around try and figure out how any of this might have happened. Havent spotted anything yet and again, this is all new to me. Regarding ssh, I suppose the playbook could just created new ssh keys over the old but idk why that would be desirable.

Thanks

vitabaks commented 1 month ago

terrible things are happening in your infrastructure) I haven't figured out exactly how I can help you yet.

dtdionne commented 1 month ago

HAAAHAHA! I like witty, sassy humor :)

I think i know what happened. I need to add another host just for HA, I think the way i have it now, the HA host was also "scheduled to be a DB cluster host" and HA did it's thing with ssh. Although that wouldn't explain seeing xwindows on the console. But it's easy to snap back and try again. I'll add another vm for ha and change the inventory to what i think it should be.

dtdionne commented 1 month ago

And I just had a power outage, wonderful. I’m doing all this for my tiny little startup business. Trying to build a little datacenter in a box so I can scale more easily if I don’t fail at my little business…which is bass fishing accessories.

Thanks for ur help, hard work and graciousness.

dtdionne commented 1 month ago

Yeah I think it’s HA. If HA is configured to balance everything, which it appears so, how is ssh supposed to work without an ooba network?

dtdionne commented 1 month ago

My little cluster keeps growing, started with 3 and now it’s 7, well 6. I’ve got a dedicated vitabaks deployment box 3 balancers and 3 patroni. I suspect that I can’t deploy with HA from a box that’s participating in an aspect of the cluster. It’s running now. I’ll walk back in and check it in a min.

dtdionne commented 1 month ago

Nope, no joy. I can’t believe this doesn’t work so I must have something wrong in the config. I might also try with actual rhel. It’s been awhile but maybe they have have a way to get it and it seems much of this great work may work better with rhel.

dtdionne commented 1 month ago

I think I got it :)

user error again, vip address can’t be in use by a host. I’ll keep forging ahead. I saw that open issue about creating a CM interface. That’s a great idea.

Again, thank you so much.