If your Wazuh set up is not working when you switch off the master node, then it is likely that there is a problem with your load balancer configuration.
When you switch off the master node, the load balancer should automatically route traffic to the other node. However, if the load balancer is not configured properly, it may not be able to detect that the master node is down and may continue to route traffic to that node, causing the API to be unavailable.
To troubleshoot this issue, you can check the logs for your load balancer to see if it is properly detecting the master node going down and routing traffic to the other node. You can also check the logs for your Wazuh servers to see if there are any errors related to the API being unavailable.
It is also important to ensure that your load balancer is configured to balance the traffic evenly between your two Wazuh servers. If the load balancer is not configured properly, it may be sending too much traffic to one server and not enough to the other, causing performance issues.
Overall, it is not expected behavior for your Wazuh set up to be unavailable when one node goes down, so there may be an issue with your load balancer configuration that needs to be addressed.