ElasticSearch5.6.3 安装步骤

如题所述

第1个回答  2022-06-10

1.操作系统:CentOS7.3
2.JDK1.8
安装须知: elasticsearch-5.x的版本要求JDK1.8以上,所以安装前,确保每台服务器已经 安装JDK1.8 及以上版本。

# cd elasticsearch-5.6.3 && /bin/elasticsearch -d

# netstat -tnl | grep 9200 或者 ps -ef | grep elasticsearch

目前都只安装在192.168.102.30这台服务器上
检查node环境,查看是否安装命令:node -v
请确保已经安装nodejs6.0版本以上

# wget https://codeload.github.com/mobz/elasticsearch-head/zip/master
解压:
unzip elasticsearch-head-master.zip

# cd elasticsearch-head-master
# npm install

# cd elasticsearch-5.6.3
# vim config/elasticsearch.yml

http.cors.allowed:true
http.cors.allow-origin:"*"

输出日志: Started connect web server on http://localhost:9100 表示启动成功
能成功访问 http://localhost:9100

每台机器都需要安装
以插件形式安装:
# 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
访问:
http://192.168.102.30:9200/_analyze?analyzer=ik_max_word&text=中华人民共和国&pretty=true

# wget https://github.com/royrusso/elasticsearch-HQ/archive/master.zip

# unzip elasticsearch-HQ-master.zip

# cd elasticsearch-HQ-master

以下二选一:
# python -m SimpleHTTPServer(前台启动)
# nohup python -m SimpleHTTPServer > elasticsearch-HQ.file 2>&1 &(后台启动)

访问 http://192.168.102.30:8000/#cluster

ES有执行脚本的能力,因安全因素,不能在root用户下运行,强行运行会报如下错误:
org.elasticsearch.bootstrap.StartupException:
java.lang.RuntimeException: can not run elasticsearch as root

相似回答