Commit Graph

118 Commits

Author SHA1 Message Date
Robert Muir a7009eeb2a switch to plugin pom 2015-05-21 22:52:44 -04:00
Robert Muir 078ec7624a remove duplicate test config 2015-05-21 16:48:58 -04:00
Robert Muir bcd2121f7e engage forbidden apis 2015-05-21 10:34:33 -04:00
David Pilato e9af02ba06 update documentation with release 2.6.1 2015-05-21 00:01:45 +02:00
David Pilato 4b192fb676 update documentation with release 2.5.2 2015-05-20 23:51:09 +02:00
Lee Hinman 8742d477c4 Fix compilation for latest ES versions
This fixes a change that recently landed in 1.x and master that prevents
the plugin from being compiled.
2015-05-18 13:43:22 -06:00
Robert Muir 6b3e57e430 Use tests.jvms=1 like the old parallelism of 1 2015-05-13 23:16:42 -04:00
Robert Muir e5ceabf734 Use ThirdParty annotation and remove duplicate test config.
See elastic/elasticsearch-parent#41
2015-05-13 22:59:35 -04:00
Robert Muir 3823c40471 enable security manager in tests 2015-05-11 19:51:37 -04:00
Robert Muir 3ee651493e Tests: fix compilation 2015-05-05 14:28:41 -04:00
David Pilato 2c1f209df9 Fix non working update dynamic settings
Described in https://github.com/elastic/elasticsearch/issues/10614, it's not possible with cloud discovery plugin to update dynamic settings anymore.

```sh
curl -XPUT localhost:9200/_cluster/settings -d '{
    "persistent" : {
        "discovery.zen.minimum_master_nodes" : 3
    },
    "transient" : {
        "discovery.zen.minimum_master_nodes" : 3
    }
}'
```

gives

```json
{"acknowledged":true,"persistent":{},"transient":{}}
```

Closes #80.
(cherry picked from commit 7749055)
(cherry picked from commit 82bea69ef0f24c5f60a68bd823f638890b984691)

Conflicts:
	src/main/java/org/elasticsearch/discovery/azure/AzureDiscovery.java
2015-04-29 12:21:27 +02:00
David Pilato 992560494a [test] testSimpleWorkflow() and testListBlobs_26() use same snapshot name
`testSimpleWorkflow()` and `testListBlobs_26()` use same `test-snap` snapshot name.

So we might get this issue:

```
2015-04-29 12:02:47,279 WARN  snapshots - [node_s0] failed to create snapshot [test-repo:test-snap]
InvalidSnapshotNameException[[test-repo:test-snap] Invalid snapshot name [test-snap], snapshot with such name already exists]
	at org.elasticsearch.repositories.blobstore.BlobStoreRepository.initializeSnapshot(BlobStoreRepository.java:228)
	at org.elasticsearch.repositories.azure.AzureRepository.initializeSnapshot(AzureRepository.java:148)
	at org.elasticsearch.snapshots.SnapshotsService.beginSnapshot(SnapshotsService.java:303)
	at org.elasticsearch.snapshots.SnapshotsService.access$500(SnapshotsService.java:88)
	at org.elasticsearch.snapshots.SnapshotsService$1$1.run(SnapshotsService.java:229)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)
```

Closes #85.
2015-04-29 12:13:55 +02:00
David Pilato 8bd131eac2 [core] Simplify IndexStore and friends
Related to https://github.com/elastic/elasticsearch/pull/10773

Closes #81.
2015-04-29 12:00:55 +02:00
David Pilato ff9394cbac [test] ElasticsearchIntegrationTest#getContext() shortcut has been removed
Due to https://github.com/elastic/elasticsearch/pull/10656

Closes #84.
2015-04-29 11:52:09 +02:00
David Pilato 6752e87052 [test] Cleanup Directory and Searcher mock code
Related to https://github.com/elastic/elasticsearch/pull/10853

Closes #83.
2015-04-29 11:47:11 +02:00
David Pilato a34a443782 Remove `ElasticsearchIllegalArgumentException` and `ElasticsearchIllegalStateException` in favor of the JDK one
Related to https://github.com/elastic/elasticsearch/issues/10794

Closes #82.
2015-04-29 11:45:03 +02:00
David Pilato 9c7cc9ce28 update documentation with release 2.6.0 2015-04-16 17:17:29 +02:00
David Pilato 7ba65950ae Remove deprecated settings
#61 and #62 renamed settings by deprecating old ones and creating new ones.
In version 3.0.0, we can remove old settings.

That said, we should not remove it from master doc before 2.6.0 is released.

Closes #70.
2015-04-16 16:44:23 +02:00
David Pilato cd7b8d4840 Update settings filter and remove component settings from AbstractComponent
Update settings filter to match elasticsearch/elasticsearch#9748
Remove component settings from AbstractComponent as seen in elasticsearch/elasticsearch#9919

Closes #71.
Closes #72.
2015-04-16 15:33:59 +02:00
David Pilato b7c44087cf Create branch es-1.5 2015-03-28 11:43:29 +01:00
David Pilato 7833b17b7c Move owner to elastic
(cherry picked from commit d50057a)
2015-03-28 11:36:44 +01:00
David Pilato 80e6609c7d Move parent after artifact coordinates 2015-03-28 11:36:26 +01:00
David Pilato ff0547f04d Add keystore.type, deployment.name and deployment.slot settings for discovery
We can now support two new options:

* `deployment.name`: deployment name if any. Defaults to the value set with `cloud.azure.cloud.service.name`.
* `deployment.slot`: either `staging` or `production` (default).

(cherry picked from commit 6d7ee49)
(cherry picked from commit 10beb68)
2015-02-27 11:21:10 +01:00
David Pilato 85ac406f63 Use Azure Java Management SDK 0.7.0
This first version adds `azure-management` 0.7.0 instead of using our own XML implementation.
We can now have more control and give more options to the users.

We now support different keystore types using `cloud.azure.management.keystore.type`:

* `pkcs12`
* `jceks`
* `jks`

Closes #38

(cherry picked from commit 72c77d3)
(cherry picked from commit d2541ab)
2015-02-27 10:56:00 +01:00
David Pilato 42509d0da8 Rename settings for discovery
Azure Java SDK follows some conventions about property names and we can use
the same convention. The benefit is that it makes the code cleaner and easier to understand
as components settings relies on package name without the `org.elasticsearch` prefix.

In previous versions, we defined:

```
cloud:
	azure:
		keystore: /path/to/keystore
		password: your_password_for_keystore
		subscription_id: your_azure_subscription_id
		service_name: your_azure_cloud_service_name
		port_name: elasticsearch
		host_type: private_ip
```

We now define:

```
cloud:
	azure:
		management:
			keystore:
				path: /path/to/keystore
				password: your_password_for_keystore
			subscription:
				id: your_azure_subscription_id
			cloud:
				service:
					name: your_azure_cloud_service_name

discovery:
	azure:
		host:
			type: private_ip
		endpoint:
			name: elasticsearch
```

The following are a list of settings (prefixed with `cloud.azure.management`) that can further control the discovery:

* `keystore.path`: /path/to/keystore
* `keystore.password`: your_password for the keystore
* `subscription.id`: your_azure_subscription_id
* `cloud.service.name`: your_azure_cloud_service_name

So basically we deprecate the following properties:

* `cloud.azure.keystore` to `cloud.azure.management.keystore.path`
* `cloud.azure.password` to `cloud.azure.management.keystore.password`
* `cloud.azure.subscription_id` to `cloud.azure.management.subscription.id`
* `cloud.azure.service_name` to `cloud.azure.management.cloud.service.name`
* `cloud.azure.port_name` to `discovery.azure.port.name`
* `cloud.azure.host_type` to `discovery.azure.host.type`

Note that we can still read deprecated settings but it will print a `WARN` with an advice to make sure users don't forget to move.

(cherry picked from commit 04920a8)
(cherry picked from commit 9745826)
2015-02-27 10:53:51 +01:00
David Pilato 4954732007 Rename settings for repositories
Storage and Management settings are not related in Azure API.
We were using the following convention for storage specific settings:

```yml
cloud:
    azure:
        storage_account: your_azure_storage_account
        storage_key: your_azure_storage_key
```

A better naming (and Java packaging) would be by moving `storage` settings in their own package
`cloud.azure.storage`:

```yml
cloud:
    azure:
        storage:
            account: your_azure_storage_account
            key: your_azure_storage_key
```

Note that we can still read deprecated settings but it will print a `WARN` with an advice to make sure users don't forget to move.

(cherry picked from commit 6b30c62)
(cherry picked from commit 1237be9)
2015-02-27 10:52:07 +01:00
David Pilato 696804ebdb Fix log parameters 2015-02-18 16:14:21 +01:00
David Pilato a8961d28c9 Fix failing tests with elasticsearch 1.4.3
(cherry picked from commit 040e96f)
(cherry picked from commit 13c83ce)
2015-02-17 16:40:24 +01:00
David Pilato 27546ecb16 Tests don't pass if elasticsearch.yml does not contain azure discovery settings
For now, we remove forcing discovery settings with `discovery.type: azure`.
So a developer who wants to run this test needs to add it in his `elasticsearch.yml` file.

Due to #50
(cherry picked from commit 6ac4483)
(cherry picked from commit 1a80c4b)
2015-02-17 14:49:36 +01:00
David Pilato a69ef2b5e2 [Test] use seed in container name and clean all after tests
Until version 2.5.2, our integration tests were using the same `container_name` for all tests but different `base_path` for repositories.
One test uses the default `base_path` so we ended up with conflicts while running at the same time a test from different locations (could be by developers and/or Jenkins itself).

This commit changes this:

* it creates a container name which uses the test seed, eg. `snapshot-itest-b2dbda478ab9da2f`
* for `testMultipleRepositories`, we append `-1` and `-2` to the previous container name
* for `testRemoveAndCreateContainer`, we append `-testremove`
* for `testForbiddenContainerName`, we now remove containers which are supposed to be created: `123456789-123456789-123456789-123456789-123456789-123456789-123`, `elasticsearch-integration` and `elasticsearch-integration-007`. It also means that we wait up to 5 minutes if we launch just after the same test because Azure removes containers in an asynchronous way so it's not possible to create the container right after we send a remove container request.
* After and before the test suite, we make sure that we clean the containers that have been created during the test suite execution.

It means that after a test, no file should remain within the storage account used for those integration tests.

Closes #50.
2015-02-17 12:34:53 +01:00
David Pilato 396cf117c9 Simplify setting index.store.type with smb_simple_fs and smb_mmap_fs
This commit changes work done in #60 by using automatic store type discovery which exists in elasticsearch core.

Instead of writing configuration like:

```yaml
index.store.type: org.elasticsearch.index.store.fs.SmbMmapFsIndexStoreModule
index.store.type: org.elasticsearch.index.store.fs.SmbSimpleFsIndexStoreModule
```

We can now use:

```yaml
index.store.type: smb_mmap_fs
index.store.type: smb_simple_fs
```

Note that we move `org.elasticsearch.index.store.fs.SmbMmapFsIndexStoreModule` to  `org.elasticsearch.index.store.smbmmapfs.SmbMmapFsIndexStoreModule` and `org.elasticsearch.index.store.fs.SmbSimpleFsDirectoryService` to `org.elasticsearch.index.store.smbsimplefs.SmbSimpleFsDirectoryService` instead of deprecating the old classes and add new ones.
It means that if users were using a 2.5.2-SNAPSHOT version, they will need to update their settings.

(cherry picked from commit 613ce5a)
(cherry picked from commit 7831521)
2015-02-17 10:47:46 +01:00
Shay Banon 24cf553c9a Update README.md
clarify why we wrote the smb dir
2015-02-14 17:53:55 +01:00
David Pilato de24b379ee Script examples should escape special chars 2015-02-13 22:21:19 +01:00
Tanguy Leroux 3ef4cc5a78 Open Lucene MMap/SimpleFSDirectory with Read option
This commit adds 2 IndexStoreModule / IndexStore / DirectoryService that open Lucene MMapFSDirectory / SimpleFSDirectory with a "read" option.
It can be activated in configuration with:
index.store.type: org.elasticsearch.index.store.fs.SmbSimpleFsIndexStoreModule
or
index.store.type: org.elasticsearch.index.store.fs.SmbMmapFsIndexStoreModule
(cherry picked from commit 2388ace)
(cherry picked from commit 16014a0)
2015-02-13 17:26:10 +01:00
David Pilato 54de108a51 Use Azure Storage 2.0.0
Microsoft team has released a new specific project to deal with storage with a much cleaner API than the previous version.

See https://github.com/azure/azure-storage-java
Documentation is here: http://azure.microsoft.com/en-us/documentation/articles/storage-java-how-to-use-blob-storage/

Note that the produced ZIP file has been reduced from 5mb to 1.3mb.

Related to #38

(cherry picked from commit 4467254)
(cherry picked from commit b2f1e4d)
2015-02-12 21:25:32 +01:00
David Pilato c20371aa8f Support new method `BlobContainer#move()`
This has been added in elasticsearch 2.0.0. See elasticsearch/elasticsearch#8782

Wondering if this PR should be split in two parts:

* one that clean the code and which is portable to 1.4, 1.x and master
* one that simply add move() method for master branch

@imotov WDYT?

Closes #49.
2015-02-12 18:55:51 +01:00
David Pilato b91f5da2b2 Failure when creating a container should raise an exception
When you remove a container from Azure console, even if Azure told you that it has been done, it appears to be an asynchronous deletion so you can hit error like `can not initialize container [elasticsearch-snapshots]: [The specified container is being deleted. Try operation later.]` but this error does not fail the repository creation...

Related to #54.

(cherry picked from commit e483304)
(cherry picked from commit 520444c)
2015-02-12 18:47:34 +01:00
David Pilato b7b8db97c7 [package] stax-api is added twice
Library stax-api is added twice in final ZIP file.
It's due to the dependency tree.

```
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ elasticsearch-cloud-azure ---
[INFO] org.elasticsearch:elasticsearch-cloud-azure:jar:2.5.2-SNAPSHOT
[INFO] +- org.hamcrest:hamcrest-core:jar:1.3.RC2:test
[INFO] +- org.hamcrest:hamcrest-library:jar:1.3.RC2:test
[INFO] +- com.carrotsearch.randomizedtesting:randomizedtesting-runner:jar:2.1.10:test
[INFO] |  \- junit:junit:jar:4.10:test
[INFO] +- org.apache.lucene:lucene-test-framework:jar:4.10.2:test
[INFO] |  +- org.apache.lucene:lucene-codecs:jar:4.10.2:test
[INFO] |  +- org.apache.lucene:lucene-core:jar:4.10.2:compile
[INFO] |  +- com.carrotsearch.randomizedtesting:junit4-ant:jar:2.1.6:test
[INFO] |  \- org.apache.ant🐜jar:1.8.2:test
[INFO] +- org.elasticsearch:elasticsearch:jar:1.4.2:compile
[INFO] |  +- org.apache.lucene:lucene-analyzers-common:jar:4.10.2:compile
[INFO] |  +- org.apache.lucene:lucene-queries:jar:4.10.2:compile
[INFO] |  +- org.apache.lucene:lucene-memory:jar:4.10.2:compile
[INFO] |  +- org.apache.lucene:lucene-highlighter:jar:4.10.2:compile
[INFO] |  +- org.apache.lucene:lucene-queryparser:jar:4.10.2:compile
[INFO] |  +- org.apache.lucene:lucene-sandbox:jar:4.10.2:compile
[INFO] |  +- org.apache.lucene:lucene-suggest:jar:4.10.2:compile
[INFO] |  +- org.apache.lucene:lucene-misc:jar:4.10.2:compile
[INFO] |  +- org.apache.lucene:lucene-join:jar:4.10.2:compile
[INFO] |  +- org.apache.lucene:lucene-grouping:jar:4.10.2:compile
[INFO] |  \- org.apache.lucene:lucene-spatial:jar:4.10.2:compile
[INFO] |     \- com.spatial4j:spatial4j:jar:0.4.1:compile
[INFO] +- com.microsoft.windowsazure:microsoft-windowsazure-api:jar:0.4.6:compile
[INFO] |  +- com.sun.jersey:jersey-client:jar:1.13:compile
[INFO] |  |  \- com.sun.jersey:jersey-core:jar:1.13:compile
[INFO] |  +- javax.inject:javax.inject🫙1:compile
[INFO] |  +- com.sun.jersey:jersey-json:jar:1.13:compile
[INFO] |  |  +- org.codehaus.jettison:jettison:jar:1.1:compile
[INFO] |  |  |  \- stax:stax-api:jar:1.0.1:compile
[INFO] |  |  +- com.sun.xml.bind:jaxb-impl:jar:2.2.3-1:compile
[INFO] |  |  |  \- javax.xml.bind:jaxb-api:jar:2.2.2:compile
[INFO] |  |  |     \- javax.xml.stream:stax-api:jar:1.0-2:compile
[INFO] |  |  +- org.codehaus.jackson:jackson-core-asl:jar:1.9.2:compile
[INFO] |  |  +- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.2:compile
[INFO] |  |  +- org.codehaus.jackson:jackson-jaxrs:jar:1.9.2:compile
[INFO] |  |  \- org.codehaus.jackson:jackson-xc:jar:1.9.2:compile
[INFO] |  +- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] |  +- javax.mail:mail:jar:1.4.5:compile
[INFO] |  |  \- javax.activation:activation:jar:1.1:compile
[INFO] |  \- org.apache.commons:commons-lang3:jar:3.1:compile
[INFO] +- log4j:log4j:jar:1.2.17:compile
[INFO] \- org.elasticsearch:elasticsearch:test-jar:tests:1.4.2:test
```

We should exclude `javax.xml.stream:stax-api:jar:1.0-2:compile` from `com.microsoft.windowsazure:microsoft-windowsazure-api:jar:0.4.6:compile`

Closes #56.

(cherry picked from commit 68efe93)
(cherry picked from commit 68f25d1)
2015-02-04 15:38:41 +01:00
David Pilato 7c27d53ee1 [cleanup] collapse identical catch blocks
With Java7, you don't need multiple identical catch blocks anymore

Related to #52.

(cherry picked from commit 322e1e5)
(cherry picked from commit 9d3b0ad)
2015-02-04 14:55:16 +01:00
David Pilato 0e81e351c2 [cleanup] use diamond operator
With Java 7, we can change `Set<Instance> = new HashSet<Instance>()` to `Set<Instance> = new HashSet<>()`

Related to #52.

(cherry picked from commit 0c709de)
(cherry picked from commit 4f474f5)
2015-02-04 14:54:08 +01:00
David Pilato d11a813bce [cleanup] remove useless `;`
Related to #52.

(cherry picked from commit 0899438)
(cherry picked from commit d1a9b0b)
2015-02-04 14:53:52 +01:00
David Pilato eaf3fbc6d7 [cleanup] simplify logging debug/trace code
[logging] don't use anymore `if (logger.isTraceEnabled())` or `if (logger.isDebugEnabled())`

Related to #52.

(cherry picked from commit 95381d4)
(cherry picked from commit 6d5ce44)
2015-02-04 14:53:41 +01:00
David Pilato 68fdedf91d [cleanup] Change Logger factory
Related to #52

(cherry picked from commit a6435ab)
(cherry picked from commit f82ee58)
2015-02-04 14:53:27 +01:00
David Pilato 3afe59ff69 Move AzureUnicastHostsProvider to AzureDiscoveryModule
Related to elasticsearch/elasticsearch#9099

Closes #48
2015-01-14 17:04:51 +01:00
David Pilato dee924bb05 Depend on elasticsearch-parent
To simplify plugins maintenance and provide more value in the future, we are starting to build an `elasticsearch-parent` project. This commit is the first step for this plugin to depend on this new `pom` maven project.
2015-01-02 21:46:55 +01:00
Adrien Grand 3e612ed3e2 Upgrade to Lucene 5.0.0-snapshot-1642891 2014-12-02 18:19:45 +01:00
David Pilato 69107b5ae6 update documentation with release 2.5.1 2014-11-24 18:17:00 +01:00
David Pilato 27a12065eb The document recommends a non-durable location for data
I noticed the documentation recommends a non-durable local resource for the Elasticsearch data path.  Although this is acceptable for some deployments it might be worth warning people that the path is not durable and there is a potential for data loss, even with replicas data loss is theoretically possible.

```
# recommended
path.data: /mnt/resource/elasticsearch/data
```

Alternatively the user could attach and use data disks which do come with a significant performance tradeoff, but premium storage options with higher IOPS have been announced and are right around the corner.

Closes #46.
2014-11-24 18:05:21 +01:00
David Pilato 1e71a7e72d UnicastHostsProvider should use version.minimumCompatibilityVersion()
The UnicastHostsProvider implementation creates DiscoveryNodes that are used as an initial seed for unicast based discovery. At the moment it uses Version.CURRENT for those DiscoveryNode object, which confuses the backwards compatibility layer to think this nodes are of the latest version. This causes new nodes to fail to join old nodes as the ping serialization goes wrong. Instead we should use version.minimumCompatibilityVersion().

Closes #47.

(cherry picked from commit 188179f)
2014-11-24 18:00:24 +01:00
Michael McCandless 300320f862 Upgrade to Lucene 5.0.0-snapshot-1641343 2014-11-24 05:52:11 -05:00