In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "introduction to the Construction of ElasticSearch Cluster". In daily operation, I believe many people have doubts about the construction of ElasticSearch cluster. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts about "introduction to the construction of ElasticSearch cluster"! Next, please follow the editor to study!
Introduction to ElasticSearch:
ElasticSearch is a distributed, highly scalable, high real-time search and data analysis engine. It can easily make a large number of data have the ability to search, analyze and explore. Taking full advantage of the horizontal scalability of ElasticSearch can make data more valuable in a production environment. The implementation principle of ElasticSearch is mainly divided into the following steps: first, the user submits the data to the ElasticSearch database, then the corresponding sentence is segmented by the word segmentation controller, and the weight and the result of the word segmentation are stored in the data together. When the user searches for the data, the result is ranked and scored according to the weight, and then the returned result is presented to the user.
What can ElasticSearch do:
Elasticsearch can be used to search a variety of documents. It provides scalable search, has near-real-time search, and supports multi-tenancy. "Elasticsearch is distributed, which means that the index can be divided into shards, each shard can have 0 or more replicas. Each node hosts one or more shards and acts as a coordinator to delegate operations to the correct shards. Rebalancing and routing are done automatically." Related data is usually stored in the same index, which consists of one or more primary shards and zero or more replication shards. Once the index is created, the number of primary tiles cannot be changed.
ElasticSearch success stories:
1) in early 2013, GitHub abandoned Solr and adopted ElasticSearch to do PB-level search. GitHub uses ElasticSearch to search for 20TB data, including 1.3 billion files and 130 billion lines of code.
2) Wikipedia: launch a core search architecture based on elasticsearch.
3) SoundCloud: "SoundCloud uses ElasticSearch to provide real-time and accurate music search services for 180 million users".
4) Baidu: at present, Baidu widely uses ElasticSearch as text data analysis to collect all kinds of indicator data and user-defined data from all Baidu servers. Through multi-dimensional analysis and display of all kinds of data, Baidu helps to locate and analyze instance exceptions or business-level exceptions. Currently, it covers more than 20 business lines within Baidu (including casio, Cloud Analysis, Network Alliance, Forecast, Library, Direct number, Wallet, risk Control, etc.), with a maximum of 100 machines and 200 ES nodes in a single cluster, importing 30TB + data every day.
Characteristics of Elasticsearch:
1) it can be used as a large distributed cluster (hundreds of servers) technology to process PB-level data to serve large companies, or it can be run on a single machine to serve small companies.
2) Elasticsearch is not a new technology. It combines full-text search, data analysis and distributed technology together to form a unique ES;lucene (full-text search), commercial data analysis software (also available), and distributed database (mycat).
3) for users, it is out of the box and very simple. As a small and medium-sized application, if you deploy ES in 3 minutes directly, it can be used as a system in the production environment. The amount of data is small, and the operation is not too complicated.
4) the functions of the database are insufficient in many areas (transactions, and various online transactional operations); special functions, such as full-text retrieval, synonym processing, correlation ranking, complex data analysis, near real-time processing of massive data
All right, after introducing so much to get to the point, the first is environmental preparation:
1) > = jdk1.7 (different versions of ES require different versions of jdk)
2) download the Elasticsearch package and download it directly from the official website of ES. ES has been particularly active in recent years, and the update frequency of the version is relatively high.
3) prepare three servers
Server name IP address
Node-1 192.168.86.130
Node-2 192.168.86.131
Node-3 192.168.86.132
4) Edit the elasticsearch.yml file in the installation package / config/ directory
Http.cors.enabled: true
Http.cors.allow-origin: "*"
Node.master: true
Node.data: true
Cluster.name: ESTest # ensure that the cluster names of three server nodes are the same
Node.name: node-1 # each node has a different name, and the other two are node-2,node-3
Network.host: 192.168.86.130 # ip address of the actual server
Discovery.zen.ping.unicast.hosts: ["192.168.86.130", "192.168.86.131", "192.168.86.132"] # multiple service clusters ip
Discovery.zen.minimum_master_nodes:1
5) the other servers only need to modify the node.name and network.host properties
6) start the ES on each server separately
7) enter http://192.168.86.130/_cat/nodes?pretty in the address bar to verify whether the cluster is started, with "*" to prove that it is a master node, otherwise it is a slave node
Is it very easy to build an ES cluster? it is because ES has done a lot of things for us behind our backs. Some people may ask what to do if one of the services fails:
(1) ES will automatically elect a new master
(2) there will be multiple copies of ES in the cluster and remote backup capability.
(3) failure recovery, data recovery ability
At this point, the study of "introduction to the Construction of ElasticSearch clusters" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.