I gracefully shutdown my graylog server > opensearch > mongodb and reboot. After the reboot, all indexed segment gone and from the search page of graylog. Index is still here but all historical indexed segment disappear. However, the index shard is still in the harddisk but somehow Opensearch cannot link them together,
I ran [ wget -q ‘http://localhost:9200/_cat/indices?v’ -O- ] also cannot return old archived index segment . latest segment of all indexes reset to 0, but no red index.
Could I still recover my previous indexes ?
Env,
Graylog 5.1.4+6fa2de3 on xxx (Eclipse Adoptium 17.0.8 on Linux 5.14.0-284.18.1.el9_2.x86_64)
So the server shutdown and Opensearch can not find your index sets, hence why there set to 0.
Check your data path that is configured in Opensearch YAMl file. Should be something like this path.data: /var/lib/opensearch
If the data path moved or was on a different volume and the volume detached this could happen. They should still be there unless there were deleted. But now if the new index set were create it probably wont attach to those original ones.
I have no idea why that happened to you. Like I mentioned , the only way I know of why you instance created a new Index set would be the Data Path, or you data was on a different volume and was detached. I never seen a index vanish from a reboot unless a configuration was made but not save and reboot set configuration back prior.
I finally figured out why the index disappeared. after the server reboot , I found the previous indices in /var/lib/opensearch/nodes/nodes/0 !! ( 1 more nodes in the path depth )
I think Opensearch found that no indices could be found in original path in /var/lib/opensearch/nodes/0, it automatically recreated another set of index. Can I simply copy the index shard to original path and let Opensearch import it automatically ?
Ah that makes sense, so it was the data path location.
Not that I know of, once in a index set the only way is through snapshots/Restore
Couple options:
1.you can either reset the data path to your orginal settings and restart Opensearch or leave it as is.
2.Next option is alittle harder. create a snapshot of the new index set that opensearch created then adjust you data path back to the original settins and restart opensearch. you can restore the new snapshot to a different index set.
Here is some info on that.
EDIT: One of the reason I suggested to use the snapshot is beacue now you have dups of thos eindex sets, but I havent tried this you might be able to do something like this, it may not work. your find it in this documentation