客快物流大数据项目(三十六):安装ElasticSearch-7.6.1
目录
安装ElasticSearch-7.6.1
一、配置ES
| 操作步骤 |
说明 |
| 1 |
进入软件包所在目录 |
| cd /export/softwares |
|
| 2 |
下载ES-7.6.1 |
| curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.6.1-linux-x86_64.tar.gz |
|
| 3 |
解压ES |
| tar -zxf elasticsearch-7.6.1-linux-x86_64.tar.gz -C /export/services/ |
|
| 4 |
创建ES软连接 |
| cd /export/services/ |
|
| ln -s elasticsearch-7.6.1 es |
|
| 5 |
配置环境变量 |
| export ES_HOME=/export/softwares/es |
|
| 6 |
添加ES的用户 |
| useradd es |
|
| 7 |
设置ES安装包的权限 |
| chown es:es -R elasticsearch-7.6.1 |
|
| chown es:es -R es |
|
| 8 |
配置jvm.options |
| vim /export/services/es/config/jvm.options |
|
| |
|
| 9 |
配置elasticsearch.yml |
| vim /export/services/es/config/elasticsearch.yml |
|
| |
二、操作系统配置
| 操作步骤 |
说明 |
| 1 |
Es要求禁用交换空间,配置永久关闭swap |
| vim /etc/fstab |
|
| |
|
| 2 |
设置es用户最大打开文件数 |
| echo "es - nofile 65535" >> /etc/security/limits.conf |
|
| 3 |
设置es用户最少可创建4096个线程 |
| echo "es - nproc 4096" >> /etc/security/limits.conf |
|
| 4 |
设置ES使用mmapfs存储索引的最大值 |
| sysctl -w vm.max_map_count=262144 |
三、运行ES
| 操作步骤 |
说明 |
| 1 |
切换到es用户下 |
| su - es |
|
| 2 |
启动 |
| cd /export/services/es/ |
|
| nohup ./bin/elasticsearch & |
|
| 3 |
注意(如果启动提示权限问题) |
| 问题1:java.io.FileNotFoundException: /export/services/es/logs/it-logistics-cluster_server.json (Permission denied) |
|
| 问题1的解决方法:chown es:es -R /export/services/es/logs/* |
|
| 问题2:java.nio.file.AccessDeniedException: /export/services/es/config/elasticsearch.keystore |
|
| 问题2的解决方法:chown es:es -R /export/services/es/ config/elasticsearch.keystore |
|
| 4 |
再次启动 |
| nohup ./bin/elasticsearch & |
|
| 5 |
查看WebUI |
| 在浏览器中输入http://node2:9200 |
|
| 6 |
使用_cat接口查询集群信息 |
| 在浏览器中输入http://node2:9200/_cat |
|
- 📢博客主页:https://lansonli.blog.csdn.net
- 📢欢迎点赞 👍 收藏 ⭐留言 📝 如有错误敬请指正!
- 📢本文由 Lansonli 原创,首发于 CSDN博客🙉
- 📢大数据系列文章会每天更新,停下休息的时候不要忘了别人还在奔跑,希望大家抓紧时间学习,全力奔赴更美好的生活✨
文章来源: lansonli.blog.csdn.net,作者:Lansonli,版权归原作者所有,如需转载,请联系作者。
原文链接:lansonli.blog.csdn.net/article/details/122803728
- 点赞
- 收藏
- 关注作者


评论(0)