Home Elasticsearch Related
Post
Cancel

Elasticsearch Related

INSTALLATION

Elastic tutorial

How to install Elasticsearch on Ubuntu?

From the official website:

the default port of elasticsearch is 9200.

1
2
3
4
5
6
7
8
9
10
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.14.0-linux-x86_64.tar.gz
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.14.0-linux-x86_64.tar.gz.sha512
shasum -a 512 -c elasticsearch-7.14.0-linux-x86_64.tar.gz.sha512 
tar -xzf elasticsearch-7.14.0-linux-x86_64.tar.gz
cd elasticsearch-7.14.0

# run as a daemon
./bin/elasticsearch -d -p pid
# shut down Elasticsearch
pkill -F pid

How to install Kibana on Linux?

Official tutorial

The default port of Kibana is 5601.

1
2
3
4
curl -O https://artifacts.elastic.co/downloads/kibana/kibana-7.14.0-linux-x86_64.tar.gz
curl https://artifacts.elastic.co/downloads/kibana/kibana-7.14.0-linux-x86_64.tar.gz.sha512 | shasum -a 512 -c - 
tar -xzf kibana-7.14.0-linux-x86_64.tar.gz
cd kibana-7.14.0-linux-x86_64/

How to install Logstash?

Official tutorial

1
2
3
4
5
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 logstash

The tutorial to run Logstash.

ISSUES Recordings

Elasticsearch

1. Error: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

Solution: sysctl -w vm.max_map_count=262144.

2. Error: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured

Solution: add the ` discovery.type: single-node to the docker-compose.yml`.

3. A misleading thing which costs me much time

In the docker-compose.yml, we can set the volumes. Actually, the former one is the path of our local machine and the later one is the path in the docker container. In the following example, ./elasticsearch/config/elasticsearch.yml is the path in our local machine and /usr/share/elasticsearch/config/elasticsearch.yml is the docker’s absolute path and ro means read-only.

1
2
3
volumes:
  - ./elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro
  - ./elasticsearch/data:/usr/share/elasticsearch/data
This post is licensed under CC BY 4.0 by the author.

天池大赛赛题分析 机器学习篇

USENIX Security 21 ML Paper Summary