Ich möchte die Elasticsearch Indizes älter als 7 Tage löschen. Also habe ich kurator 4.2 installiert, da meine elasticsearch version 5.0.0 ist (kuratorversion vor 4.x sind nicht kompatibel mit elasticsearch v5)Fehler beim Ausführen des Kurators zum Löschen älterer Indizes
wir müssen eine konfigurationsdatei und eine aktionsdatei erstellen, damit das funktioniert. Ich habe meine Config und Aktionsdatei im Stammverzeichnis erstellt
Meine Konfigurationsdatei curator.yml ist
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
client:
hosts:
- 127.0.0.1
port: 9200
url_prefix:
use_ssl: False
certificate:
client_cert:
client_key:
aws_key:
aws_secret_key:
aws_region:
ssl_no_validate: False
http_auth:
timeout: 30
master_only: False
logging:
loglevel: INFO
logfile:
logformat: default
blacklist: ['elasticsearch', 'urllib3']
Meine Aktion Datei curatorAction.yml ist
actions:
1:
action: delete_indices
description: >-
Delete indices older than 45 days (based on index name), for logstash-
prefixed indices. Ignore the error if the filter does not result in an
actionable list of indices (ignore_empty_list) and exit cleanly.
options:
ignore_empty_list: True
timeout_override:
continue_if_exception: False
disable_action: True
filters:
- filtertype: pattern
kind: prefix
value: logstash-
exclude:
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: 7
exclude:
ich die Kuratorin leite mit die CLI als
curator --config curator.yml --dry-run curatorAction.yml
aber ich bekomme diesen Fehler. Ich kann nirgendwo etwas finden. Jede Hilfe wird geschätzt.
2017-02-15 17:52:02,991 ERROR Schema error: extra keys not allowed @ data[1]
Traceback (most recent call last):
File "/usr/local/bin/curator", line 11, in <module>
load_entry_point('elasticsearch-curator==4.2.6', 'console_scripts', 'curator')()
File "/usr/local/lib/python2.7/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python2.7/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/curator/cli.py", line 126, in cli
action_dict = validate_actions(action_config)
File "/usr/local/lib/python2.7/site-packages/curator/utils.py", line 1085, in validate_actions
root = SchemaCheck(data, actions.root(), 'Actions File', 'root').result()
File "/usr/local/lib/python2.7/site-packages/curator/validators/schemacheck.py", line 68, in result
self.test_what, self.location, self.badvalue, self.error)
curator.exceptions.ConfigurationError: Configuration: Actions File: Location: root: Bad Value: "{'action': 'delete_indices', 'description': 'Delete selected indices', 'filters': [{'exclude': None, 'kind': 'prefix', 'filtertype': 'pattern', 'value': 'logstash-'}, {'source': 'name', 'direction': 'older', 'unit_count': 30, 'timestring': '%Y.%m.%d', 'exclude': None, 'filtertype': 'age', 'unit': 'days'}], 'options': {'continue_if_exception': False, 'timeout_override': None, 'disable_action': False}}", extra keys not allowed @ data[1]. Check configuration file.
Sind Sie 100% sicher, dass alles vollständig korrekt formatiert ist? Ich habe deine Action-YAML-Datei kopiert und eingefügt und sie lief wunderbar für mich. – untergeek
Ich denke, es gab nur ein Problem der Einrückung. Ich habe die Dateien gelöscht und neu erstellt. ** Es hat funktioniert ** –