0
elasticsearch-head 不能连接管理elasticsearch
命令行运行grunt server
grunt server
Running "connect:server" (connect) task
Waiting forever...
Started connect web server on http://localhost:9100
打开http://localhost:9100进入管理页面, 填写好地址点连接, 然后连接不上elasticsearch , 浏览器错误详情提示不安全
Firefox Console: 已拦截跨源请求:同源策略禁止读取位于 http://localhost:9200/ 的远程资源。(原因:CORS 头缺少 'Access-Control-Allow-Origin')。
Chrome Console: XMLHttpRequest cannot load http://localhost:9200/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:9100' is therefore not allowed access.
Recommend
相关搜索关键词
Recent search keywords
- iptv+smart+player
- JAC+8229B
- Savings+Account
- 4th+generation
- Personal+Loan+Account
- clash+tun
- Oneplus+8t
- galaxy+s24+ultra
- checking+system+health+gpt
- Indian+Rupee+Ngultrum
- Kuwaiti+Dinar
- PlayWright
- solid+state
- Slim+odan
- radio+setup
- mlc+llm
- junsun+v1+pro+c,+radio+setup
- AGGIORNAMENTO+ROM+AC8227L+-+Android+JCAC10003-OC2
- checking+system+health
- read+only
- Ergonomic+Frozen+Shirt
- unidoc+health
- tab+4
- YT9217b+firmware
- Northern+Mariana+Islands
- utunnel
- read only
- radio
- 著作權
- M3U8
- 鸿蒙
- Japan
- @@neb61
- Laptop Rental - All Major Brand Laptops For Rent in Mumbai
- yt9213aj
- galaxy s24 ultra
- alwinner
- nat geo
- AGGIORNAMENTO ROM AC8227L - Android JCAC10003-OC2
- wulu
- office
- offcie
- gospel americano
- junsun v1 pro c, radio setup
- radio setup
- AC8227L Android head unit 4gb/32gb
- K4811_NWD_S217206
- unidoc health
- 5ber
- YT9217b
- YT9217b firmware
- HW8227L
- tinystudio
- Slim odan
- Slim
- clash tun
- tun
- 国模
- 中文数据集
- 北邮人论坛十大_2024_04_18
- 北邮人论坛十大_2024_03_23
- JAC 8229B
- JCAC10003-OC2-V1.0.03B21041
- JCAC10003-OC2-V1.0.03B1
- atrust
- dallas.lu
- 知情同意的
- checking system health gpt
- checking system health
- iptv smart player
- LLM
- MLC
- mlc llm
- k4811_oh_s217101
- 8257 logo
- logo
- Oneplus 8t
- Kernel
- tab 4
- JCAC10003-OC2-V1.0.071R5-230413_0757
- SCSI
- incentivize
- Ergonomic Frozen Shirt
- Producer
- 4th generation
- parsing
- Berkshire
- Multi-tiered
- copy
- teal
- Hills
- card
- Wooden
- Northern Mariana Islands
- deliver
- syndicate
- Money Market Account
- Assurance
- Representative
- compress
因为端口不一样, 所以浏览器自带的安全策略是不允许去请求不同源的资源。
修改Elasticsearch配置
elasticsearch.yml 添加下面配置,重启后即可生效
可以用 Nginx 做下反代, 然后加下Header。然后地址改为http://localhost:9201
之前也是碰到楼主上面的问题,跨域问题~ 修改elasticsearch 的 elasticsearch.yml 文件后解决,版本都是5.x 版本~
http.host: 192.168.x.x (elasticsearch 的ip 一般 elasticsearch 和 head 是同一台上面~) http.cors.enabled: true http.cors.allow-origin: "*"
因为都是内网的IP所以还是
http.cors.allow-origin: "*"
简单暴力好用