엔지니어링

미처 못 다한 이야기들 - Elastic{ON} Tour Seoul

Elasticsearch Elastic{on} Tour Seoul AMA(Ask Me Anything) .

🤔 6.0 parent/child ? 🤓 6.0 join datatype . 🤔 parent child parent child ? 🤓 ! 6.0 join datatype !

, AMA (Ask Me Anything) .

kiju Kim. Elastic Support Engineer ( Elastic{ON} Tour Seoul AMA . . 🤓 )

(Type)

6.0 . 5.x 6.0 . 5.x 6.x .

6.0 parent/child join datatype .

PUT my_index
{
  "mappings": {
    "doc": {
      "properties": {
        "my_join_field": { 
          "type": "join",
          "relations": {
            "question": "answer" 
          }
        }
      }
    }
  }
}

question answer parent , myjoinfield . Parent parent (question) .

PUT my_index/doc/1?refresh
{
  "text": "This is a question",
  "my_join_field": {
    "name": "question" 
  }
}

.

PUT my_index/doc/1?refresh
{
  "text": "This is a question",
  "my_join_field": "question" 
}

Child child (answer), parent ID(1) . Parent child routing .

PUT my_index/doc/3?routing=1&refresh 
{
  "text": "This is an answer",
  "my_join_field": {
    "name": "answer", 
    "parent": "1" 
  }
}

GET myindex/search ,

{
  "took": 1,
  "timed_out": false,
  "_shards": {
    "total": 5,
    "successful": 5,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": 2,
    "max_score": 1,
    "hits": [
      {
        "_index": "my_index",
        "_type": "doc",
        "_id": "1",
        "_score": 1,
        "_source": {
          "text": "This is a question",
          "my_join_field": {
            "name": "question"
          }
        }
      },
      {
        "_index": "my_index",
        "_type": "doc",
        "_id": "3",
        "_score": 1,
        "_routing": "1",
        "_source": {
          "text": "This is an answer",
          "my_join_field": {
            "name": "answer",
            "parent": "1"
          }
        }
      }
    ]
  }
}

myjoinfield answer parent ID child . Parent

GET my_index/_search
{
  "query": {
    "match": {
      "my_join_field": "question"
    }
  }
}

Child

GET my_index/_search
{
  "query": {
    "match": {
      "my_join_field": "answer"
    }
  }
}

.

6.0 parent/child . https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html https://www.elastic.co/guide/en/elasticsearch/reference/current/parent-join.html https://www.elastic.co/blog/removal-of-mapping-types-elasticsearch https://www.elastic.co/blog/kibana-6-removal-of-mapping-types

Split Brain (Quorum)

, . 2

HA (high availability) 2 , split brain 3 . Split brain (master eligible node) . .

Split brain () 3, , discovery.zen.minimum_master_nodes 마스터 노드 개수/2+1 . 3 2 . . https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-node.html#split-brain https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery-zen.html

Machine Learning

Machine Learning Deep Dive . . anomaly ? ML job ? , multi-metric job . Kibana Machine Learning Create new job, , muti metric , Split Data (: host) . enter image description here (Multi-metric job )

Job Details Name Create Job . Anomaly Explorer . enter image description here (Anomaly Explorer)

. https://www.elastic.co/guide/en/x-pack/current/ml-gs-multi-jobs.html https://www.elastic.co/kr/videos/machine-learning-tutorial-creating-a-multi-metric-job

Delete Alias

, 6.0 . .

.

Alias 5.x Delete alias alias . Alias DELETE POST remove . 6.0 alias DELETE

POST /_aliases
{
    "actions" : [
        { "add" : { "index" : "my_index", "alias" : "alias1" } }
    ]
}
DELETE alias1

.

{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "The provided expression [alias1] matches an alias, specify the corresponding concrete indices instead."
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "The provided expression [alias1] matches an alias, specify the corresponding concrete indices instead."
  },
  "status": 400
}

https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-delete-index.html Aliases cannot be used to delete an index. .

Delete . . . https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html

Elastic{ON} Tour Seoul . Elastic{ON} 2018 Conference (https://www.elastic.co/elasticon/conf/2018/sf) . !

enter image description here