Docs/ELK/es学习记录02-异常处理.md
2022-10-18 16:59:37 +08:00

20 lines
868 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

### 启动失败,报
```
[1] bootstrap checks failed
[1]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
```
修改配置文件elasticsearch.yml文件至少一项配置放开即可discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes这里修改cluster.initial_master_nodes: : ["node-1"]
### 往es中写数据,报
```
curl -XPUT 127.0.0.1:9200/item/es/1?pretty -d '{"name": "wang", "age": 25}'
{
"error" : "Content-Type header [application/x-www-form-urlencoded] is not supported",
"status" : 406
}
```
写入数据时,加上-H 'content-Type:application/json' 即可,如下
```
curl -XPUT 127.0.0.1:9200/item/es/1?pretty -H 'content-Type:application/json' -d '{"name": "wang", "age": 25}'
```