The correct way to do this is to use the DNS SRV records to look up the domain controller names and ports, as well as ascertain which servers to use in what order. Unfortunately, not many LDAP applications seem to support SRV record lookups.
The SRV record for Active Directory domain controllers is
_ldap._tcp.domain.tld. This will return a list of hosts and ports, as well as a priority and weight for each (these values can be set using Group Policy) that together indicate which server to use.
我还在想这事儿就应该由 MySQL Connector 来实现访问链路的 Failover 和 Loadbalance， 现在有了 DNS SRV 的支持，router 不必和应用端绑定部署，也可以省了 VIP 和负载均衡，MySQL InnoDB Cluster 方案更加完善，配合 consul 等服务发现组件，更容易适配 service mesh 架构。