Elasticsearch curator, or simply curator, is a tool that allows you to manage your Elasticsearch cluster easily. Written in Python, the curator comes in handy when you need to manage your ELK indices and snapshots.
This guide will show you how to set up and configure the Elasticsearch curator for your ELK cluster.
Requirements
Before installing curator on your system, ensure you have:
- Python installed and up to date.
- Internet access for your system.
Update your system
Start by updating your system. In this guide, we are using an Ubuntu 20.04 server
sudo apt upgrade
Install Python3-Pip
To install the Elasticsearch curator, we first need to ensure we have pip installed. Use the command:
Installing Elasticsearch curator
Once we have pip installed and updated, we can install the Elasticsearch curator using the command:
Setting up Curator Config file
The next step is to set up the configuration file for the Elasticsearch curator. By default, the configuration file is in the /home/user/.curator/curator.yml
Start by creating the directory:
Next, create the curator.yml config file.
Finally, add the configuration details that comprise the client connection and logging parameters.
The default entry is below:
client:
hosts: # define nosts
- 127.0.0.1
- 192.168.0.113
port: 9200 # Elasticsearch port
url_prefix: # set url prefix for example proxy. Leave empty for none
use_ssl: false # use SSL? True or False
certificate: # path to CA certificate => /path/to/ca/file
client_cert: # path to client certificate
client_key: # path to private SSL key
ssl_no_validate: false # set true if elasticsearch is protected by SSL
username: # HTTP Auth username
password: # HTTP Auth password
timeout: 30 # set timeout value
master_only: false # install on every node or master only?
logging:
loglevel: INFO # set log level such as CRITICAL, DEBUG, WARNING, or ERROR
logfile: # path to the log file
logformat: default # define log format => defualt format is as 2016-04-22 11:53:09,972 INFO Action #1: ACTIONNAME
blacklist: ['elasticsearch', 'urllib3'] # disables logs for elasticsearch and urllib3
NOTE: The comments are for documentation purposes only. Feel free to remove or modify them as necessary.
Save the file and close the editor.
Once completed, you can use curator as a python module or as a command-line utility:
For example, the following command shows the snapshots using the curator utility.
Conclusion
This guide shows you how to set up and configure the Elasticsearch curator tool to manage your cluster.
Check the following resource to learn more:
Thank you for reading.