Hi,
after successfully upgrading from Wazuh OpenDistro for Elasticsearch to Wazuh OpenSearch/indexer there are 2 unassigned shards left.
I have tried to delete them (not sure if this is the best solution) but it failed with limited permissions for the admin user. Please have a look.
# Cluster health
{
"cluster_name" : "wazuh-elastic-prod",
"status" : "red",
"timed_out" : false,
"number_of_nodes" : 3,
"number_of_data_nodes" : 3,
"discovered_master" : true,
"active_primary_shards" : 313,
"active_shards" : 600,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 2,
"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" : 99.66777408637874
}
# More details about unassinged Shards:
curl -XGET -k '
https://10.xx.127.xxx:9200/_cluster/allocation/explain?pretty' -u admin:xxxx
{
"index" : ".opendistro-anomaly-detection-state",
"shard" : 0,
"primary" : true,
"current_state" : "unassigned",
"unassigned_info" : {
"reason" : "NODE_LEFT",
"at" : "2022-11-09T13:58:29.684Z",
"details" : "node_left [4xD3yXhnTvm1x1mJbRBorg]",
"last_allocation_status" : "no_valid_shard_copy"
},
"can_allocate" : "no_valid_shard_copy",
"allocate_explanation" : "cannot allocate because a previous copy of the primary shard existed but can no longer be found on the nodes in the cluster",
"node_allocation_decisions" : [
{
"node_id" : "44xOg6txSIOt89MYSA9qXw",
"node_name" : "wazuh-el3",
"transport_address" : "10.xxxxxxxxxxx:9300",
"node_attributes" : {
"shard_indexing_pressure_enabled" : "true"
},
"node_decision" : "no",
"store" : {
"found" : false
}
},
{
"node_id" : "Knb5hZhoQ8inmuvsBfGAxw",
"node_name" : "wazuh-el2",
"transport_address" : "10.xxxxxxxxxxx:9300",
"node_attributes" : {
"shard_indexing_pressure_enabled" : "true"
},
"node_decision" : "no",
"store" : {
"found" : false
}
},
{
"node_id" : "Z98KPjvkSt2Y9mcIEAankg",
"node_name" : "wazuh-el1",
"transport_address" : "10.xxxxxxxxxxxxxxxx:9300",
"node_attributes" : {
"shard_indexing_pressure_enabled" : "true"
},
"node_decision" : "no",
"store" : {
"found" : false
}
}
]
}
# Deleting the unassigned shards which fail:
curl -XGET -k '
https://10.xxxxxxxxx:9200/_cat/shards' -u admin:xxxxxxxxx | grep UNASSIGNED | awk {'print $1'} | xargs -i curl -XDELETE -k -u admin:xxxxxxxxxxxxxx "
https://10.xxxxxxxxxx:9200/{}"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 66804 100 66804 0 0 593k 0 --:--:-- --:--:-- --:--:-- 593k
{"error":{"root_cause":[{"type":"security_exception","reason":"no permissions for [] and User [name=admin, backend_roles=[admin], requestedTenant=null]"}],"type":"security_exception","reason":"no permissions for [] and User [name=admin, backend_roles=[admin], requestedTenant=null]"},"status":403}{"error":{"root_cause":[{"type":"security_exception","reason":"no permissions for [] and User [name=admin, backend_roles=[admin], requestedTenant=null]"}],"type":"security_exception","reason":"no permissions for [] and User [name=admin, backend_roles=[admin], requestedTenant=null]"},"status
Any ideas how to delete the unassigned shards and / or a better approach than deleting the unassigned shards?
Many thanks
Rainer