I'm currently attempting to create an s3 snapshot repository using the java TransportClient. I'm getting the following error:
RepositoryException[[028181cde20d44a8bb3009f71daf8524_backup] failed to create repository]; nested: IllegalArgumentException[Unknown [repository] type [S3]];
at org.elasticsearch.repositories.RepositoriesService.createRepositoryHolder(RepositoriesService.java:411)
[snip]
Caused by: java.lang.IllegalArgumentException: Unknown [repository] type [S3]
at org.elasticsearch.common.util.ExtensionPoint$SelectedType.bindType(ExtensionPoint.java:146)
I tried adding the cloud aws plugin to the transport client like this:
new TransportClient
.Builder()
.settings(Settings.builder().put("cluster.name", "cluster_name"))
.addPlugin(CloudAwsPlugin.class)
.build()
but I'm still getting the same error.
EDIT: Figured it out. needed to enable the plugin via the cloud.enabled setting
new TransportClient
.Builder()
.settings(Settings.builder().put("cluster.name", config.clusterName).put("cloud.enabled", true))
.addPlugin(CloudAwsPlugin.class)
.build()
also needed to set the type of my repo to "s3" instead of "S3". The capital S worked in es 1.7.4, but not in 2.3.3.
BTW, instead of editing your question, it's better to add an answer so anyone will be aware of the fix and we can then mark the answer as solving the problem.
BTW, instead of editing your question, it's better to add an answer so anyone will be aware of the fix and we can then mark the answer as solving the problem.
Good to know! Copied and pasted the answer below in order to mark as solved:
Needed to enable the plugin via the cloud.enabled setting
new TransportClient
.Builder()
.settings(Settings.builder().put("cluster.name", config.clusterName).put("cloud.enabled", true))
.addPlugin(CloudAwsPlugin.class)
.build()
also needed to set the type of my repo to "s3" instead of "S3". The capital S worked in es 1.7.4, but not in 2.3.3.
Thinking about his more, I think the actual error was s3 vs S3. Under 1.7 we had a script to create repos with type "S3" which worked under 1.7, but I think elasticsearch only accepts "s3" as a type now. The cloud.enabled setting was a red herring.
I'm wondering what would happen if you create a repository in an elasticsearch cluster with S3 as a type in a 1.7 cluster, then upgrade the cluster to 2.3.
Do you think you could test such a scenario?
If it does not work, I'm unsure if the upgrade plugin is able to catch that.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.