# Google Cloud discovery not working

**URL:** <https://discuss.elastic.co/t/google-cloud-discovery-not-working/260871>\
**Category:** Elasticsearch\
**Created:** [January 12, 2021, 4:49pm UTC](https://discuss.elastic.co/t/google-cloud-discovery-not-working/260871 "2021-01-12T16:49:43Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mark\_Pevec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_pevec/32/82110_2.png) [@Mark\_Pevec](https://discuss.elastic.co/u/Mark_Pevec)\
**Post date:** [January 12, 2021, 4:49pm UTC](https://discuss.elastic.co/t/google-cloud-discovery-not-working/260871/1 "2021-01-12T16:49:43Z")

</div>

Has anyone ever successfully used the Google Cloud discovery plugin successfully? After testing and debugging for a week I can't get it working.

I am using the latest 7.x release (installed on debian-10 following all the setup/configuration instructions)

my elasticsearch.yml file:

```auto
path:
  data: /var/lib/elasticsearch
  logs: /var/log/elasticsearch
cloud:
  gce:
    project_id: my-project-id
    zone: ["us-east1-b", "us-east1-c", "us-east1-d"]
discovery:
  seed_providers: gce
  gce:
    tags: elasticsearch # this tag should be set on the ES instances
node:
  name: ${HOSTNAME}
cluster:
  name: search
  initial_master_nodes:
    - search-node-1
network:
  host: ["_gce_", "_local_"]
http:
  port: 9200
transport:
  port: 9300

```

When I try to create a 3 node cluster (each node has the elasticsearch tag as specified) with one node in each zone (node hostnames search-node-1, search-node-2, search-node-3 all with this same config file, all in separate us-east1 zones matching the configuraiton) it always comes up as 3 separate clusters (each one being its own master). I have verified the networking config (routes and firewall rules) and they are all reachable from each other over 9300

I also have enabled and correctly configured logging, but there are no discovery logs indicating success or error (nothing aside from this log:

```auto
[2021-01-12T16:20:49,102][INFO][o.e.c.g.GceInstancesServiceImpl] [search-node-1] starting GCE discovery service

```

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [January 12, 2021, 4:52pm UTC](https://discuss.elastic.co/t/google-cloud-discovery-not-working/260871/2 "2021-01-12T16:52:11Z")

</div>

Hello again! 😁

This is a bootstrapping problem, see this NOTE in the docs for the most likely explanation and remedy:

> **[Bootstrapping a cluster | Elasticsearch Reference \[7.10\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery-bootstrap-cluster.html#modules-discovery-bootstrap-cluster-joining)**

---

<div class="post-metadata">

**Author:** ![Mark\_Pevec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_pevec/32/82110_2.png) [@Mark\_Pevec](https://discuss.elastic.co/u/Mark_Pevec)\
**Post date:** [January 12, 2021, 4:56pm UTC](https://discuss.elastic.co/t/google-cloud-discovery-not-working/260871/3 "2021-01-12T16:56:03Z")

</div>

Sorry, could you be more specific? I did read through and follow those instructions. Are you saying I need to set the discovery.seed\_hosts even when using the Google Cloud discovery? If so, what is the point of the discovery?

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [January 12, 2021, 5:01pm UTC](https://discuss.elastic.co/t/google-cloud-discovery-not-working/260871/4 "2021-01-12T17:01:44Z")

</div>

No, `discovery.seed_hosts` is almost completely unrelated to bootstrapping: it's only mentioned once on that page, in the bit that says you have to set _something_ to suppress auto-bootstrapping, but you're setting `discovery.seed_providers` so you're good.

Your bootstrap config has been wrong at some point in the past. Even if it's right now, the original config persists across restarts, so you need to wipe all the nodes and start again.

---

<div class="post-metadata">

**Author:** ![Mark\_Pevec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_pevec/32/82110_2.png) [@Mark\_Pevec](https://discuss.elastic.co/u/Mark_Pevec)\
**Post date:** [January 12, 2021, 5:04pm UTC](https://discuss.elastic.co/t/google-cloud-discovery-not-working/260871/5 "2021-01-12T17:04:43Z")

</div>

I've done that several times. I'm trying to build a baked image with packer. In the baking process I start Elasticsearch on the packer VM to do some preliminary configuration (mainly just set the bulit-in user passwords with elasticsearch-setup-passwords). Are you saying that is impossible with Elasticsearch?

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [January 12, 2021, 5:09pm UTC](https://discuss.elastic.co/t/google-cloud-discovery-not-working/260871/6 "2021-01-12T17:09:45Z")

</div>

Oh I see. It's a pretty unusual way to do these things with a stateful service like Elasticsearch, it probably makes more sense for stateless things. If you really want to do this you'll need to do something like bootstrapping a three-node cluster before the baking process, then bake three separate images for the three nodes.

---

<div class="post-metadata">

**Author:** ![Mark\_Pevec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_pevec/32/82110_2.png) [@Mark\_Pevec](https://discuss.elastic.co/u/Mark_Pevec)\
**Post date:** [January 12, 2021, 5:44pm UTC](https://discuss.elastic.co/t/google-cloud-discovery-not-working/260871/7 "2021-01-12T17:44:12Z")

</div>

I don't agree that baked images are only for stateless workloads (and from what I've seen the entire industry agrees with me on that, in fact there are baked ES images offered in most cloud marketplaces). In any case it seems like I can't do any initialization that requires starting the service during the image baking as it will cause problems with the bootstrapping, so I will move the password setting out. Is there a way to set the elastic user password without using elasticsearch-setup-passwords (can I set it via the file realm or some other way?)

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [January 12, 2021, 5:58pm UTC](https://discuss.elastic.co/t/google-cloud-discovery-not-working/260871/8 "2021-01-12T17:58:26Z")

</div>

> [@Mark\_Pevec](#):
>
> in fact there are baked ES images offered in most cloud marketplaces

AFAIK they're all baked as empty nodes, before bootstrapping, but I should have been more precise that this is what I meant. If you know of any services that are offering images that aren't started afresh then please link them here so we can investigate further - I think that'd be quite a dangerous way to run things.

> [@Mark\_Pevec](#):
>
> Is there a way to set the elastic user password without using elasticsearch-setup-passwords

I don't think so, no, I think setting passwords needs a running cluster.

---

<div class="post-metadata">

**Author:** ![Mark\_Pevec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_pevec/32/82110_2.png) [@Mark\_Pevec](https://discuss.elastic.co/u/Mark_Pevec)\
**Post date:** [January 12, 2021, 6:06pm UTC](https://discuss.elastic.co/t/google-cloud-discovery-not-working/260871/9 "2021-01-12T18:06:03Z")

</div>

I believe you are correct these baked images are probably un-bootstrapped.

It looks like the elastic user can use a new bootstrap password and then the change password API (using the new bootstrap password) as an alternative to using the elasticsearch-setup-passwords  
according to: [https://www.elastic.co/guide/en/elasticsearch/reference/current/built-in-users.html#set-built-in-user-passwords](https://www.elastic.co/guide/en/elasticsearch/reference/current/built-in-users.html#set-built-in-user-passwords)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 9, 2021, 6:06pm UTC](https://discuss.elastic.co/t/google-cloud-discovery-not-working/260871/10 "2021-02-09T18:06:22Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
