Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the project to study for elastic enginner #2

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
# elasticsearch-sandbox
Test elasticsearch features & examples.

Repositório para estudos e testes em geral utilizando as ferramentas da elastic.

## Material de estudo

- [Kibana](/kibana/README.md)
- [Python](/python/README.md)
12 changes: 11 additions & 1 deletion kibana/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# elasticsearch-sandbox kibana

Vamos utilizar o kibana como ferramenta base para os nossos estudos.

Vamos utilizar o kibana para rodar todos os comandos de criação de indices, para criar os documentos e buscar os mesmos.
## Material de estudo

**Iniciando com o elastic search**
- [Indices & Search](/kibana/example1.md)
- [Analyzers & Tokenizers](/kibana/example2.md)

**Elasticsearch Engineer**
- [Guia de estudos para o exame](/kibana/elastic-engineer/README.md)

**Tutorias & Palestras**
- [Elasticsearch como máquina de busca - TDC Connections 2021](/kibana/tdc-connections-2021/README.md)
103 changes: 103 additions & 0 deletions kibana/elastic-engineer/DataManagement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# [elastic-engineer](/kibana/elastic-engineer/README.md)

Plano de estudos para o [exame de certificação da Elastic](https://www.elastic.co/training/elastic-certified-engineer-exam).
- Versão utilizada 8.1
- Este material utiliza o Docker para rodar os comandos

## Data Management
- Define an index that satisfies a given set of requirements
- Define and use an index template for a given pattern that satisfies a given set of requirements
- Define and use a dynamic template that satisfies a given set of requirements
- Define an Index Lifecycle Management policy for a time-series index
- Define an index template that creates a new data stream

---

### Define an index that satisfies a given set of requirements

#### Criando indices no elasticsearch.

Documentação oficial:

- https://www.elastic.co/guide/en/elasticsearch/reference/8.1/indices-create-index.html


##### Da forma simples, com mapping, settings e ambos:

```kibana

PUT /some-index

PUT /some-index-mapping
{
"mappings": {
"properties": {
"field1": { "type": "text" }
}
}
}

PUT /some-index-settings
{
"settings": {
"index": {
"number_of_shards": 3,
"number_of_replicas": 2
}
}
}

PUT /some-index-mappong-settings
{
"mappings": {
"properties": {
"field1": { "type": "text" }
}
},
"settings": {
"index": {
"number_of_shards": 3,
"number_of_replicas": 2
}
}
}

GET /
```

##### Com aliases:

- https://www.elastic.co/guide/en/elasticsearch/reference/8.1/indices-add-alias.html

```kibana

PUT /some-index-aliases
{
"aliases": {
"aliases_1": {},
"aliases_2": {
"filter": {
"term": { "user.id": "kimchy" }
},
"routing": "shard-1"
}
}
}


PUT /some-index-aliases-date-math
{
"aliases": {
"<logs_{now/M}>": {}
}
}
```


### Com diferentes tipos de mapping

```kibana



```
30 changes: 30 additions & 0 deletions kibana/elastic-engineer/Docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# [elastic-engineer](/kibana/elastic-engineer/README.md)

Plano de estudos para o [exame de certificação da Elastic](https://www.elastic.co/training/elastic-certified-engineer-exam).
- Versão utilizada 8.1
- Este material utiliza o Docker para rodar os comandos

## Docker
- Instalação
- Docker para rodar os comandos

---

## Docker

### Instalação

Para instalar o docker em sua máquina, recomendo utilizar seguir os passos da documentação oficial no link https://docs.docker.com/engine/install/.

### Docker para rodar os comandos

```bash
docker-compose up -d
```

Verificar se tudo esta rodando conforme o esperado:
```bash
docker container ls
```

Após verificar que tudo esta rodando, acessar o Kibana atraves da url http://localhost:5601/
49 changes: 49 additions & 0 deletions kibana/elastic-engineer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# elastic-engineer

Plano de estudos para o [exame de certificação da Elastic](https://www.elastic.co/training/elastic-certified-engineer-exam).
- Versão utilizada 8.1
- Este material utiliza o Docker para rodar os comandos

## Overview

### [Docker](/kibana/elastic-engineer/Docker.md)
- Instalação
- Docker para rodar os comandos

### [Data Management](/kibana/elastic-engineer/DataManagement.md)
- Define an index that satisfies a given set of requirements
- Define and use an index template for a given pattern that satisfies a given set of requirements
- Define and use a dynamic template that satisfies a given set of requirements
- Define an Index Lifecycle Management policy for a time-series index
- Define an index template that creates a new data stream

### Searching Data
- Write and execute a search query for terms and/or phrases in one or more fields of an index
- Write and execute a search query that is a Boolean combination of multiple queries and filters
- Write an asynchronous search
- Write and execute metric and bucket aggregations
- Write and execute aggregations that contain sub-aggregations
- Write and execute a query that searches across multiple clusters
- Write and execute a search that utilizes a runtime field

### Developing Search Applications
- Highlight the search terms in the response of a query
- Sort the results of a query by a given set of requirements
- Implement pagination of the results of a search query
- Define and use index aliases
- Define and use a search template

### Data Processing
- Define a mapping that satisfies a given set of requirements
- Define and use a custom analyzer that satisfies a given set of requirements
- Define and use multi-fields with different data types and/or analyzers
- Use the Reindex API and Update By Query API to reindex and/or update documents
- Define and use an ingest pipeline that satisfies a given set of requirements, including the use of Painless to modify documents
- Define runtime fields to retrieve custom values using Painless scripting

### Cluster Management
- Diagnose shard issues and repair a cluster's health
- Backup and restore a cluster and/or specific indices
- Configure a snapshot to be searchable
- Configure a cluster for cross-cluster search
- Implement cross-cluster replication
41 changes: 41 additions & 0 deletions kibana/elastic-engineer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
version: "3.9"
services:
ELASTICSEARCH_HOSTS:
image: docker.elastic.co/elasticsearch/elasticsearch:8.1.3
container_name: elastic-engineer
environment:
- node.name=elastic-engineer
- cluster.name=elastic-engineer-docker-cluster
- discovery.seed_hosts=elastic-engineer
- cluster.initial_master_nodes=elastic-engineer
- bootstrap.memory_lock=true
- xpack.security.enabled=false
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- es_data:/usr/share/elasticsearch/data
ports:
- 9200:9200
networks:
- elastic-engineer

kibana:
image: docker.elastic.co/kibana/kibana:8.1.3
ports:
- 5601:5601
environment:
ELASTICSEARCH_URL: http://elastic-engineer:9200
ELASTICSEARCH_HOSTS: http://elastic-engineer:9200
networks:
- elastic-engineer

volumes:
es_data:
driver: local

networks:
elastic-engineer:
driver: bridge