Commit Graph

61 Commits

Author SHA1 Message Date
David Pilato ca45569f0e Adding JUnit test using GCE API Mock 2013-07-08 15:15:41 +02:00
David Pilato 0d40a0e2f9 Trying to Mock GCE API for tests 2013-07-01 23:17:14 +02:00
David Pilato 530ae2169e By default, we don't cache GCE API calls
`refresh_interval` = 0.
2013-07-01 18:13:05 +02:00
David Pilato 1602d82186 Move all discovery process to GceUnicastHostsProvider
We want to be able to rebuild the full list of existing nodes each time we need it so we don't want to have a fixed list of nodes.
2013-07-01 17:56:41 +02:00
David Pilato db86c13a4e Update documentation.
Thanks to @spinscale
2013-06-28 16:29:40 +02:00
David Pilato e734028ae2 Google service account name is not required 2013-06-28 16:27:13 +02:00
David Pilato e3b08e3481 Update documentation.
Thanks to @spinscale
2013-06-28 16:25:19 +02:00
David Pilato 0a088c6a0c Ignore TERMINATED instances
When an instance is removed, its status become `TERMINATED`.
As stated in [GCE Documentation](https://developers.google.com/compute/docs/instances#checkmachinestatus):

> TERMINATED - The instance either failed for some reason or was shutdown. This is a permanent status, and the only way to repair the instance is to delete and recreate it.

So we need to ignore instances with such a status.

Closes #3.
2013-06-28 15:49:18 +02:00
David Pilato 703c2b3e82 Filtering by tags
-----------------

The GCE discovery can also filter machines to include in the cluster based on tags using `discovery.gce.tags` settings.
For example, setting `discovery.gce.tags` to `dev` will only filter instances having a tag set to `dev`. Several tags
set will require all of those tags to be set for the instance to be included.

One practical use for tag filtering is when an GCE cluster contains many nodes that are not running
elasticsearch. In this case (particularly with high ping_timeout values) there is a risk that a new node's discovery
phase will end before it has found the cluster (which will result in it declaring itself master of a new cluster
with the same name - highly undesirable). Adding tag on elasticsearch GCE nodes and then filtering by that
tag will resolve this issue.

Add your tag when building the new instance:

```sh
gcutil --project=es-cloud addinstance myesnode1 --service_account_scope=compute-rw --persistent_boot_disk \
       --tags=elasticsearch,dev
```

Then, define it in `elasticsearch.yml`:

```yaml
  cloud:
      gce:
          project_id: es-cloud
          zone: europe-west1-a
  discovery:
          type: gce
          gce:
                tags: elasticsearch, dev
```
Closes #2.
2013-06-28 15:44:52 +02:00
David Pilato 5e14147991 Add cloud discovery for google compute engine
Google Compute Engine VM discovery allows to use the google APIs to perform automatic discovery (similar to multicast in non hostile
multicast environments). Here is a simple sample configuration:

```yaml
  cloud:
      gce:
          project_id: <your-google-project-id>
          zone: <your-zone>
  discovery:
          type: gce
```

How to start (short story)
--------------------------

* Create Google Compute Engine instance
* Install Elasticsearch
* Install Google Compute Engine Cloud plugin
* Modify `elasticsearch.yml` file
* Start Elasticsearch

Closes #1.
2013-06-28 09:45:02 +02:00
David Pilato 222b36344f Initial commit 2013-06-28 09:22:10 +02:00