Continuity
Disaster Recovery
To prevent any disaster, ensure you take the recommended backup of the Datalayer services.
tip
Contact us for any question. We are here to help.
Backup
Take recurring backups with a S3 SolrBackup.
kubectl apply -f $PLANE_HOME/etc/specs/solr/datalayer-backup-s3.yaml
kubectl get solrbackups -n datalayer-solr -w
# NAMESPACE NAME CLOUD STARTED FINISHED SUCCESSFUL NEXTBACKUP AGE
# datalayer-solr datalayer-solr-collection-backup solr-datalayer 44s 44s
kubectl describe solrbackups -n datalayer-solr
aws s3 ls s3://datalayer-backups-solr/datalayer-solr-collection-backup-accounts/accounts/
curl http://localhost:8983/solr/accounts/replication?command=details
kubectl delete -f $PLANE_HOME/etc/specs/solr/datalayer-backup-s3.yaml
Simulate a Disaster
Delete Solr documents.
for COLLECTION in accounts credits invites spaces tweets usage
do
curl http://localhost:8983/solr/$COLLECTION/update?commitWithin=500 -d '{ delete: { query: "*:*" } }'
done
... or delete and re-create empty collections before running the restore.
# export SOLR_HOME=.../opt/solr # Install Solr on your local machine https://solr.apache.org (you will need java - sudo apt install default-jre)
for COLLECTION in accounts credits invites spaces tweets usage
do
curl http://localhost:8983/solr/$COLLECTION/update?commitWithin=500 -d '{ delete: { query: "*:*" } }'
curl http://localhost:8983/solr/admin/collections?action=DELETE -d "name=${COLLECTION}"
$SOLR_HOME/bin/solr create -c $COLLECTION -shards 3 -replicationFactor 3 -d $PLANE_HOME/etc/dockerfiles/datalayer-solr/config/ -p 8983 -force
done
Restore from a Disaster
Run the effective restore.
# Restore https://solr.apache.org/guide/8_11/collectimanagement.html#restore
#
# backupId=10& # You may want to force the backupId, if not provided, the last one (most recent one) will be used.
#
for COLLECTION in accounts credits invites spaces tweets
do
echo
echo Restoring Solr "$COLLECTION" collection
echo ---------------------------------------
curl http://localhost:8983/solr/admin/collections -d '
action=RESTORE&
repository=s3&
collection='"$COLLECTION"'&
location=s3:/&
name=datalayer-solr-collection-backup-'"$COLLECTION"''
done
#
curl http://localhost:8983/solr/accounts/select?q=*:*
# curl http://localhost:8983/solr/accounts/update?commitWithin=500 -d '{ delete: { query: "*:*" } }'