1.es与es-head的搭建
1.1 es7.6.2
每个es都是自成一个集群,不同于solar还需要zk来搭建集群
1.1.1 下载安装
https://www.elastic.co/cn/downloads/past-releases/elasticsearch-7-6-2
因为占用内存实在是太大了,我在服务器上装了运行不起来,所以下载了win版本
1.1.2 配置文件
在\elasticsearch-7.6.2\config
下有3个重要的配置文件
- es.yml:这里面可以配置一些防止es-head跨域的问题
- jvm:配置运行时-xms -xmx,默认1g
- log4j:日志配置
1.1.3 运行
请求GET:localhost:9200,返回:
{
"name": "LAPTOP-B509V4L8",
"cluster_name": "elasticsearch",
"cluster_uuid": "vRtPJ-MWQNuOtrxrQZDdcw",
"version": {
"number": "7.6.2",
"build_flavor": "default",
"build_type": "zip",
"build_hash": "ef48eb35cf30adf4db14086e8aabd07ef6fb113f",
"build_date": "2020-03-26T06:34:37.794943Z",
"build_snapshot": false,
"lucene_version": "8.4.0",
"minimum_wire_compatibility_version": "6.8.0",
"minimum_index_compatibility_version": "6.0.0-beta1"
},
"tagline": "You Know, for Search"
}
因为是cmd运行,所以关掉cmd,或者ctrl+c就可以终止es程序了
1.2 es-head
1.2.1下载安装
https://github.com/mobz/elasticsearch-head
NPM安装脚本:
git clone git@github.com:mobz/elasticsearch-head.git
cd elasticsearch-head
npm install (这个时间比较长)
npm run start
浏览器输入http://localhost:9100/
1.2.2 跨域问题解决
在es的config中找到elasticsearch.yml,任意找个地方添加
## 开启跨域
http.cors.enabled: true
## 允许所有人访问
http.cors.allow-origin: "*"
然后重启es,就可以在head中连接到了
1.3 Kibana
下载的版本要与es一致
https://www.elastic.co/cn/downloads/past-releases/kibana-7-6-2
浏览器访问:localhost:5601