ElasticSearch5.6.3 安装步骤
2017-11-17 11:09
447 查看
环境准备
1.操作系统:CentOS7.32.JDK1.8
安装须知: elasticsearch-5.x的版本要求JDK1.8以上,所以安装前,确保每台服务器已经安装JDK1.8及以上版本。
集群准备
elasticsearch-5.6.3.tar.gzelasticsearch-HQ-master.zip
集群安装
机器安排:
192.168.102.30(默认master node)192.168.102.31
192.168.102.32
1. 下载elasticsearch(简称:ES)安装包
# wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.3.tar.gz[/code]# tar -zxvf elasticsearch-5.6.3.tar.gz2. 修改配置文件
cd elasticsearch-5.6.3
vim config/elasticsearch.yml
添加以下配置(以下是192.168.102.30机器上的配置,其他机器对应修改):shell cluster.name: elasticsearch #集群里的每台服务都要一致 node.name: node1 #每台服务器节点都不一样 node.master: true #是否为master network.host: 192.168.102.30 #本机ip http.port: 9200 #本机端口 transport.tcp.port: 9300 #Java client调用 discovery.zen.ping.unicast.hosts: ["192.168.102.30:9300","192.168.102.31:9300","192.168.102.32:9300"] path.data: /data/comm_apps/elasticsearch-5.6.3/data path.logs: /data/comm_apps/elasticsearch-5.6.3/logs3. 配置足够内存
# vim /data/comm_apps/elasticsearch-5.6.3/config/jvm.options -Xms2g -Xmx2g4. 配置环境变量
# vim /etc/profile export ES_HOME=/data/comm_apps/elasticsearch-5.6.3 # source /etc/profile5.启动elasticsearch
# cd elasticsearch-5.6.3 && /bin/elasticsearch -d6.验证服务是否启动:
# netstat -tnl | grep 9200或者ps -ef | grep elasticsearch常用插件安装
head插件
目前都只安装在192.168.102.30这台服务器上
检查node环境,查看是否安装命令:node -v
请确保已经安装nodejs6.0版本以上1. 下载插件包:
# wget https://codeload.github.com/mobz/elasticsearch-head/zip/master[/code]
解压:unzip elasticsearch-head-master.zip2. 安装插件:
# cd elasticsearch-head-master# npm install3. ElasticSearch整合elasticsearch-head插件:
# cd elasticsearch-5.6.3# vim config/elasticsearch.yml4. 在配置文件的最后加上运行head插件跨域访问rest接口
http.cors.enabled: truehttp.cors.allow-origin: "*"http.cors.allow-credentials: true5. 启动插件:
输出日志:npm run startStarted connect web server on http://localhost:9100[/code] 表示启动成功
能成功访问http://localhost:9100IK分词插件
每台机器都需要安装
以插件形式安装:# cd elasticsearch-5.6.3# ./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v5.6.3/elasticsearch-analysis-ik-5.6.3.zip[/code]
访问:http://192.168.102.30:9200/_analyze?analyzer=ik_max_word&text=中华人民共和国&pretty=trueElastic HQ插件
1. 下载
# wget https://github.com/royrusso/elasticsearch-HQ/archive/master.zip[/code]2. 解压
# unzip elasticsearch-HQ-master.zip3. 安装
# cd elasticsearch-HQ-master4. 启动
以下二选一:# python -m SimpleHTTPServer(前台启动)# nohup python -m SimpleHTTPServer > elasticsearch-HQ.file 2>&1 &(后台启动)5. 验证是否安装成功
访问http://192.168.102.30:8000/#cluster问题解决
问题一
解决办法:
错误一:max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
办法:修改/etc/security/limits.conf文件,添加或修改如下行:es hard nofile 65536es soft nofile 65536
错误二:max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
办法:
原因:最大虚拟内存太小
root用户执行命令:sysctl -w vm.max_map_count=262144临时添加echo "vm.max_map_count=262144" >> /etc/sysctl.conf永久添加
注意:修改完后都需要重启服务器才能生效问题二
ES有执行脚本的能力,因安全因素,不能在root用户下运行,强行运行会报如下错误:
org.elasticsearch.bootstrap.StartupException:
java.lang.RuntimeException: can not run elasticsearch as root
解决方案:shell groupadd es #增加es组 useradd es -g es -p pwd #增加es用户并附加到es组 chown -R es:es elasticsearch-5.6.3 #给目录权限 su es #使用es用户 ./bin/elasticsearch -d #后台运行es
相关文章推荐
- CentOS7下安装elasticsearch5.6.3
- ELK elasticsearch+kibana+logstash 躲坑指南 安装步骤
- 补充篇 基于linux centos 7安装elasticsearch5.6.3(最新版)教程
- Windows下安装elasticSearch5.6.3和head插件
- 分布式搜索Elasticsearch——安装
- Elasticsearch & plugins(ELK+kafka+filebeat) 安装教程
- 搜索引擎ElasticSearchV5.4.2系列二之ElasticSearchV5.4.2+kibanaV5.4.2+x-packV5.4.2安装
- MAC Elasticsearch安装
- 【参考】cents ElasticSearch 5.0及head插件安装 参考配置
- ElasticSearch之—— ElasticSearch5.x安装中一些问题的解决办法
- ELK(Elasticsearch/Logstash/Kibana)安装时常见错误总结
- Elasticsearch之—— 5.X head插件安装实例
- elasticsearch相关插件安装
- elasticsearch系列一:elasticsearch(ES简介、安装&配置、集成Ikanalyzer)
- windows 下安装elasticsearch
- CentOS 7.x安装ELK(Elasticsearch+Logstash+Kibana)
- elasticsearch入门指南(二)elasticsearch-head插件的安装
- elasticsearch marvel插件安装失败的解决方法
- elasticsearch windows 安装head插件
- 分布式搜索Elasticsearch——安装