elasticsearch
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| elasticsearch [2018/12/26 16:59] – [Register snapshot repository] baumi | elasticsearch [2021/08/29 11:33] (current) – [Merge smaller indexes to one large index] baumi | ||
|---|---|---|---|
| Line 14: | Line 14: | ||
| ===== backup ===== | ===== backup ===== | ||
| ==== Add backup directory to repository ==== | ==== Add backup directory to repository ==== | ||
| + | <code bash> | ||
| + | $ grep backup / | ||
| + | path.repo: [ "/ | ||
| + | </ | ||
| ==== Register snapshot repository ==== | ==== Register snapshot repository ==== | ||
| < | < | ||
| Line 24: | Line 28: | ||
| } | } | ||
| } | } | ||
| + | </ | ||
| + | ==== Create snapshot ==== | ||
| + | < | ||
| + | PUT / | ||
| + | </ | ||
| + | |||
| + | ===== Prune Indices with curator ===== | ||
| + | < | ||
| + | $ cat action.yml | ||
| + | actions: | ||
| + | 1: | ||
| + | action: delete_indices | ||
| + | description: | ||
| + | Delete indices older than 5 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 If you want to change the retention Days then goto unit_count:< | ||
| + | options: | ||
| + | ignore_empty_list: | ||
| + | timeout_override: | ||
| + | continue_if_exception: | ||
| + | disable_action: | ||
| + | filters: | ||
| + | - filtertype: pattern | ||
| + | kind: prefix | ||
| + | value: logstash- | ||
| + | exclude: | ||
| + | - filtertype: age | ||
| + | source: name | ||
| + | direction: older | ||
| + | timestring: ' | ||
| + | unit: days | ||
| + | unit_count: 90 | ||
| + | exclude: | ||
| + | |||
| + | $ cat config.yml | ||
| + | client: | ||
| + | hosts: | ||
| + | - elk-elasticsearch | ||
| + | port: 9200 | ||
| + | url_prefix: | ||
| + | use_ssl: False | ||
| + | certificate: | ||
| + | client_cert: | ||
| + | client_key: | ||
| + | ssl_no_validate: | ||
| + | http_auth: | ||
| + | timeout: 30 | ||
| + | master_only: | ||
| + | |||
| + | logging: | ||
| + | loglevel: INFO | ||
| + | logfile: | ||
| + | logformat: default | ||
| + | blacklist: [' | ||
| + | |||
| + | $ curator --config ./ | ||
| + | </ | ||
| + | ===== Merge smaller indexes to one large index ===== | ||
| + | < | ||
| + | $ curl --netrc --insecure --request POST --header " | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | }, | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | }' | ||
| + | |||
| + | $ curl --netrc --insecure --request PUT --header " | ||
| </ | </ | ||
| - | {{tag> | + | {{tag> |
elasticsearch.1545839951.txt.gz · Last modified: by baumi
