Automation of data store garbage collection | Community
Skip to main content
Level 2
Aug 19, 2016 3:58 PM UTC

Automation of data store garbage collection

Hi All,

I'm trying to automate the data store garbage collection through the curl command given in below link :

https://docs.adobe.com/docs/en/aem/6-0/administer/operations/data-store-garbage-collection.html

Curl command: 

     
1
curl -u admin:xyz -X POST --data markOnly=false http://localhost:4502/system/console/jmx/org.apache.jackrabbit.oak%3Aid%3D14%2Cname%3D%22repository+manager%22%2Ctype%3D%22RepositoryManagement%22/op/startDataStoreGC/boolean
 

But not able to get the correct response. When we hit the URL given in the curl command it is giving us the 404 error message as it is unable to find the operations "runDataStoreGarbageCollection". When I hit the url without the operations (shared below), it is able to find  but unable to open the operation as it is opened as a pop-up. Please advise on how to automate data store garbage collection.

curl -u admin:admin -X POST http://localhost:4502/system/console/jmx/com.adobe.granite:type=Repository

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

15 replies

joerghoh
Employee
Aug 25, 2016 7:07 PM UTC

Make sure you get the quoting right, otherwise the Shell interprets characters like "&".

Jörg

Translate
antoniom5495929
Level 7
Aug 19, 2016 4:29 PM UTC

If you try to open the url from the system console, you have a 404?

something like: system/console/jmx/org.apache.jackrabbit.oak%3Aid%3D14%2Cname%3D%22repository+manager%22%2Ctype%3D%22RepositoryManagement%22

Translate
Swathi1Author
Level 2
Aug 19, 2016 5:40 PM UTC

Hi,

Without /op/startDataStoreGC/boolean in the URL, I'm able to open jmx console. But with /op/... I'm getting 404. Please see the attachment.

Translate
Employee
Aug 19, 2016 6:51 PM UTC

Hi Swati,

there is an error in the docs, please try the command below I used for 6.2

curl -u admin:admin -X POST --data markOnly=false http://localhost:4502/system/console/jmx/org.apache.jackrabbit.oak:id=14,name="repository manager",type="RepositoryManagement"/op/startDataStoreGC/boolean

The docs also claim that the above command will return after Datastore Garbage Collection(DSGC) has completed, this is incorrect. The curl command returns almost immediately, but the DSGC process is still running on the server. You can check the logs to see when the DSGC process has completed, it is because of this reason that you may be able to initiate DSGC, but you would have to check the logs to see when it finished or whether it finished without any errors.

For anyone using a 6.2 shared datastore setup, then please don't try and automate DSGC, as you would have to run DSGC in mark only mode on all servers and wait for the mark phase to complete, before attempting to run it with mark only false i.e. sweep mode, otherwise you will get an error:

26.07.2016 13:42:23.526 *ERROR* [sling-oak-observation-746] org.apache.jackrabbit.oak.plugins.blob.MarkSweepGarbageCollector Not all repositories have marked references available : [7e86561f-ca7e-4365-834b-0992b95001ae] 26

Regards,

Opkar

Translate