Skip to content

Commit f5b444e

Browse files
committed
Update to elasticsearch 1.3.0
Closes #17.
1 parent 68d6a8a commit f5b444e

9 files changed

+52
-46
lines changed

README.md

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,19 @@ The Azure Cloud plugin allows to use Azure API for the unicast discovery mechani
66
In order to install the plugin, simply run: `bin/plugin -install elasticsearch/elasticsearch-cloud-azure/2.3.0`.
77

88
* For master elasticsearch versions, look at [master branch](https://github.com/elasticsearch/elasticsearch-cloud-azure/tree/master).
9+
* For 1.3.x elasticsearch versions, look at [es-1.3 branch](https://github.com/elasticsearch/elasticsearch-cloud-azure/tree/es-1.3).
910
* For 1.2.x elasticsearch versions, look at [es-1.2 branch](https://github.com/elasticsearch/elasticsearch-cloud-azure/tree/es-1.2).
1011
* For 1.1.x elasticsearch versions, look at [es-1.1 branch](https://github.com/elasticsearch/elasticsearch-cloud-azure/tree/es-1.1).
1112
* For 1.0.x elasticsearch versions, look at [es-1.0 branch](https://github.com/elasticsearch/elasticsearch-cloud-azure/tree/es-1.0).
1213
* For 0.90.x elasticsearch versions, look at [es-0.90 branch](https://github.com/elasticsearch/elasticsearch-cloud-azure/tree/es-0.90).
1314

1415
| Azure Cloud Plugin | elasticsearch | Release date |
1516
|-----------------------------|---------------------|:------------:|
16-
| 2.3.1-SNAPSHOT | 1.2.0 -> 1.2 | XXXX-XX-XX |
17-
| 2.3.0 | 1.2.0 -> 1.2 | 2014-06-19 |
17+
| 2.4.0-SNAPSHOT | 1.3 | XXXX-XX-XX |
1818

1919
Please read documentation relative to the version you are using:
2020

21-
* [2.3.1-SNAPSHOT](https://github.com/elasticsearch/elasticsearch-cloud-azure/blob/es-1.2/README.md)
22-
* [2.3.0](https://github.com/elasticsearch/elasticsearch-cloud-azure/blob/v2.3.0/README.md)
21+
* [2.4.0-SNAPSHOT](https://github.com/elasticsearch/elasticsearch-cloud-azure/blob/es-1.3/README.md)
2322

2423

2524
Azure Virtual Machine Discovery
@@ -29,17 +28,17 @@ Azure VM discovery allows to use the azure APIs to perform automatic discovery (
2928
multicast environments). Here is a simple sample configuration:
3029

3130
```
32-
cloud:
33-
azure:
34-
keystore: /path/to/keystore
35-
password: your_password_for_keystore
36-
subscription_id: your_azure_subscription_id
37-
service_name: your_azure_cloud_service_name
38-
discovery:
39-
type: azure
40-
41-
# recommended
42-
# path.data: /mnt/resource/elasticsearch/data
31+
cloud:
32+
azure:
33+
keystore: /path/to/keystore
34+
password: your_password_for_keystore
35+
subscription_id: your_azure_subscription_id
36+
service_name: your_azure_cloud_service_name
37+
discovery:
38+
type: azure
39+
40+
# recommended
41+
# path.data: /mnt/resource/elasticsearch/data
4342
```
4443

4544
How to start (short story)
@@ -263,17 +262,17 @@ And add the following lines:
263262

264263
```yaml
265264
# If you don't remember your account id, you may get it with `azure account list`
266-
cloud:
267-
azure:
268-
keystore: /home/elasticsearch/azurekeystore.pkcs12
269-
password: your_password_for_keystore
270-
subscription_id: your_azure_subscription_id
271-
service_name: your_azure_cloud_service_name
272-
discovery:
273-
type: azure
265+
cloud:
266+
azure:
267+
keystore: /home/elasticsearch/azurekeystore.pkcs12
268+
password: your_password_for_keystore
269+
subscription_id: your_azure_subscription_id
270+
service_name: your_azure_cloud_service_name
271+
discovery:
272+
type: azure
274273

275274
# Recommended
276-
path.data: /mnt/resource/elasticsearch/data
275+
path.data: /mnt/resource/elasticsearch/data
277276
```
278277
279278
Restart elasticsearch:
@@ -349,10 +348,10 @@ Azure Repository
349348
To enable Azure repositories, you have first to set your azure storage settings:
350349
351350
```
352-
cloud:
353-
azure:
354-
storage_account: your_azure_storage_account
355-
storage_key: your_azure_storage_key
351+
cloud:
352+
azure:
353+
storage_account: your_azure_storage_account
354+
storage_key: your_azure_storage_key
356355
```
357356
358357
The Azure repository supports following settings:
@@ -404,10 +403,10 @@ Integrations tests in this plugin require working Azure configuration and theref
404403
To enable tests prepare a config file elasticsearch.yml with the following content:
405404

406405
```
407-
cloud:
408-
azure:
409-
account: "YOUR-AZURE-STORAGE-NAME"
410-
key: "YOUR-AZURE-STORAGE-KEY"
406+
cloud:
407+
azure:
408+
account: "YOUR-AZURE-STORAGE-NAME"
409+
key: "YOUR-AZURE-STORAGE-KEY"
411410
```
412411

413412
Replaces `account`, `key` with your settings. Please, note that the test will delete all snapshot/restore related files in the specified bucket.

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ governing permissions and limitations under the License. -->
1616
<modelVersion>4.0.0</modelVersion>
1717
<groupId>org.elasticsearch</groupId>
1818
<artifactId>elasticsearch-cloud-azure</artifactId>
19-
<version>2.3.1-SNAPSHOT</version>
19+
<version>2.4.1-SNAPSHOT</version>
2020
<packaging>jar</packaging>
2121
<name>Elasticsearch Azure cloud plugin</name>
2222
<description>The Azure Cloud plugin allows to use Azure API for the unicast discovery mechanism and add Azure storage repositories.</description>
@@ -43,7 +43,7 @@ governing permissions and limitations under the License. -->
4343
</parent>
4444

4545
<properties>
46-
<elasticsearch.version>1.2.1</elasticsearch.version>
46+
<elasticsearch.version>1.3.0-SNAPSHOT</elasticsearch.version>
4747
<lucene.version>4.8.1</lucene.version>
4848
<tests.output>onerror</tests.output>
4949
<tests.shuffle>true</tests.shuffle>

src/test/java/org/elasticsearch/discovery/azure/AbstractAzureComputeServiceTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import org.elasticsearch.cloud.azure.AzureComputeService;
2525
import org.elasticsearch.common.settings.ImmutableSettings;
2626
import org.elasticsearch.common.settings.Settings;
27+
import org.elasticsearch.plugins.PluginsService;
2728

2829
public abstract class AbstractAzureComputeServiceTest extends AbstractAzureTest {
2930

@@ -43,6 +44,7 @@ protected void checkNumberOfNodes(int expected) {
4344

4445
protected Settings settingsBuilder() {
4546
ImmutableSettings.Builder builder = ImmutableSettings.settingsBuilder()
47+
.put("plugins." + PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, true)
4648
.put("discovery.type", "azure")
4749
.put("cloud.azure.api.impl", mock)
4850
// We add a fake subscription_id to start mock compute service

src/test/java/org/elasticsearch/discovery/azure/AzureMinimumMasterNodesTest.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
import org.elasticsearch.test.ElasticsearchIntegrationTest;
2626
import org.junit.Test;
2727

28+
import java.io.IOException;
29+
2830
import static org.hamcrest.Matchers.notNullValue;
2931
import static org.hamcrest.Matchers.nullValue;
3032

@@ -51,21 +53,21 @@ protected final Settings settingsBuilder() {
5153
}
5254

5355
@Test
54-
public void simpleOnlyMasterNodeElection() {
56+
public void simpleOnlyMasterNodeElection() throws IOException {
5557
logger.info("--> start data node / non master node");
56-
cluster().startNode(settingsBuilder());
58+
internalCluster().startNode(settingsBuilder());
5759
try {
5860
assertThat(client().admin().cluster().prepareState().setMasterNodeTimeout("100ms").execute().actionGet().getState().nodes().masterNodeId(), nullValue());
5961
fail("should not be able to find master");
6062
} catch (MasterNotDiscoveredException e) {
6163
// all is well, no master elected
6264
}
6365
logger.info("--> start another node");
64-
cluster().startNode(settingsBuilder());
66+
internalCluster().startNode(settingsBuilder());
6567
assertThat(client().admin().cluster().prepareState().setMasterNodeTimeout("1s").execute().actionGet().getState().nodes().masterNodeId(), notNullValue());
6668

6769
logger.info("--> stop master node");
68-
cluster().stopCurrentMasterNode();
70+
internalCluster().stopCurrentMasterNode();
6971

7072
try {
7173
assertThat(client().admin().cluster().prepareState().setMasterNodeTimeout("1s").execute().actionGet().getState().nodes().masterNodeId(), nullValue());
@@ -75,7 +77,7 @@ public void simpleOnlyMasterNodeElection() {
7577
}
7678

7779
logger.info("--> start another node");
78-
cluster().startNode(settingsBuilder());
80+
internalCluster().startNode(settingsBuilder());
7981
assertThat(client().admin().cluster().prepareState().setMasterNodeTimeout("1s").execute().actionGet().getState().nodes().masterNodeId(), notNullValue());
8082
}
8183
}

src/test/java/org/elasticsearch/discovery/azure/AzureSimpleTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public AzureSimpleTest() {
3737
@Test
3838
public void one_node_should_run() {
3939
logger.info("--> start one node");
40-
cluster().startNode(settingsBuilder());
40+
internalCluster().startNode(settingsBuilder());
4141
assertThat(client().admin().cluster().prepareState().setMasterNodeTimeout("1s").execute().actionGet().getState().nodes().masterNodeId(), notNullValue());
4242

4343
// We expect having 1 node as part of the cluster, let's test that

src/test/java/org/elasticsearch/discovery/azure/AzureTwoStartedNodesTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ public AzureTwoStartedNodesTest() {
3737
@Test
3838
public void two_nodes_should_run() {
3939
logger.info("--> start first node");
40-
cluster().startNode(settingsBuilder());
40+
internalCluster().startNode(settingsBuilder());
4141
assertThat(client().admin().cluster().prepareState().setMasterNodeTimeout("1s").execute().actionGet().getState().nodes().masterNodeId(), notNullValue());
4242

4343
logger.info("--> start another node");
44-
cluster().startNode(settingsBuilder());
44+
internalCluster().startNode(settingsBuilder());
4545
assertThat(client().admin().cluster().prepareState().setMasterNodeTimeout("1s").execute().actionGet().getState().nodes().masterNodeId(), notNullValue());
4646

4747
// We expect having 2 nodes as part of the cluster, let's test that

src/test/java/org/elasticsearch/repositories/azure/AbstractAzureRepositoryServiceTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import org.elasticsearch.cluster.metadata.IndexMetaData;
2727
import org.elasticsearch.common.settings.ImmutableSettings;
2828
import org.elasticsearch.common.settings.Settings;
29+
import org.elasticsearch.plugins.PluginsService;
2930
import org.elasticsearch.repositories.RepositoryMissingException;
3031
import org.elasticsearch.test.store.MockDirectoryHelper;
3132
import org.junit.After;
@@ -65,6 +66,7 @@ public static void wipeRepositories(String... repositories) {
6566
@Override
6667
protected Settings nodeSettings(int nodeOrdinal) {
6768
ImmutableSettings.Builder builder = ImmutableSettings.settingsBuilder()
69+
.put("plugins." + PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, true)
6870
.put("cloud.azure." + AzureStorageService.Fields.ACCOUNT, "mock_azure_account")
6971
.put("cloud.azure." + AzureStorageService.Fields.KEY, "mock_azure_key")
7072
.put("repositories.azure.api.impl", mock)
@@ -94,9 +96,9 @@ public final void wipe() throws StorageException, ServiceException, URISyntaxExc
9496
* Purge the test container
9597
*/
9698
public void cleanRepositoryFiles(String path) throws StorageException, ServiceException, URISyntaxException {
97-
String container = cluster().getInstance(Settings.class).get("repositories.azure.container");
99+
String container = internalCluster().getInstance(Settings.class).get("repositories.azure.container");
98100
logger.info("--> remove blobs in container [{}]", container);
99-
AzureStorageService client = cluster().getInstance(AzureStorageService.class);
101+
AzureStorageService client = internalCluster().getInstance(AzureStorageService.class);
100102
client.deleteFiles(container, path);
101103
}
102104
}

src/test/java/org/elasticsearch/repositories/azure/AzureSnapshotRestoreITest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,10 @@ public static void wipeRepositories(String... repositories) {
245245
* Purge the test container
246246
*/
247247
public void cleanRepositoryFiles(String path) throws StorageException, ServiceException, URISyntaxException {
248-
String container = cluster().getInstance(Settings.class).get("repositories.azure.container",
248+
String container = internalCluster().getInstance(Settings.class).get("repositories.azure.container",
249249
AzureRepository.CONTAINER_DEFAULT);
250250
logger.info("--> remove blobs in container [{}], path [{}]", container, path);
251-
AzureStorageService client = cluster().getInstance(AzureStorageService.class);
251+
AzureStorageService client = internalCluster().getInstance(AzureStorageService.class);
252252

253253
// Remove starting / if any
254254
path = Strings.trimLeadingCharacter(path, '/');

src/test/java/org/elasticsearch/repositories/azure/AzureSnapshotRestoreTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
@ElasticsearchIntegrationTest.ClusterScope(
3737
scope = ElasticsearchIntegrationTest.Scope.SUITE,
3838
numDataNodes = 1,
39+
numClientNodes = 0,
3940
transportClientRatio = 0.0)
4041
public class AzureSnapshotRestoreTest extends AbstractAzureRepositoryServiceTest {
4142

0 commit comments

Comments
 (0)