Occasional Contributor

I have a task that does x and it runs fine from server01. I have server01 and server02 in a load balancer. I need to be able to remove server01 from the load balancer and the tasks that was running on server01 to now run from server02. How do I make them aware of one another so that it only runs once from a server and not from both. 

Anything ... anyone