<p>I have a etcd cluster running on coreOS. The leader was set to the first member I've started (as expected), but I started the wrong one first, so the leader isn't who it's supposed to be.</p>

<p>How do I change the role of a leader to a different member?</p>

<p>To change the leader in the etcd cluster you need to run a command:</p>
<pre><code>etcdctl move-leader id-of-the-node-you-want-to-be-the-leader
</code></pre>
<p>To get <code>id-of-the-node-you-want-to-be-the-leader</code> you need to run a command:</p>
<pre><code>etcdctl endpoint status -w table
</code></pre>
<p>Full example with certificates and endpoints - you must adjust the parameters to your configuration of course. First get the table:</p>
<pre><code>etcdctl endpoint status -w table \
    --cacert=&quot;/ssl/client/ca-client.crt&quot; \
    --cert=&quot;/ssl/client/prod-v1-etcd-node-1-client.crt&quot; \
    --key=&quot;/ssl/client/prod-v1-etcd-node-1-client.key&quot; \
    --endpoints=127.0.0.1:2379,prod-v1-etcd-node-2:2379,prod-v1-etcd-node-3:2379
</code></pre>
<p>...then, change the leader:</p>
<pre><code>etcdctl move-leader 1f648bfb63561530 \
    --cacert=&quot;/ssl/client/ca-client.crt&quot; \
    --cert=&quot;/ssl/client/prod-v1-etcd-node-1-client.crt&quot; \
    --key=&quot;/ssl/client/prod-v1-etcd-node-1-client.key&quot; \
    --endpoints=127.0.0.1:2379,prod-v1-etcd-node-2:2379,prod-v1-etcd-node-3:2379
</code></pre>
