In the past few years I have helped a lot of customers optimising their elastic cluster. With each version elasticsearch has more options to track performance of your nodes and recently profiling your queries was added. In this talk I am going to discuss the steps you have to take when starting with elasticsearch. The choices you have to make for the size of your cluster, the amount of indexes, amount of shards, choosing the right mappings, and creating better queries. After the setup I'll continue showing how to monitor your cluster and profile your queries.
34. The default uses dynamic type mapping
Make your mapping explicit: Date, Geo_point, long
disable dynamic type mapping
PUT /_settings
{
"index.mapper.dynamic":false
}
35. A mapping is persistent, can only add new things.
36. Use multi field mapping: name
PUT /conferences
{
"mappings": {
"conference": {
"properties": {
"name": {
"type": "string",
"analyzer": "standard",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed"
}
}
}
}}}}
37. An analyzer creates terms out of data
Has three components:
Character filter - replace & with and
Tokenizer - on whitespace, regexp, ngrams
Filters - ascii folding, language specific, lowercase, stop words
38. CHOOSE THE RIGHT ANALYZER FOR THE JOB
Custom using tokenizer and filters combinations
Use the multi field approach for special analyzers.
Do not analyze if you don't need it.
76. indices - field_data, filter_cache
os - cpu, memory, load
process - file descriptors, cpu, memory
jvm - memory, garbage collection
thread_pool - threads, rejected
fs - disk space
GET /_nodes/stats?human
77. _CAT API
GET /_cat/health?v
epoch timestamp cluster status node.total node.data shards pri relo init unassign pending_tasks ma
1462882362 14:12:42 playground yellow 1 1 56 56 0 0
GET /_cat/indices?v
health status index pri rep docs.count docs.deleted store.size pri.store.size
green open gridshore-logs-2016.01.19 5 0 1007 0 1.2mb
green open .kibana 1 0 100 1 100.2kb
yellow open topbeat-2016.05.04 5 1 170264 0 44.4mb
green open meetups-20160509113909 1 0 11 0 67.3kb
GET /_cat/fielddata?v
id host ip node total
aqj9L-DPR86J8CgYitcHsA 127.0.0.1 127.0.0.1 node-JC 0b