elasticsearch 踩坑

2022-11-04,

1、elasticsearch head安装

集群连不上,修改配置

add http.cors.enabled: true
you must also set http.cors.allow-origin because no origin allowed by default. http.cors.allow-origin: "*" is valid value, however it’s considered as a security risk as your cluster is open to cross origin from anywhere.

https://github.com/mobz/elasticsearch-head

启动命令

npm run start

2、Spring boot 启动连不上

cluster-nodes: 127.0.0.1:9300

端口号问题

1.9300端口: ES节点之间通讯使用
2.9200端口: ES节点 和 外部 通讯使用
9300是tcp通讯端口,集群间和TCPClient都走的它;9200是http协议的RESTful接口

3、spring boot es 配置

缺少cluster-name

elasticsearch 踩坑的相关教程结束。

《elasticsearch 踩坑.doc》

下载本文的Word格式文档,以方便收藏与打印。