elasticsearch can';t在教程中加载elasticsearch的演示数据
我从elasticsearch开始。在Sierra的Mac上安装了Elasticsearch和Kibana(没有错误)。现在,我尝试从演示数据开始,通过本教程探索ES: 一切正常,但我有两个问题: 1) 我有一个错误elasticsearch can';t在教程中加载elasticsearch的演示数据,elasticsearch,elasticsearch,我从elasticsearch开始。在Sierra的Mac上安装了Elasticsearch和Kibana(没有错误)。现在,我尝试从演示数据开始,通过本教程探索ES: 一切正常,但我有两个问题: 1) 我有一个错误 PUT/logstash-2015.05.20{…} 错误消息: { "error": { "root_cause": [ { "type": "index_already_exists_exception", "reason":
PUT/logstash-2015.05.20{…}
错误消息:
{
"error": {
"root_cause": [
{
"type": "index_already_exists_exception",
"reason": "index [logstash-2015.05.20/1i-pAxzaTpWscYud0Ufczg] already exists",
"index_uuid": "1i-pAxzaTpWscYud0Ufczg",
"index": "logstash-2015.05.20"
}
],
"type": "index_already_exists_exception",
"reason": "index [logstash-2015.05.20/1i-pAxzaTpWscYud0Ufczg] already exists",
"index_uuid": "1i-pAxzaTpWscYud0Ufczg",
"index": "logstash-2015.05.20"
},
"status": 400
}`
{
"statusCode": 400,
"error": "Bad Request",
"message": "child \"method\" fails because [\"method\" must be one of [HEAD, GET, POST, PUT, DELETE]]",
"validation": {
"source": "query",
"keys": [
"method"
]
}
}
如果索引已经存在,我可以忽略此消息吗?那么一切都会好起来吗
2) 即使在下一步,我也犯了一个错误:
curl -H 'Content-Type: application/x-ndjson' -XPOST 'localhost:9200/bank/account/_bulk?pretty' --data-binary @accounts.json`
错误消息:
{
"error": {
"root_cause": [
{
"type": "index_already_exists_exception",
"reason": "index [logstash-2015.05.20/1i-pAxzaTpWscYud0Ufczg] already exists",
"index_uuid": "1i-pAxzaTpWscYud0Ufczg",
"index": "logstash-2015.05.20"
}
],
"type": "index_already_exists_exception",
"reason": "index [logstash-2015.05.20/1i-pAxzaTpWscYud0Ufczg] already exists",
"index_uuid": "1i-pAxzaTpWscYud0Ufczg",
"index": "logstash-2015.05.20"
},
"status": 400
}`
{
"statusCode": 400,
"error": "Bad Request",
"message": "child \"method\" fails because [\"method\" must be one of [HEAD, GET, POST, PUT, DELETE]]",
"validation": {
"source": "query",
"keys": [
"method"
]
}
}
感谢您的帮助或提示。查看该文件。它包含一行用于索引/映射和其他设置
{"index":{"_id":"1"}}
文件本身的另一行:
{"account_number":1,"balance":39225,"firstname":"Amber","lastname":"Duke","age":32,"gender":"M","address":"880 Holmes Lane","employer":"Pyrami","email":"amberduke@pyrami.com","city":"Brogan","state":"IL"}
对于要使用\u bulk
api编制索引的每个文档,这两行都会重复。只要试着把其中一个文档放到你的索引中就行了
PUT localhost:9200/bank/account/1
{"account_number":1,"balance":39225,"firstname":"Amber","lastname":"Duke","age":32,"gender":"M","address":"880 Holmes Lane","employer":"Pyrami","email":"amberduke@pyrami.com","city":"Brogan","state":"IL"}
你熟悉chrome的
sense
插件吗?这对elasticsearch的开发非常有帮助:-)正如您所知,logstash正在尝试创建索引,您应该在运行logstash之前删除它。关于第二个错误,您是否在本地拥有account.json文件?从中复制一个文档并尝试将其添加到elastic(不是批量模式),我还没有安装logstash。这不是教程的一部分,所以我不安装它。第一个错误似乎是我的错误。我第二次开始创建索引。关于第二个错误:是的,我在本地有这个文件。但我不知道你的意思,我需要做什么。很抱歉我是ES的初学者。嗨,我病了,很抱歉我的回复太晚了:如果我在浏览器中尝试,我找不到uri[/localhost:9200/bank/account/1]和方法[PUT]的处理程序http://localhost:9200/banki get{“error”:{“root\u cause”:[{“type”:“index\u not\u found\u exception”,“reason”:“no-this index”,“resource.type”:“index\u or\u alias”,“resource.id”:“bank”、“index\u uuid”:“bank”}]、“type”:“index\u not\u found\u exception”、“reason”:“no-this index”、“resource.type”:“index\u or\u别名”、“resource.id”:“bank”、“index\u uuid”:“index\u”},“bank”},“status”:404
因此索引不存在!请提供http://localhost:9200/_cat/indices?v
索引已存在。因此我尝试重新安装所有,但即使这样也无济于事,错误依然存在。感谢您抽出时间。我将使用其他工具完成我的工作。