# CrateDB does not select a leader

**URL:** https://community.cratedb.com/t/cratedb-does-not-select-a-leader/1610
**Category:** CrateDB
**Tags:** getting-started
**Created:** [September 27, 2023, 7:32am UTC](https://community.cratedb.com/t/cratedb-does-not-select-a-leader/1610 "2023-09-27T07:32:30Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![allardkrings](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/allardkrings/32/1045_2.png) [@allardkrings](https://community.cratedb.com/u/allardkrings)
#### Post date: [September 27, 2023, 7:32am UTC](https://community.cratedb.com/t/cratedb-does-not-select-a-leader/1610/1 "2023-09-27T07:32:30Z")

</div>

Hi,

I am trying to run Crate on my Kubernetes Cluster, followed the example yaml’s from Crate but Crate fails to select a leader.

My cluster:

6 raspberry pi’s running Ubuntu 23  
Microk8s 1.24  
Crate 4.6.4

3 crate-pods are created: `crate-0` `crate-1` and `crate-2`.  
Service running fine, ui available. Shows 1 node.

Log says:

```auto
ClusterFormationFailureHelper] [crate] master not discovered yet, this node has not previously joined a bootstrapped (v4+) cluster, and this node must discover master-eligible nodes [crate-0, crate-1, crate-2] to bootstrap a cluster: have discovered [{crate}{n5vvU2U9Ryme7AqUP4umdw}{pA53ho4NQD2SjdVk29JsuQ}{10.1.178.252}{10.1.178.252:4300}{http_address=10.1.178.252:4200}, {crate}{AWYiQib8QjW-0Hy4fAtaNg}{y3awIuFxQk-hKYMI3uqzdQ}{10.1.127.69}{10.1.127.69:4300}{http_address=10.1.127.69:4200}, {crate}{xJoYtXY2Su-1hgXZYAnA7A}{6I3Bs_YQQIyTpAyiJSBW9A}{10.1.224.4}{10.1.224.4:4300}{http_address=10.1.224.4:4200}]; discovery will continue using [127.0.0.1:4301, 127.0.0.1:4302, 127.0.0.1:4303, 127.0.0.1:4304, 127.0.0.1:4305, [::1]:4301, [::1]:4302, [::1]:4303, [::1]:4304, [::1]:4305, 10.152.183.245:4300] from hosts providers and [{crate}{n5vvU2U9Ryme7AqUP4umdw}{pA53ho4NQD2SjdVk29JsuQ}{10.1.178.252}{10.1.178.252:4300}{http_address=10.1.178.252:4200}] from last-known cluster state; node term 0, last-accepted version 0 in term 0

```

It seems like the nodes are discovered but not recognonized as eligible.

Help appreciated!

Kind regards Allard

---

<div class="post-metadata">

### Author: ![hernanc](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/hernanc/32/676_2.png) [@hernanc](https://community.cratedb.com/u/hernanc)
#### Post date: [September 27, 2023, 7:37am UTC](https://community.cratedb.com/t/cratedb-does-not-select-a-leader/1610/2 "2023-09-27T07:37:49Z")

</div>

Hi,  
From that output it looks as if you would have set `initial_master_nodes` to `crate-0, crate-1, crate-2` but then set `node.name` to `crate` for all nodes? to get `crate-0`, `1`, etc you may want to use `POD_NAME`  
Maybe you could review that and share the YAML you are using if the cluster is still not forming?

---

<div class="post-metadata">

### Author: ![allardkrings](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/allardkrings/32/1045_2.png) [@allardkrings](https://community.cratedb.com/u/allardkrings)
#### Post date: [September 27, 2023, 9:15am UTC](https://community.cratedb.com/t/cratedb-does-not-select-a-leader/1610/3 "2023-09-27T09:15:27Z")

</div>

Hello hernanc,

thanks for your quick response.

I solved the problem by using the examples from the kubernetes-guide.

The problem was caused by outdated examples i found on your site. Maybe a good idea to remove them.

Kind regards!

---

<div class="post-metadata">

### Author: ![hernanc](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/hernanc/32/676_2.png) [@hernanc](https://community.cratedb.com/u/hernanc)
#### Post date: [September 27, 2023, 9:26am UTC](https://community.cratedb.com/t/cratedb-does-not-select-a-leader/1610/4 "2023-09-27T09:26:08Z")

</div>

I am glad that worked and thank you for mentioning this.  
Could you point us to to which examples in particular you found problematic?

---

<div class="post-metadata">

### Author: ![allardkrings](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/allardkrings/32/1045_2.png) [@allardkrings](https://community.cratedb.com/u/allardkrings)
#### Post date: [September 27, 2023, 11:16am UTC](https://community.cratedb.com/t/cratedb-does-not-select-a-leader/1610/5 "2023-09-27T11:16:47Z")

</div>

[How to set up a CrateDB cluster with Kubernetes](https://cratedb.com/blog/how-to-set-up-a-cratedb-cluster-with-kubernetes) uses 4.14 wich didnt work for me

[Run Your First CrateDB Cluster on Kubernetes, Part One](https://cratedb.com/blog/run-your-first-cratedb-cluster-on-kubernetes-part-one) uses 3.13 wich didnt work for me

---

<div class="post-metadata">

### Author: ![amotl](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/amotl/32/617_2.png) [@amotl](https://community.cratedb.com/u/amotl)
#### Post date: [October 6, 2023, 7:00am UTC](https://community.cratedb.com/t/cratedb-does-not-select-a-leader/1610/6 "2023-10-06T07:00:27Z")

</div>

Dear Allard,

> [@allardkrings](#):
>
> The problem was caused by outdated examples i found on your site. Maybe a good idea to remove them.

Thank you for reporting this. We will add corresponding admonitions to the outdated pages, to refer readers to updated content about the relevant topics.

> [@allardkrings](#):
>
> I solved the problem by using the examples from the kubernetes-guide.

May I ask which specific documentation resource you used here, in order to fix the situation?

With kind regards,  
Andreas.

/cc @mkod, @Walter_Behmann
