Elasticsearch short introduction
If interested, can read the book:http://books.google.com.sg/books?id=PEFK3MuwBsIC&printsec=frontcover&dq=elasticsearch&hl=en&sa=X&ei=RuhtUpv8J4KRrQfjpoDQAg&redir_esc=y#v=onepage&q&f=false
Elasticsearch use case
- GitHub – search code base(Github uses Elasticsearch to search 20TB data,including 1.3 billion files and 130 billion code lines)
- Foursquare – location search(50 million location data search)
- SoundCloud – music search(provide music search service for 180 million users)
- Fog Creek – search code base(support 30 million search in 40 billion code lines every month)
Elasticsearch installation
Java install
install elasticsearch 1.2.1
Configuration
- system config file: /etc/elasticsearch/elasticsearch.yml
- Application-wide settings (zen discovery, available analyzers)
- index default configurations (number of shards)
- Cluster Name and Node Name
- log config file: /etc/elasticsearch/logging.yml, default logging files are located in /var/log/elasticsearch/
- Another important part is tuning your operating system
- Elasticsearch will created several files when indexing, so the system cannot limit the open file descriptors to less than 32000, can be edit in /etc/security/limits.conf
- ES is written in Java and obviously runs inside a JVM. The most apparent JVM option is -Xmx. I set it to about 50% of the total physical memory, it happened to be a 64GB of RAM machine, so I set the
ES_HEAP_SIZE
size to 32GB.
Cluster name is important because elasticsearch will auto discover new nodes and connect nodes in to cluster based on cluaster name. Node name is also configured to make management easier.
Elasticsearch distribution model
- Node
- A running ES instance, or process running on a machine
- Run on same or different machine
- Testing: same machine can have several nodes. Production:suggestion one machine single node
- Cluster
- Distributed es system made of several nodes
- Dynamic master election, no single node fail(fail as a whole)
- Communication between nodes and data distribution and balancing is automatically handled
- View as a whole from outside
- Index
- Multiple index(like mysql database) support
- Multiple types(like mysql tables) inside indexes
- Shard
- Building blocks of index, index is divided in to shards
- Each Shard is a Lucence index
- Shards will be placed on different machines
- Moving of shards does not require reindex
- Replica
- Each shards can have 0 or more replicas
- True copy of primary shard
- Increase system fault tollerace, and search performance
Usage
Please refer to http://www.elasticsearch.org/resources/ for more information or please take a look at the ppt attachment in the first section.
Monitoring
We use ElastcHQ to monitor and manage our cluster, it's simply a local website. No configuration is needed.
Important coloring of cluster status:
- Red – Index cannot be used, some primary shards are not allocated
- Yellow – Index can still be used, but some replicas are not allocated
- Green – Index run as normal
Manage outdated indexes
We use elasticsearch-curator to manage our outdated indexes
Installation
Configuration cron job
Manage indexes with test- as a prefix and - as date separator(example index name: test-2014-06-18), to delete indexes order than 4 days and close indexes order than 1 day:
Some problems
Address yellow or red cluster status
red status usually caused by cluster fail, will be fixed by restarting problem nodes(take a look at the logs located at /var/log/elasticsearch/{cluster name}.log)
yellow status usually means some replica shards are not allocated. Can be solved by manually allocate the shard.
- Take a look at the cluster management tool (ElasticHQ) for index status: you can find out which shard fails, for example: shard 1 is not allocated
- find an available node which the shard is not allocated on, say Xemu.
- Invoke api to reroute:
- put the following json in a file reroute.json
- invoke
Nice
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteGood Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
ReplyDeleterpa training in velachery| rpa training in tambaram |rpa training in sholinganallur | rpa training in annanagar| rpa training in kalyannagar
I love the blog. Great post. It is very true, people must learn how to learn before they can learn. lol i know it sounds funny but its very true. . .
ReplyDeleteData Science course in kalyan nagar | Data Science course in OMR
Data Science course in chennai | Data science course in velachery
Data science course in jaya nagar | Data science training in tambaram
This is ansuperior writing service point that doesn't always sink in within the context of the classroom. In the first superior writing service paragraph you either hook the reader's interest or lose it. Of course your teacher, who's getting paid to teach you how to write an good essay,
ReplyDeletepython training in rajajinagar | Python training in btm | Python training in usa
norton product key
ReplyDeletemcafee product key
Thanks for sharing such an informative post with us. I hope you will share more such post. Please keep sharing.
ReplyDeleteApple Service center in Ameerpet, Hyderabad
Best Laptop Service center in Ameerpet, Hyderabad
Thanks for giving this useful post...
ReplyDeleteinplant training in chennai
inplant training in chennai
inplant training in chennai for it
Australia hosting
mexico web hosting
moldova web hosting
albania web hosting
andorra hosting
australia web hosting
denmark web hosting
excellent...!
ReplyDeleteinternship in chennai for ece students
internships in chennai for cse students 2019
Inplant training in chennai
internship for eee students
free internship in chennai
eee internship in chennai
internship for ece students in chennai
inplant training in bangalore for cse
inplant training in bangalore
ccna training in chennai
You can install office setup by visiting official website of MS Office.
ReplyDeleteOffice.com/setup
Students अपने विश्वविद्यालयों के Results के बारे में नवीनतम अपडेट की जाँच करें। Timetable-Result.com यह साइट आपकी सभी क्वेरी को समझने में मदद करेगी है।
ReplyDeleteBA 3rd semester Exam result 2020
BCom Final/3rd Year Exam result 2020
BA Exam result Part 1st, 2nd, Final Year
BCom Exam result 1st, 2nd, 3rd semester
Watching TV the historic common way is notable till you are caught away from domestic and pass over tonight's recreation or a new episode of your favourite show. With FuboTV, you can watch stay TV channels and stay sports activities somewhere — even away from domestic — the usage of a gadget like your smartphone or tablet. how to use fubo tv guide
ReplyDeleteHi I read your blog and found that your blog is full of informative content. So keep posting thanks for share this article. Your article is very amazing. I like your article. thanks you ones again.
ReplyDeleteB.Com Theory Exam Routine
bcom 1st year date sheet | B Com Part 2 Schedule | b com 3rd year time time
Interesting stuff to read and useful to improve knowledge. Keep posting.
ReplyDeleteibm full form in india |
ssb ka full form |
what is the full form of dp |
full form of brics |
gnm nursing full form |
full form of bce |
full form of php |
bhim full form |
nota full form in india |
apec full form
Really great article, Glad to read the article. It is very informative for us. Thanks for posting.
ReplyDeleteSatta King
Disawar
Sarswatienterprises is a trusted Die Set Manufacturers, Power Press Manufacturer, and Flip off Seals Machinery in Delhi, India. For more information visit our website.
ReplyDeleteAir Blower Machine Manufacturer in Delhi
Amazing Blog. Visit AAR Fragrance for Perfumes for Men Online at Best Prices in India, Buy Perfumes for Women Online in India, Davidoff Cool Water For Men EDT 125ml, and Versace Pour Homme Dylan Blue EDT 100ml.
ReplyDeleteBuy Perfumes for Women Online in India
Nice information, thank you so much sharing with us. Visit Amfez for Thakur ji ke vastra, kanha ji poshak, and krishna dress at an affordable price.
ReplyDeletekrishna dress