In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly shows you the "sample Analysis of elasticsearch-2.1.1 Cluster Construction", which is easy to understand and well organized. I hope it can help you solve your doubts. Let the editor lead you to study and learn the article "sample Analysis of elasticsearch-2.1.1 Cluster Construction".
Elasticsearch3.x has been released for some time. Take the time to set up the cluster and do some experiments.
-text-
The construction of elasticsearch2.7 is very simple. You only need to download the tar.gz package to the linux server to extract it, and then start es in the bin directory.
The construction of the cluster is also very simple. It is good to ensure that the cluster_name is consistent and the node_name is inconsistent.
You can automatically discover new nodes in the same network segment, or you can specify the cluster node IP in the discovery.zen.ping.unicast.hosts attribute of the configuration file.
-next, start filling the hole--
Failed to start->
Kengyi: Exception in thread "main" java.lang.RuntimeException: don't run elasticsearch as root.
Pit filling: interpreted as "preventing attacker from obtaining root permissions". If the RPM package is installed, elastsearch groups and elastsearch users will be automatically created. Set the password and start it for another user.
Pit II: Increase RLIMIT_MEMLOCK, soft limit: XXXXX, hard limit: XXXXX
Fill in the hole: for performance reasons, es recommends that you turn off swap and lock part of the mem. Follow the instructions in the log.
Generally deal with these two, pay attention to the permissions of files and logs, and basically start normally.
Failed to build cluster-- >
First of all, it should be noted that at 1.7, when es judges whether the cluster is available, it will use index.number_of_replicas to determine
But in 2.1.1, this becomes discovery.zen.minimum_master_nodes, and when the node of the cluster is lower than the set value, the cluster will be inaccessible.
PS: in the introduction, this parameter is used to prevent brain fissure in the election master. In fact, when the number of survival nodes is lower than this value, the master cannot be elected.
In the test, four node are used to build the cluster.
Pit 3: manually write four host into discovery.zen.ping.unicast.hosts, but do not manually specify the value of discovery.zen.minimum_master_nodes. After each node starts, it sets itself to Master.
Hole filling: network.host defaults to 127.0.0.1. This problem may be affected by hosts. In order to make sense, write it as the IP of the machine and solve the problem.
Pit 4: manually write four host into discovery.zen.ping.unicast.hosts, and manually specify the value of discovery.zen.minimum_master_nodes. An error occurs after starting node, and the other node or of ping keeps waiting for initialization.
Filling holes: it is speculated that es itself should automatically calculate this discovery.zen.minimum_master_nodes. If you specify it manually, when you add machines to the cluster, the number of machines is less than discovery.zen.minimum_master_nodes. This phenomenon will occur.
Just continue to add nodes to it until the manually specified value is exceeded, and the cluster will automatically elect Master and run normally.
Summary:
Do not start with root. Modify the setting of memlock and specify the value of network.host manually. Discovery.zen.minimum_master_nodes can be written manually or not, to ensure that the cluster_name is consistent and the node_name is inconsistent, and the es2.1.1 cluster can start normally.
PS:jdk is at least 1.7. for testing, ES_HEAP_SIZE does not have to write
The above is all the contents of the article "sample Analysis of elasticsearch-2.1.1 Cluster Construction". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
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.