Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to disable FS/URL repository based snapshots #17181

Closed
malpani opened this issue Mar 18, 2016 · 2 comments
Closed

Option to disable FS/URL repository based snapshots #17181

malpani opened this issue Mar 18, 2016 · 2 comments
Labels
discuss :Distributed/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs

Comments

@malpani
Copy link
Contributor

malpani commented Mar 18, 2016

I want to disable FS and URL snapshots in Elasticsearch 2.x. Essentially I do not want users of the cluster messing around with the filesystem. Users are allowed to configure S3 repositories only. Is there a way to do this today?

In general, it will be much more useful and powerful if plugins in 2.x are also allowed to override default modules as used to be the case in 1.x

I achieved this in 1.x by having a plugin do the following

repositoriesModule.registerRepository(FsRepository.TYPE, AbstractModule.class)

But 2.x seems to disallow registering same module twice and similar code throws the following error

[2016-03-17 14:40:43,195][ERROR][bootstrap ] Exception
ElasticsearchException[failed to invoke onModule]; nested: InvocationTargetException; nested: IllegalArgumentException[Can't register the same [repository] more than once for [url]];
at org.elasticsearch.plugins.PluginsService.processModule(PluginsService.java:232)
at org.elasticsearch.plugins.PluginsService.processModules(PluginsService.java:217)
at org.elasticsearch.node.Node.(Node.java:198)
at org.elasticsearch.node.Node.(Node.java:128)
at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:145)
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:178)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:285)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.elasticsearch.plugins.PluginsService.processModule(PluginsService.java:229)
... 7 more
Caused by: java.lang.IllegalArgumentException: Can't register the same [repository] more than once for [url]
at org.elasticsearch.common.util.ExtensionPoint$ClassMap.registerExtension(ExtensionPoint.java:104)
at org.elasticsearch.repositories.RepositoryTypesRegistry.registerRepository(RepositoryTypesRegistry.java:39)
at org.elasticsearch.repositories.RepositoriesModule.registerRepository(RepositoriesModule.java:48)
at org.elasticsearch.plugin.cloud.aws.CloudAwsPlugin.onModule(CloudAwsPlugin.java:113)
... 12 more

Filing this feature request based on my question at https://discuss.elastic.co/t/how-to-disable-filesystem-url-snapshots-in-2-x/44776

@dadoonet dadoonet added discuss :Distributed/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs labels Mar 18, 2016
@dadoonet dadoonet changed the title Option to disable FS/URL repository based snapshots in 2.x Option to disable FS/URL repository based snapshots Mar 18, 2016
@muralikpbhat
Copy link

You can achieve the desired behavior now by not specifying the path.repo and repositories.url.allowed_urls settings.

@clintongormley
Copy link

Exactly what @muralikpbhat said. Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss :Distributed/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs
Projects
None yet
Development

No branches or pull requests

4 participants