Es part 2 pdf no build

287 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
287
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Es part 2 pdf no build

  1. 1. elas ticse g in tro arch m iss in t he r ik R ose by E Part 2: Configuration & Deployment
  2. 2. clustering
  3. 3. shards curl -XPUT http://localhost:9200/twitter/ -d index: number_of_shards: 3
  4. 4. replicas curl -XPUT http://localhost:9200/twitter/ -d index: number_of_shards: 3 number_of_replicas: 2
  5. 5. extremer extremes
  6. 6. recommendations☁ Have at least 1 replica.☁ Make plenty of shards—but don’t go crazy.☁ 3 discovery.zen.minimum_master_nodes: 2
  7. 7. real-life examples
  8. 8. too friendly☁ Protect with a firewall☁ discovery.zen.ping.multicast.enabled: false☁ discovery.zen.ping.unicast.hosts: [“master1”, “master2”]☁ cluster.name: something_weird
  9. 9. downtime discovery.zen.ping.unicast.hosts: ["a.example.com", "b.example.com"]
  10. 10. be wary
  11. 11. monitoringcurl -XGET -s http://localhost:9200/_cluster/health?pretty=true{ "cluster_name" : "grinchyelasticsearch", "status" : "yellow", "timed_out" : false, "number_of_nodes" : 1, "number_of_data_nodes" : 1, "active_primary_shards" : 5, "active_shards" : 5, "relocating_shards" : 0, "initializing_shards" : 0, "unassigned_shards" : 5}
  12. 12. monitoringhttp://karmi.github.com/elasticsearch-paramedic/
  13. 13. optimization
  14. 14. bootstrap.mlockall: true
  15. 15. ES_HEAP_SIZE: half of RAM
  16. 16. open files /etc/security/limits.conf: es_user soft nofile 65535 ✚ es_user hard nofile 65535 /etc/init.d/elasticsearch: ulimit -n 65535 ulimit -l unlimited
  17. 17. Use default stores.
  18. 18. RAM & JVM tuning
  19. 19. shrinking indices% vmstat -S m -a 2procs -----------memory---------- ---swap-- -----io---- r b swpd free inact active si so bi bo 1 0 4 37 54 55 0 0 0 1 0 0 4 37 54 55 0 0 0 0 0 0 4 37 54 55 0 0 0 0 "some_doctype" : { "some_field"{"compress" "_all" : : {"enabled" ::false} : false} "_source"{"enabled" : false} : {"include_in_all" true} }
  20. 20. filter caching "filter": { "terms": { "tags": ["red", "green"], "execution": "plain" } } "filter": { "terms": { "tags": ["red", "green"], "execution": "bool" } }
  21. 21. dealing with the future
  22. 22. mappings
  23. 23. expensive updates
  24. 24. how to reindex☁ Use Bulk API.☁ Turn off auto-refresh: curl -XPUT localhost:9200/test/_settings -d { "index" : { "refresh_interval" : "-1" } }☁ index.merge.policy.merge_factor: 1000☁ Remove replicas if you can.☁ Use multiple feeder processes.☁ Put everything back.
  25. 25. backups☁ Small data: reindex☁ Big data: index.translog.disable_flush = true
  26. 26. thank you twitter: ErikRose erik@mozilla.comBackground image by Tim and Julie Wilson: https://secure.flickr.com/photos/secondtree/. This presentation is noncommercial sharealike in accordance with that images license.

×