Elastic Search Index

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.

Regards

Hi,

Could you share why you want to regularly delete the ES indices? It’s not recommended…

 
Ann

Hello,
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 .

Hi,

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?

 
Ann

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 .
Regards

Hi,

As Ann mentioned, have you tried disabling persistence?
That should solve your issue.

Jay

@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.

Regards

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.
Regards

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 .
Regards

The documentation that Ann shared explains it.

It’s in values.yaml:

 persistence:
   enabled: false
1 Like

where can i find this value ?
Can you please redirect me to the location.
Regards

Hi,

You need to look in your own files for this value. Maybe just do a text search?

 
Ann

Per


This is where i find something similar.
I cannot find the persistence:
enabled: false/true anywhere .
Its our Template for Openshift
Regards

Hi,

Maybe take a look at your _Persistent_VolumeClaim?

 
Ann

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.
Cheers