Elasticsearch: Install ingest node
In this summer I started to work with ELK stack on Azure. This is another interesting topic if you want to increase efficiency of your DevOps activities.
As usual I started with Elasticsearch:
The open source, distributed, RESTful, JSON-based search engine. Easy to use, scalable and flexible, it earned hyper-popularity among users and a company formed around it, you know, for search.
elastic.co
Long story short, I decided to create some hands-on video to show you how you can install and configure an Elasticsearch cluster step-by-step.
First part is: Step-by-step installation and configuration of Elasticsearch 7.3.1 ingest node to Ubuntu 18.04
You can find the related commands here:
# Execute as root
sudo -i
# Get Linux version
cat /etc/issue.net
# Install java
apt install openjdk-8-jre-headless -y
# Check java version
java -version
# Start installation
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
sudo apt-get install apt-transport-https
echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list
sudo apt-get update && sudo apt-get install elasticsearch
# Install vim
apt install vim -y
# Change vm settings - vm.max_map_count
sysctl -w vm.max_map_count=262144
# Edit configuration
vim /etc/elasticsearch/elasticsearch.yml
cluster.name: my-search
node.name: ${HOSTNAME}
## Add - Client
### Turn off data functionality
node.data: false
### Turn on ingest (client) functionality
####### before 5.0
####### node.client: true
####### 5.0 or later
node.ingest: true
# System configuration
vim /etc/security/limits.conf
* soft nofile 64000
* hard nofile 64000
root soft nofile 64000
root hard nofile 64000
vim /etc/pam.d/common-session
session required pam_limits.so
vim /etc/pam.d/common-session-noninteractive
session required pam_limits.so
# Check MMAP settings
ulimit -m
# HEAP SIZE: RAM/2 = HEAP
free -m
vim /etc/environment
ES_HEAP_SIZE="2g"
# Start elasticsearch cluster
service elasticsearch start
systemctl enable elasticsearch
### sudo update-rc.d elasticsearch defaults 95 10
service elasticsearch status
curl http://localhost:9200
#### !!!!! REBOOT vm !!!!! ####
It is easy! 🙂