单实例安装
1、官网下载tar压缩包 https://www.elastic.co/downloads/elasticsearch
2、将下载好的压缩包elasticsearch-5.5.2.tar.gz上传到linux服务器,并解压缩 tar -vxf elasticsearch-5.5.2.tar.gz
3、cd进入到elasticsearch-5.5.2目录中,启动elasticsearch服务命令 sh ./bin/elasticsearch (启动需要java环境1.8)当输出日志有started关键字,则启动成功
4、elasticsearch默认监听127.0.0.1:9200,浏览器输入地址,测试启动成功
http://img.mukewang.com/60af9734000113c818330645.jpg
安装 elasticsearch-head
修改 elasticsearch/config/elasticsearch.yml添加http.cors.enabled: true
http.cors.allow-origin: "*"下载 elasticsearch-head 或者 git clone 到随便一个文件夹安装nodejscd /path/to/elasticsearch-headnpm install -g grunt-clinpm installgrunt serverhttp://localhost:9100/Enjoy it.
分布式安装
Elasticsearch 常用配置参数总结
https://www.cnblogs.com/zhiqiangzhang/p/11425473.html
将一个服务指定为master.在config的elasticserach.yml作以下配置:
http.cors.enabled: true
http.cors.allow-origin: “*”
cluster.name: lijiafang
node.name: master
node.master: true
network.host: 127.0.0.1
配置节点
cluster.name: lijiafang
node.name: slave1
network.host: 127.0.0.1
http.port: 8200
discovery.zen.ping.unicast.hosts: [“127.0.0.1”]