下载地址https://www.elastic.co/downloads/elasticsearch
下载后将ElasticSearch解压到/usr/local目录,这是我习惯的软件安装目录
进入ElasticSearch
cd /usr/local/elasticsearch-7.9.2/启动 es
/bin/elasticsearch如有报错则给整个目录读写权限
在浏览器中访问http://localhost:9200/,出现下面内容表示安装成功。
{ "name" : "192.168.0.100", "cluster_name" : "elasticsearch", "cluster_uuid" : "nGNmNm5cSF6W_m_iFejQGw", "version" : { "number" : "7.9.2", "build_flavor" : "default", "build_type" : "tar", "build_hash" : "d34da0ea4a966c4e49417f2da2f244e3e97b4e6e", "build_date" : "2020-09-23T00:45:33.626720Z", "build_snapshot" : false, "lucene_version" : "8.6.2", "minimum_wire_compatibility_version" : "6.8.0", "minimum_index_compatibility_version" : "6.0.0-beta1" }, "tagline" : "You Know, for Search" }使用Git下载ElasticSearch-head到ElasticSearch的解压目录下
git clone git://github.com/mobz/elasticsearch-head.git进入ElasticSearch-head的目录
cd /usr/local/elasticsearch-7.9.2/elasticsearch-head安装并启动elasticsearch-head插件
npm install npm run start在浏览器中运行http://localhost:9100/,出现以下情况表示成功
在9100端口访问9200端口涉及跨域问题,因此要配置ElasticSearch允许插件访问,打开ElasticSearch配置文件
sudo vim /usr/local/elasticsearch-7.9.2/config/elasticsearch.yml添加下面两句
http.cors.enabled: true http.cors.allow-origin: "*"出现如下内容表示配置成功