April 13, 2020
Estimated Post Reading Time ~

Datastore garbage collection

My instance had 12GB datastore

$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda5 169G 73G 88G 46% /
none 5.9G 672K 5.9G 1% /dev
none 5.9G 196K 5.9G 1% /dev/shm
none 5.9G 104K 5.9G 1% /var/run
none 5.9G 0 5.9G 0% /var/lock
/dev/sda2 98G 12G 81G 13% /mnt/datastore


I ran datastore garbage collection, which ran for 5 hours. and it's now 2GB:
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda5 169G 73G 88G 46% /
none 5.9G 672K 5.9G 1% /dev
none 5.9G 296K 5.9G 1% /dev/shm
none 5.9G 108K 5.9G 1% /var/run
none 5.9G 0 5.9G 0% /var/lock
/dev/sda2 98G 2.0G 91G 3% /mnt/datastore


I have datastore out of crx-quickstart on a different drive for easy back up.. etc.
<DataStore class="com.day.crx.core.data.ClusterDataStore">
<param name="path" value="/mnt/datastore"/>
</DataStore>

The script for running datastore garbage collection is here:

#!/bin/bash

if (( $# < 1))
then
echo "Usage: $0 host:port"
echo "example"
echo " $0 localhost:4502 < admin-password.txt"
exit 1
fi

h="$1"
user="admin"
workspace="crx.default"
read -s -p "password for admin> " password
cookie=$(tempfile --suffix=".cookie")

echo "logging in to $workspace as $user"
curl -f -s -c "$cookie" \
-F"_charset_=UTF-8" \
-F"UserId=$user" \
-F"Password=$password" \
-F"Workspace=$workspace" "http://$h/crx/login.jsp" &&
echo "got cookie: $cookie" &&
curl -f -s -b "$cookie" \
-F"memGc=checked" \
-F"delete=checked" \
-F"pmScan=checked" \
-F"sleep=10" \
-F"action=run" "http://$h/crx/config/datastore_gc.jsp"


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.