Skip to content

Commit 4f11862

Browse files
committed
Update to GCE API 1.17.0-rc
Seen in #9, Google changed its APIs. We need to update as it previous version causes a `404` error. Closes #12. Closes #9.
1 parent b065179 commit 4f11862

File tree

4 files changed

+40
-21
lines changed

4 files changed

+40
-21
lines changed

README.md

+20-18
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ The GCE Cloud plugin allows to use GCE API for the unicast discovery mechanism.
55

66
In order to install the plugin, simply run: `bin/plugin -install elasticsearch/elasticsearch-cloud-gce/2.0.0.RC1`.
77

8-
| GCE Cloud Plugin | elasticsearch | Release date |
9-
|----------------------------|---------------------|:------------:|
10-
| 2.0.0-SNAPSHOT (master) | 1.0.0.RC1 -> master | |
11-
| 2.0.0.RC1 | 1.0.0.RC1 -> master | 2014-01-15 |
12-
| 1.2.0-SNAPSHOT (1.x) | 0.90.3 -> 0.90 | |
13-
| 1.1.0 | 0.90.3 -> 0.90 | 2013-08-09 |
14-
| 1.0.0 | 0.90.0 -> 0.90.2 | 2013-07-23 |
8+
| GCE Cloud Plugin | elasticsearch | gce api | Release date |
9+
|----------------------------|---------------------|--------------|:------------:|
10+
| 2.0.0-SNAPSHOT (master) | 1.0.0.RC1 -> master | 1.17.0-rc | |
11+
| 2.0.0.RC1 | 1.0.0.RC1 -> master | 1.15.0-rc | 2014-01-15 |
12+
| 1.2.0-SNAPSHOT (1.x) | 0.90.3 -> 0.90 | 1.17.0-rc | |
13+
| 1.1.0 | 0.90.3 -> 0.90 | 1.15.0-rc | 2013-08-09 |
14+
| 1.0.0 | 0.90.0 -> 0.90.2 | 1.15.0-rc | 2013-07-23 |
1515

1616

1717
Google Compute Engine Virtual Machine Discovery
@@ -98,13 +98,13 @@ sudo apt-get update
9898
sudo apt-get install curl
9999
100100
# Download Elasticsearch
101-
curl https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.2.deb -o elasticsearch-0.90.2.deb
101+
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.0.0.RC1.deb
102102
103103
# Prepare Java installation
104104
sudo apt-get install java7-runtime-headless
105105
106106
# Prepare Elasticsearch installation
107-
sudo dpkg -i elasticsearch-0.90.2.deb
107+
sudo dpkg -i elasticsearch-1.0.0.RC1.deb
108108
109109
# Check that elasticsearch is running:
110110
curl http://localhost:9200/
@@ -116,10 +116,13 @@ This command should give you a JSON result:
116116
{
117117
"ok" : true,
118118
"status" : 200,
119-
"name" : "Lunatica",
119+
"name" : "Shriker",
120120
"version" : {
121-
"number" : "0.90.2",
122-
"snapshot_build" : false
121+
"number" : "1.0.0.RC1",
122+
"build_hash" : "0a5781f44876e8d1c30b6360628d59cb2a7a2bbb",
123+
"build_timestamp" : "2014-01-10T10:18:37Z",
124+
"build_snapshot" : false,
125+
"lucene_version" : "4.6"
123126
},
124127
"tagline" : "You Know, for Search"
125128
}
@@ -131,8 +134,7 @@ Install the plugin:
131134

132135
```sh
133136
# Use Plugin Manager to install it
134-
sudo /usr/share/elasticsearch/bin/plugin
135-
--install elasticsearch/elasticsearch-cloud-gce/1.1.0
137+
sudo /usr/share/elasticsearch/bin/plugin --install elasticsearch/elasticsearch-cloud-gce/2.0.0.RC1
136138
137139
# Configure it:
138140
sudo vi /etc/elasticsearch/elasticsearch.yml
@@ -206,7 +208,7 @@ gcutil listkernels --project es-cloud
206208
| projects/google/global/kernels/gce-v20130603 | SCSI-enabled 3.3.8-gcg built 2013-05-29 01:04:00 | |
207209
+----------------------------------------------+--------------------------------------------------+-------------+
208210
# Note the kernel you prefer to use and add your image to your catalog:
209-
gcutil --project=es-cloud addimage elasticsearch-0-90-2 \
211+
gcutil --project=es-cloud addimage elasticsearch-1-0-0-RC1 \
210212
gs://esimage/e4686d7f5bf904a924ae0cfeb58d0827c6d5b966.image.tar.gz \
211213
--preferred_kernel=projects/google/global/kernels/gce-v20130603
212214

@@ -220,7 +222,7 @@ As you have now an image, you can create as many instances as you need:
220222

221223
```sh
222224
# Just change node name (here myesnode2)
223-
gcutil --project=es-cloud addinstance --image=elasticsearch-0-90-2 \
225+
gcutil --project=es-cloud addinstance --image=elasticsearch-1-0-0-RC1 \
224226
--kernel=projects/google/global/kernels/gce-v20130603 myesnode2 \
225227
--zone europe-west1-a --machine_type f1-micro --service_account_scope=compute-rw \
226228
--persistent_boot_disk
@@ -293,7 +295,7 @@ gcutil --project=es-cloud addinstance myesnode1 \
293295
--metadata=es_port:9301
294296
295297
# when creating an instance from an image
296-
gcutil --project=es-cloud addinstance --image=elasticsearch-0-90-2 \
298+
gcutil --project=es-cloud addinstance --image=elasticsearch-1-0-0-RC1 \
297299
--kernel=projects/google/global/kernels/gce-v20130603 myesnode2 \
298300
--zone europe-west1-a --machine_type f1-micro --service_account_scope=compute-rw \
299301
--persistent_boot_disk --metadata=es_port:9301
@@ -340,7 +342,7 @@ License
340342

341343
This software is licensed under the Apache 2 license, quoted below.
342344

343-
Copyright 2009-2013 ElasticSearch <http://www.elasticsearch.org>
345+
Copyright 2009-2014 Elasticsearch <http://www.elasticsearch.org>
344346

345347
Licensed under the Apache License, Version 2.0 (the "License"); you may not
346348
use this file except in compliance with the License. You may obtain a copy of

pom.xml

+14-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ governing permissions and limitations under the License. -->
4848

4949
<properties>
5050
<elasticsearch.version>1.0.0.RC1</elasticsearch.version>
51-
<google.gce.version>v1beta15-rev3-1.15.0-rc</google.gce.version>
52-
<google.api.version>1.15.0-rc</google.api.version>
51+
<google.gce.version>v1beta16-rev1-1.17.0-rc</google.gce.version>
52+
<google.api.version>1.17.0-rc</google.api.version>
5353
<lucene.version>4.6.0</lucene.version>
5454
<tests.jvms>1</tests.jvms>
5555
<tests.shuffle>true</tests.shuffle>
@@ -109,6 +109,18 @@ governing permissions and limitations under the License. -->
109109
<type>test-jar</type>
110110
<scope>test</scope>
111111
</dependency>
112+
<dependency>
113+
<groupId>org.hamcrest</groupId>
114+
<artifactId>hamcrest-core</artifactId>
115+
<version>1.3.RC2</version>
116+
<scope>test</scope>
117+
</dependency>
118+
<dependency>
119+
<groupId>org.hamcrest</groupId>
120+
<artifactId>hamcrest-library</artifactId>
121+
<version>1.3.RC2</version>
122+
<scope>test</scope>
123+
</dependency>
112124

113125
</dependencies>
114126

src/main/java/org/elasticsearch/discovery/gce/GceUnicastHostsProvider.java

+5
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,11 @@ public List<DiscoveryNode> buildDynamicNodes() {
123123
try {
124124
Collection<Instance> instances = gceComputeService.instances();
125125

126+
if (instances == null) {
127+
logger.trace("no instance found for project [{}], zone [{}].", this.project, this.zone);
128+
return cachedDiscoNodes;
129+
}
130+
126131
for (Instance instance : instances) {
127132
String name = instance.getName();
128133
String type = instance.getMachineType();

src/test/resources/log4j.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8" ?>
2-
<!-- Licensed to ElasticSearch under one or more contributor
2+
<!-- Licensed to Elasticsearch under one or more contributor
33
license agreements. See the NOTICE file distributed with this work for additional
44
information regarding copyright ownership. ElasticSearch licenses this file to you
55
under the Apache License, Version 2.0 (the "License"); you may not use this

0 commit comments

Comments
 (0)