We are currently running Sonarqube 8.9 LTS, i would to know, if there is a easy way to delete Elastic search index automatically.
If there is a suggestion for Life cycle managemnt Policy then i imagine we cannot use it
, because we have specific triggers. Usually the restore of a database dump ,while elastic search is shutdown.
Could you share why you want to regularly delete the ES indices? It’s not recommended…
Not regularly , but if we restart the pod or create or it crashes
Then we have to manually delete the index.
i had an idea of using Curl command in Image build , so everytime a new pod will run it should first delete the files. But its complicated to make it automatic as the file names may differ in future.
or is there a way using Curl command to automate it .
I guess you’ve enabled persistence? It’s not recommended because it can result in corrupt ES indices. Maybe turn it back off & the problem just goes away?
Sorry i guess i cannot explain you in short description.
So i try again, we are currently running Sonarqube 8.9 LTS, on Openshift which is bound to a PV.
The Es data get stores in /opt/sonarqube/data in PV under “es7” currently. So everytime an event happen, we have to manually shut the Sonarqube pod, delete the “es*” directory and restart the pod.
so to avoid this basic manual process, i am looking for a automate process or is it also possible creating a Jenkins job for automatically deleting “es” folder in PV.
If you need more info please let me know .
As Ann mentioned, have you tried disabling persistence?
That should solve your issue.
@Jeremy_Davis How do i disable it ?
Sorry i guess i didnt get it.
Pardon me i am new Sonarqube user.
Can you please elaborate or share some references ?
Is it also possible to create a Jenkins pipeline , which can access the Volume, Delete the ESI diretory, unless doing it manually
If yes please suggest a way.
Sonarqube showing incorrect count of issues on dashboard - SonarQube - Sonar Community (sonarsource.com)
i found a topic where they suggested the same option of deleting /data/es and restarting the server.
Julien Lancelot and Nicolas Bontoux suggested the way .
so i would like to know a way to automate this process, rather than doing it manually.
Can you guide me a automatic way to delete data/es ?
we are facing same problem and we have to manually delete it.
i would like to automate the process .
Please guide me and some sample would be nice .
The documentation that Ann shared explains it.
where can i find this value ?
Can you please redirect me to the location.
You need to look in your own files for this value. Maybe just do a text search?
This is where i find something similar.
I cannot find the persistence:
enabled: false/true anywhere .
Its our Template for Openshift
Maybe take a look at your _Persistent_VolumeClaim?
okay i guess in my case it " cpr-tmp volume"
so i disable it and now it worked .
so thank you all for pointing the error guys.