8000 snapshot on indices created on pre ES 1.4 · Issue #713 · elastic/curator · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

snapshot on indices created on pre ES 1.4 #713

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

Closed
fasher opened this issue Jul 31, 2016 · 11 comments 8000
Closed

snapshot on indices created on pre ES 1.4 #713

fasher opened this issue Jul 31, 2016 · 11 comments

Comments

@fasher
Copy link
fasher commented Jul 31, 2016

I have curator set up to run snapshot on ES 1.6.1. the server was upgraded several time and index is quite old.
I'm getting this error when trying to snapshot the indices:
016-07-31 10:36:17,394 INFO Action #1: snapshot
2016-07-31 10:36:17,423 WARNING Index: products has no "creation_date"! This implies that the index predates Elasticsearch v1.4. For safety, this index will be removed from the actionable list.
2016-07-31 10:36:17,423 WARNING Index: query-prediction has no "creation_date"! This implies that the index predates Elasticsearch v1.4. For safety, this index will be removed from the actionable list.
2016-07-31 10:36:17,423 ERROR Unable to complete action "snapshot". No actionable items in list: <class 'curator.exceptions.NoIndices'>

what are the issues with snapshots on indices that were created pre v.1.4?
I don't have any issues running the snapshot manually

@fasher
Copy link
Author
fasher commented Jul 31, 2016

In addtion I can see in the index settings the following field:
"version": {
"created": "1030699",
"upgraded": "2030199"
}

is this not what being mapped into create_date?

@untergeek
Copy link
Member

The creation_date is index metadata that did not get added until Elasticsearch 1.4. That's why that message is in Curator. Your index selection criteria is probably using an age filter with creation_date, and this is the result if the index has no creation_date metadata (and that metadata is in the cluster state, not the index itself). Curator tries to do the safe thing and not act on an index in that case.

@fasher
Copy link
Author
fasher commented Jul 31, 2016

no, I do not have any filters on the snapshot action.
this is how my action file looks like :
actions:
1:
action: snapshot
description: >-
Snapshot all indices with snapshot pattern automatic_%Y-%m-%d-%H-%M-%S
options:
repository: backup
name: automatic_%Y-%m-%d-%H-%M-%S
ignore_unavailable: False
include_global_state: True
partial: False
wait_for_completion: True
skip_repo_fs_check: False
timeout_override:
continue_if_exception: False
disable_action: False
2:
action: delete_snapshots
descriptions: >-
delete snapshot older then 24 hours based on creation_date for automatic_ prefixed snapshots
options:
repository: backup
timeout_override:
continue_if_exception: False
ignore_empty_list: True
disable_action: False
filters:
- filtertype: pattern
kind: prefix
value: automatic_
exclude:
- filtertype: age
source: creation_date
direction: older
unit: hours
unit_count: 24
exclude:

@untergeek
Copy link
Member

You're right. That's not needed for this action to occur. Curator 4 differs from the previous versions in that it pulls the index metadata for all indices when it starts. The message you report happens during that index metadata discovery step:

                    if not 'creation_date' in wl['settings']['index']:
                        self.loggit.warn(
                            'Index: {0} has no "creation_date"! This implies '
                            'that the index predates Elasticsearch v1.4. For '
                            'safety, this index will be removed from the '
                            'actionable list.'.format(index)
                        )
                        self.__not_actionable(index)

As I mentioned already, this is because Curator 4 determines to do the safe thing with older indices. The README shows that Curator 4 is meant for Elasticsearch versions 2+. I will add another bit to the README to indicate that indices created before ES 1.4 are not supported.

@fasher
Copy link
Author
fasher commented Jul 31, 2016

Maybe it will be better to add an option to explicitly ignore this check on certain indices mentioned in the action file?

@untergeek
Copy link
Member

I'd prefer not to make exceptions to a rule. There are several other good and important reasons to have indices upgraded to at least a 2.x version (which is crucial if an eventual upgrade to Elasticsearch 5.0 is planned, as older indices cannot be used in place).

If you still want to use Curator, use can use version 3.5.1 which has no such restrictions and according to the compatibility matrix supports all ES versions 0.x through 2.x. Curator 4 is the first version which is not fully backwards compatible.

@fasher
Copy link
Author
fasher commented Aug 1, 2016

How would you upgrade indices? do I really need to reindex them? that's not very practical on very large index only to get a create date

@untergeek
Copy link
Member

If you're already using Elasticsearch 2.3, you could try the new _reindex API: https://www.elastic.co/guide/en/elasticsearch/reference/2.3/docs-reindex.html

While I can sympathize with the pain of reindexing data, as mentioned, if you plan on upgrading to newer versions of Elasticsearch in the future, this will still be required at that point.

@untergeek
Copy link
Member

As there is no real solution other than reindexing, I'm marking this closed. If you feel this is in error, please feel free to reopen the ticket, or open a new one.

@vishnu-svmx
Copy link

Hi,
The indices which i am trying to take snapshot was updated from 1.3 to 2.4 and i don't see a creation data since the indices was created with V1.3

    "version": {
       "created": "1030299",
       "upgraded": "2040399"

}
Is it a good idea to manually add a creation data to the indices metadata settings? will it have any impact? or what is the best way to take snapshots in this usecase?

curl -XPUT 'localhost:9200/xxxx/_settings' -d '

{
"index" : {
"creation_date" : "xxxxx"
}
}'

@untergeek
Copy link
Member

@vishnu-svmx You cannot manually add this metadata. It will not work. Your only option is mentioned in this post in the thread, and reindex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
0