From a technical point of view, an elastic bean conductor is an autoscale group, and when you deploy something, you need to assume that your commands can potentially be executed simultaneously in several ec2 instances.
The main goal of leader_only is to make sure that your commands will be executed on only one instance of ec2. This is useful for use: running db migration scripts, creating db, etc., which should only be run once on a single ec2. Thus, leader_only is just a marker that some commands will be executed only in this instance.
However, you need to keep in mind that the leader attribute is set once to create your environment in case the leader died and was replaced by a new situation, when the situation does not arise, if you do not have leaders in the autosave group.
Vadym fedorov
source share