我啓動了兩個乾淨的elasticsearch實例(節點),沒有數據,兩個不同的機器(一個窗口,一個osx)。他們成功發現了對方。一個是node.master:false。兩者都是node.data:true。我創建了Kibana(創建te .kibana索引),並創建了測試索引(test),number_of_replicas = 1,並且每個索引和集羣的狀態都是黃色,我相信這是因爲未分配的碎片。我不知道如何讓未分配的碎片來解決。ElasticSearch具有兩個節點(不同計算機)的未分配碎片,1個主要兩個新實例
在試圖迫使碎片我得到以下錯誤的複製:
shard cannot be allocated on same node [tNUHIE6cTHO6h37P_s3m7w] it already exists on
一些細節:
_cat /節點伏γ:
host ip heap.percent ram.percent load node.role master name
192.168.1.99 192.168.1.99 2 81 1.95 d * node1
192.168.1.2 192.168.1.2 13 46 -1.00 d - node2
節點1:_cluster/health
{
"cluster_name": "elasticsearch",
"status": "yellow",
"timed_out": false,
"number_of_nodes": 2,
"number_of_data_nodes": 2,
"active_primary_shards": 6,
"active_shards": 9,
"relocating_shards": 0,
"initializing_shards": 0,
"unassigned_shards": 3,
"delayed_unassigned_shards": 0,
"number_of_pending_tasks": 0,
"number_of_in_flight_fetch": 0,
"task_max_waiting_in_queue_millis": 0,
"active_shards_percent_as_number": 75
}
有在日誌中沒有任何錯誤,但如果我運行:
_cluster /重路由漂亮
{ "commands" : [ { "allocate" : { "index" : "test", "shard" : 1, "node" : "node2" } } ]
}
我得到如下回應:
{ "error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "[allocate] allocation of [test][1] on node { node2}{tNUHIE6cTHO6h37P_s3m7w}{192.168.1.2}{192.168.1.2:9300}{master=false} is not allowed,
reason: [YES(target node version [2.1.1] is same or newer than source node version [2.1.1])]
[YES(enough disk for shard on node, free: [111.6gb])]
[YES(shard not primary or relocation disabled)]
[YES(primary is already active)][YES(node passes include/exclude/require filters)]
[YES(allocation disabling is ignored)]
[NO(shard cannot be allocated on same node [tNUHIE6cTHO6h37P_s3m7w] it already exists on)]
[YES(total shard limit disabled: [index: -1, cluster: -1] <= 0)][YES(below shard recovery limit of [2])][YES(no allocation awareness enabled)][YES(allocation disabling is ignored)]"
}
],
...
"status": 400
}
_cat /碎片?v
index shard prirep state docs store ip node
test 3 p STARTED 0 130b 192.168.1.2 node2
test 3 r UNASSIGNED
test 4 r STARTED 0 130b 192.168.1.2 node2
test 4 p STARTED 0 130b 192.168.1.99 node1
test 1 p STARTED 0 130b 192.168.1.2 node2
test 1 r UNASSIGNED
test 2 r STARTED 0 130b 192.168.1.2 node2
test 2 p STARTED 0 130b 192.168.1.99 node1
test 0 r STARTED 0 130b 192.168.1.2 node2
test 0 p STARTED 0 130b 192.168.1.99 node1
.kibana 0 p STARTED 1 3.1kb 192.168.1.2 node2
.kibana 0 r UNASSIGNED
爲了解決這個問題,任何對新手的幫助都會很有幫助。
GET _cat/shards?v'的輸出是什麼? – bittusarkar
添加到問題。 –