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

Add index.data_path setting #9033

Merged
merged 1 commit into from Dec 29, 2014
Merged

Conversation

dakrone
Copy link
Member

@dakrone dakrone commented Dec 22, 2014

(This is a fixed version of #8819, which had a lot of test failures and was subsequently reverted. The failures were partially related to ddf83a9, which was not properly injecting the right settings into the MockFSIndexStore. It also fixes some state file overwriting that occurred on Windows by making the custom path logic less invasive)

This allows specifying the path an index will be at.

index.data_path is specified in the settings when creating an index,
and can not be dynamically changed.

An example request would look like:

POST /myindex
{
  "settings": {
    "number_of_shards": 2,
    "data_path": "/tmp/myindex"
  }
}

And would put data in /tmp/myindex/0/index/0 and /tmp/myindex/0/index/1.
Note that index and shard state is still written to the node's path.data
directory, because we use this for internal accounting (though this may
change in a subsequent shadow-replica-related PR)

Since this can be used to write data to arbitrary locations on disk, it
requires enabling the node.enable_custom_paths setting in
elasticsearch.yml on all nodes.

Relates to #8976

*/
public class IndicesCustomDataPathTests extends ElasticsearchIntegrationTest {

private volatile String path;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for volatile here no?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, I will remove that.

@s1monw
Copy link
Contributor

s1monw commented Dec 29, 2014

I left a minor comment LGTM otherwise

This allows specifying the path an index will be at.

`index.data_path` is specified in the settings when creating an index,
and can not be dynamically changed.

An example request would look like:

POST /myindex
{
  "settings": {
    "number_of_shards": 2,
    "data_path": "/tmp/myindex"
  }
}

And would put data in /tmp/myindex/0/index/0 and /tmp/myindex/0/index/1

Since this can be used to write data to arbitrary locations on disk, it
requires enabling the `node.enable_custom_paths` setting in
elasticsearch.yml on all nodes.

Relates to elastic#8976
@dakrone dakrone merged commit a4e2230 into elastic:master Dec 29, 2014
@clintongormley clintongormley added >feature :Distributed/Store Issues around managing unopened Lucene indices. If it touches Store.java, this is a likely label. and removed review labels Mar 19, 2015
@dakrone dakrone deleted the custom-index-data-path4 branch April 6, 2015 17:50
@clintongormley clintongormley added :Distributed/Engine Anything around managing Lucene and the Translog in an open shard. and removed :Distributed/Store Issues around managing unopened Lucene indices. If it touches Store.java, this is a likely label. labels Feb 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed/Engine Anything around managing Lucene and the Translog in an open shard. >feature v1.5.0 v2.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants