elasticsearch 踩坑

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

 

posted @ 2019-03-28 14:39  人在江湖之诗和远方  阅读(323)  评论(0编辑  收藏  举报