We welcome the attention of the public number: Patricia learn Java , Java push the field of dry goods daily articles, concerned that is free comes with no routine 100G massive study, interviews resources yo! !
Website: https://www.exception.site/elasticsearch/elasticsearch-download-install
Install Java
Before installing Elasticsearch, you need to install and configure the JDK, set the environment variable $JAVA_HOME
.
As we all know, Elasticsearch many versions, different versions reliance on Java are also different:
- Elasticsearch 5 requires Java 8 or later;
- Elasticsearch 6.5 began to support Java 11;
- Elasticsearch 7.0 start, built-in Java environment, so that the installation 7.0+ version will be a lot easier.
Download Elasticsearch
Elasticsearch visit the official website https://www.elastic.co/cn/downloads/elasticsearch download the installation package:
I downloaded Here is the MAC system Elasticsearch V7.1.0 version as a demo.
Decompression
After a successful download, unzip to the specified directory:
tar -zxvf elasticsearch-7.1.0-darwin-x86_64.tar.gz
After extracting the directory entry is structured as follows:
Elasticsearch directory, configuration file description and pay attention
Here probably answer in each directory, configuration file of the role:
table of Contents | Profiles | description |
---|---|---|
bin | Putting scripts, such as startup scripts elasticsearch, plug-in installation scripts. | |
config | elasticserch.yml | elasticsearch configuration files, such as cluster configuration, jvm configuration. |
jdk | java runtime environment | |
data | path.data | Data persistence file |
lib | Dependence in library | |
logs | path.log | 日志文件 |
modules | 包含的所有 ES 模块 | |
plugins | 包含的所有已安装的插件 |
注意点:
- 有些童鞋的机器内存可能不够,就需要修改 JVM 参数,配置文件路径为
config/jvm.options
,ES V7.1 版本默认为1g
, 老版本为2g
, 你可以自行修改。Xmx
和Xms
数值请设置相同;Xmx
不要超过机器内存的50%
;- 内存总量不要超过 30GB, 参见官方文档 https://www.elastic.co/cn/blog/a-heap-of-trouble;
运行 Elasticsearch
执行启动命令:
bin/elasticsearch
看到启动日志中有 started
关键字,就表示启动成功了。
另外,我们还可以通过访问 Elasticsearch 9200
端口来实际验证一下:
curl localhost:9200
返回了 Elasticsearch 相关元数据,如版本信息 7.1.0
,就明确表示大工告成,可以好好地玩耍了。
欢迎关注微信公众号: 小哈学Java
关注笔者的微信公众号: 小哈学Java, 每日第一时间推送干货文章, 另外, 笔者个人吐血整理了 100G 的学习资料, 关注回复「666」即可免费无套路领取哟~