can you setup a fail over for say Homeassistant like 2 Ips 1 domain name?
-
@viragomann i did have both Active and backup of the ip address in Backend and you said that was wrong so i deleted the active
as you seen in the pic i had both and then you bolded that i needed a single backend so the way you sounded i had to erase the active one
-
@comet424
Your very first screenshot above shows both server as active. So I advised you@viragomann said in can you setup a fail over for say Homeassistant like 2 Ips 1 domain name?:
So you should set the backup server as backup type in the backend.
-
@viragomann
dont remember i talking about the picture right above your reply thats where it says Active and backup and when i read your message i then deleted the active imageviragomann
33 minutes ago@viragomann
Please slow down and follow the suggestions.
I told you to simply edit the backup server in the backend and change the type to "backup". You need a single backend.but ok so i put it back in i set it the way its in the pic... im sure i not done what else do i need to edit?
-
so i tried to see if it works
by trying http://homeassistant:8123 that didnt work
i tried the name home_assistant:8123i tried
192.168.0.1:8123 that didnt work eitheri did try changing the Listening interface from Localhost to LAN
so it set it to
192.168.0.1:8123now when i accessed that i got a 503 server error... but still couldnt access http://homeassistant to access the backup server
or by the 192.168.0.1 pfsense boxas i turned off the main home assitant... but ill keep playing around too.. trial and error (:
i also checked off the box use forwarder.. i not sure if you need that checked off or not
-
@comet424
Seems you're going on doing try and fail.by trying http://homeassistant:8123 that didnt work
i tried the name home_assistant:8123Is the client able to resolve these host names to pfSense? You've probably to update your DNS accordingly.
i did try changing the Listening interface from Localhost to LAN
so it set it to
192.168.0.1:8123Localhost only makes sense if you forward the packets on the incoming interface port 8123 to it.
Otherwise let HAproxy listen on the interface address.now when i accessed that i got a 503 server error... but still couldnt access http://homeassistant to access the backup server
or by the 192.168.0.1 pfsense boxIf you look in the HAproxy stats, are the backends shown as online at all?
Maybe we can get a step beyond, when you provide some more details about your network and the HAproxy settings.
-
We did a hangout covering HAProxy. It's old but the concepts are still valid: https://www.youtube.com/watch?v=FJSHMyrd29E
-
ok ill check out that video now
@viragomann
ah i tried a bit and failed...as for accessing
http://homeassistant:8123
ya all computers can access that and then i labled the 2nd home assistant homeassistant2:8123
the home_assistant:8123 that didnt work from using the name i was trying to understand it.. i was trying to find a video for dummies to explain it better what each one ment and explain it like those yellow dummies books
so in one of the videos i watched they set the forward listen to LAN not localhost.. but i can change it to local host
so my network is
Lan 192.168.0.0
Cameras 192.168.10.0
IoT 192.168.20.0
Dmz 192.168.40.0home assistant has an ip for all the networks
192.168.0.12
192.168.10.12
192.168.20.12
192.168.40.12all linked to the first one..
the backup home assistant is just on 192.168.0.10 i working on it later for bridging
the stats show red so i guessing it cant connect
so currently this is what i got.. so i wont change it so you know what i have at this moment
and i added a dns server to the settings page i do not know if i needed to or not
and it takes me time with my dislexia and learning disabilitty i need to read things sometimes 10 times to try to understand things.. sorry if i go to fast or too slow or miss stuff
-
@comet424 said in can you setup a fail over for say Homeassistant like 2 Ips 1 domain name?:
the stats show red so i guessing it cant connect
No, it just says that the health check failed.
HAproxy does health checking to determine if a backend server is alive. If the check is failing he sends no packets to it. Since both of yours are failing, it doesn't work.
There different methods of health checking you can set in the backend. At least "basic" should work. It only tries a TCP connection to the backend server. So try this.
and i added a dns server to the settings page i do not know if i needed to or not
I never set this. And for my understanding it is only useful if you state host names instead of IPs for the backend servers.
-
@viragomann
ah ok i set it to basic and did screen shot of statsand ok i can delete the dns part...
-
and here is my firewall rules id you need those too
-
i did try changing the Listening interface from Localhost to LAN
so it set it to
192.168.0.1:8123now when i accessed that i got a 503 server error...
This error should be gone now, I think, if you set it up the same way again.
But maybe you have still an issue with the name resolution.
You mentioned different host names in the past. I'm not sure, which are you really need on the client to access the home assistant server. But you should point this to pfSense. -
ya that error is gone.. and just the other error now
Hmmm… can't reach this page192.168.0.1 took too long to respond Try: Search the web for 192 168 0 1 Checking the connection Checking the proxy and the firewall Running Windows Network Diagnostics
thats trying to access home assistant now at 192.168.0.1:8123
well ya i did 2 different host names just to
and ya like
the actual host name for the main home assistant
is
homeassistantthe backup is just homeassistant2
but in the backend under name
i did homeassistant_main for homeassistant
and homeassistant_backup for homeassistant2now if naming issues is a problem should the be both named homeassistant ?
or how you do itor would it be better say
http://home.8123
and it points to
homeassistant:8123 (main)
homeassistant2:8123 (backup)like i just learning i just trying i thought a dns resolver and u use domain name home and i pointed it to both servers like host overrides.. but that didnt seem to work right so i scrappped that..
sorry if my explaining sucks it seems ok in my head but when i explain it doesnt always sound right for others
-
if possible if you can make example screen shots i could enter in as ia visual learner that would help then id enter it the way it should be.. and then youd know exactly how it should look
if possible -
@comet424 said in can you setup a fail over for say Homeassistant like 2 Ips 1 domain name?:
thats trying to access home assistant now at 192.168.0.1:8123
No way if the frontend is listening on localhost!
We talked about this multiple times. You saw somewhere in a YT video that it was listening on localhost and fall back into this, despite I told you that this would require a forward to localhost.
You can do this if you need to access the frontend from multiple network segments. But you would need to set the port forwardings, otherwise you won't succeed.
However, I recommend to set the frontend to listen on the LAN address. This is also easier for the name resolution.the actual host name for the main home assistant is homeassistant
the backup is just homeassistant2
but in the backend under name i did homeassistant_main for homeassistant and homeassistant_backup for homeassistant2We are not talking about the real servers here, it is the name you want to use to access the home assistant via HAproxy.
I guess, this should be homeassistant. So go into your DNS settings and point it to pfSense LAN IP. -
@viragomann
ya the youtube video doesnt use localhost.. they change from WAN to LAN they say to use LAN for frontend they never talk about using localhostya i had it set to LAN thats where you get the 503 error
but ok ill re add the dns setting to point to 192.168.0.1 and 53 as the port right?
and i dont know what you mean a forward to localhost..
like i say i need pictures screen shots words dont always help me if dont understand what im visually seeing
but ill keep looking.. sorry not fast realizer im just a visual learning and detail explaination of each field to someone that is learning in school say..
i do appreciate the help so far.. thats why i asked for screen shots of what should i have in the fields
-
@comet424 said in can you setup a fail over for say Homeassistant like 2 Ips 1 domain name?:
but ok ill re add the dns setting to point to 192.168.0.1 and 53 as the port right?
This was a DNS server setting in HAproxy. No, not there. I was talking about your local DNS server.
You say, homeassistant is resolved to the main server in your local network. So you're running a local DNS server and have set an override for this name, I guess. Or how does this work?
Probably you're running the DNS Resolver on pfSense for DNS resolution.
If so go to the Resolver page and update the host override entry and point it to the LAN IP.BTW: "homeassistant" is not a really proper host name. You should attach a domain to it. E.g. "homeassistant.home". So home would be your local domain.
You don't need port forwardings, but you would need to allow access to the LAN IP on the other interfaces if you want to allow access to the home assistant from connected devices.
I cannot provide screenshots, I haven't HAproxy installed at home.
-
@viragomann
so how my home assistant works ispfsense === >dhcp ===> (main server)unraid server(HA VM) gets 192.168.0.12 and has the hostname homeassistant inside the software
pfsense === >dhcp ===> (backup server)unraid server(HA VM) gets 192.168.0.10 and has the hostname homeassistant2 inside the softwarei dont do host override etc
and thats how i access home assistant
http://192.168.0.12:8123 or http://homeassistant:8123ok i set the host over ride to homeassistant.home in the dns resolver