In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to install and configure Elasticsearch in linux. It is very detailed and has a certain reference value. Friends who are interested must read it!
Elasticsearch is a distributed, free and open source search and analysis engine for all types of data, including text, numbers, geospatial, structured and unstructured data.
Elasticsearch 7.x
Brother Ma said that learning the technology stack depends on the version, so what are the good features of Elasticsearch 7.x?
ES 7.0 was released in April 2019, with Lucene 8.0 at the bottom. There are other things you need to know:
-abolish the support for multiple Type under a single index
-ES Security is free to use
-ECK-ES Operator on K8s
-New feature: New Cluster coordination
-New function: complete High Level REST Client
-New feature: Script Score Query
-performance: the default number of Primary Shard is from 5 to 1, avoiding Top K with faster Over Sharding; performance optimization
Elasticsearch 7.x installation steps
Download Elasticsearch 7.2.1
Download address: https://www.elastic.co/cn/downloads/elasticsearch
Elasticsearch 7.x installation and configuration guidance Elasticsearch 7.x installation and configuration guidance
As shown in the figure, download the required ES. My side is MacOS, so I downloaded the copy of MacOS directly. In addition, ES supports Docker startup. In addition, ES 7.x does not require local JDK environment support:
ES 5, installation requires JDK 8 or above
ES 6.5. installation requires JDK 11 or above.
ES 7.2.1 with JDK 12 built in
After downloading, the directory structure of the ES file is shown in the following figure:
Elasticsearch 7.x installation and configuration guidance Elasticsearch 7.x installation and configuration guidance
The directory structure of Elasticsearch 7.2.1 is as follows:
Bin: script files, including ES startup & install plug-ins, etc.
Config: elasticsearch.yml (ES profile), jvm.options (JVM profile), log profile, etc.
JDK: built-in JDK,JAVA_VERSION= "12.0.1"
Lib: class library
Logs: log fil
Modules: all ES modules, including X-pack, etc.
Plugins: the plug-in that ES has installed. There is no plug-in by default
Data: when ES starts, there will be this directory to store document data. This directory can be set up
Take a look at the key jvm.options JVM configuration files. The default configuration is as follows:
-Xms1g-Xmx1g
By default, the heap memory set by ES after installation is 1 GB, which must be less for any business. How much is the setting?
Recommendation: if you have enough memory, try not to exceed 32 GB. That is, the memory allocation of each node is no more than 32 GB. Because it wastes memory, degrades the performance of CPU, and makes GC cope with a lot of memory. If you want to keep it safe and reliable, setting the heap memory to 31 GB is a safe choice.
The reason for the above recommendation comes from "heap memory: size and swap editing": https://www.elastic.co/guide/cn/elasticsearch/guide/current/heap-sizing.html
2.2 launch Elasticsearch 7.2.1
The startup method is simple. Under the ES root directory, execute the startup script file:
Cd elasticsearch-7.2.1bin/elasticsearch
After running, the following log appears:
Future versions of Elasticsearch will require Java 11; your Java version from [/ Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre] does not meet this requirement... Omit [2019-08-16T16:29:53069] [INFO] [o.e.n.Node] [BYSocketdeMacBook-Pro-2.local] started [2019-08-16T16:29:53478] [INFO] [o.e.l.LicenseService] [BYSocketdeMacBook-Pro-2.local] license [ef60f54d-4964-4cb6-98ac-aafdc0f2a4c0] mode [basic]-valid [2019-08-16T16:29:53491] [INFO] [o.e.g.GatewayService] ] [BYSocketdeMacBook-Pro-2.local] recovered [0] indices into cluster_state [2019-08-16T16:30:23057] [INFO] [o.e.c.r.a.DiskThresholdMonitor] [BYSocketdeMacBook-Pro-2.local] low disk watermark [85%] exceeded on [DRs4DZO0SzCaYz3n3vA3Fg] [BYSocketdeMacBook-Pro-2.local] [/ javaee/es/elasticsearch-7.2.1/data/nodes/0] free: 49.2gb [10.6%] Replicas will not be assigned to this node
There are two pieces of information to note in the log:
The native environment is JDK 8, which reminds you that JDK 11 support is required for later versions. But it's backward compatible.
Indicates that the native ES started successfully [BYSocketdeMacBook-Pro-2.local] started
2.3 verify that the startup is successful
Open a browser, enter the http://localhost:9200/ address, and you can get the following information:
{"name": "BYSocketdeMacBook-Pro-2.local", "cluster_name": "elasticsearch", "cluster_uuid": "tc9h27oqSHKvGJb3qK2tPg", "version": {"number": "7.2.1", "build_flavor": "default", "build_type": "tar", "build_hash": "fe6cb20" "build_date": "2019-07-24T17:58:29.979462Z", "build_snapshot": false, "lucene_version": "8.0.0", "minimum_wire_compatibility_version": "6.8.0", "minimum_index_compatibility_version": "6.0.0-beta1"}, "tagline": "You Know, for Search"}
Just focus on a few key points:
-name: ES instance name is specified when starting by default, and name is BYSocketdeMacBook-Pro-2.local
-cluster_name: default name is elasticsearch
-version: version information
Also through the http://localhost:9200/_cat/nodes?v address, you can see the current node information, as follows:
127.0.0.1 30 100 22 2.87 mdi * BYSocketdeMacBook-Pro-2.local
2.4 installation of multiple ES instances in a stand-alone cluster
Multiple ES instances on a single machine form a pseudo-cluster on a single ES machine. The startup script is as follows:
Bin/elasticsearch-E node.name=node01-E cluster.name=bysocket_es_cluster-E path.data=node01_data-dbin/elasticsearch-E node.name=node02-E cluster.name=bysocket_es_cluster-E path.data=node02_data-dbin/elasticsearch-E node.name=node03-E cluster.name=bysocket_es_cluster-E path.data=node03_data-dbin/elasticsearch-E node.name=node04-E cluster.name=bysocket_es_cluster-E path.data=node04_data-d
The command is simply explained as follows:
Node.name: ES node name, that is, instance name
Cluster.name: ES cluster name
Path.data: specifies the directory where document data is stored
After executing the script, you need to wait a while for ES to start, or you can check logs to see how it works.
Elasticsearch 7.x installation and configuration guidance Elasticsearch 7.x installation and configuration guidance
Open the browser, enter the http://localhost:9200/_cat/nodes?v address, and you can see the startup: node01 is the current master node
How to shut down the ES instance in the cluster can be achieved with a simple command:
Ps | grep elasticsearchkill-9 pidElasticsearch 7.x plug-in Overview
Plug-ins are a way to enhance the functionality of Elasticsearch, divided into core plug-ins (official) & community plug-ins.
Install the analysis-icu ICU analysis plug-in with the following command:
Sudo bin/elasticsearch-plugin install analysis-icu
To view the installed plug-ins, the command is as follows:
Bin/elasticsearch-plugin list
Remove the installed plug-in with the following command:
Sudo bin/elasticsearch-plugin remove analysis-icu above is all the content of the article "how linux installs and configures Elasticsearch". Thank you for reading! Hope to share the content to help you, more related 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.