Selects a node by ascending priority, then health. Nodes are grouped by their priority value (lower means higher priority); the first group that contains at least one node currently up is used, and if it holds several up nodes one is picked at random. Lower-priority groups are only used once all higher-priority nodes are down. If no node is up anywhere, it falls back to the first node in priority order. Set each node's priority attribute to control the order.