Menu
e-lo
  • Home
    • Tech
    • Inspiration and about
  • Database
    • T-SQL
    • SQL Server quick
    • SQL server docs
    • MySql quick sheet
    • Postgre
    • InfluxDB
  • Programming
    • Automating the boring stuff
    • Python 101
    • Python Docs
    • Python Logging
    • cSharp Overview
    • Powershell Latest
    • Powershell 4 lang ref
  • Linux
    • Top CMD’s
    • Useful CMD Linux
    • ss64 Linux
    • Ubuntu
    • 30 things Ubuntu 18.04
  • Azure
    • AZ-104-MS Azure Administrator 101 quick ref
    • ARM Docs
    • ARM Tutorial
    • Azure PS ref
    • Azure CLI ref
    • Deployment scripts (intern/extern)
    • ARM Quickstart
    • ARM templates 4h
  • AzAdm
    • AD 101
    • Governance and Compliance 102
    • Administration 103
    • Virtual Networking 104
    • Storage 107 (With table (NoSQL and more))
    • Virtual Machines 108
    • Azure Virtual Machines 101
    • Monitor VM (and market)
  • Zen
    • Not thinking about anything is Zen
e-lo

Apache Solr 7.5 Build book_store index backup / restore

Posted on October 23, 2018October 23, 2018 by espenk

https://lucene.apache.org/solr/guide/6_6/making-and-restoring-backups.html

If you are worried about data loss, and of course you should be, you need a way to back up your Solr indexes so that you can recover quickly in case of catastrophic failure.

Solr provides two approaches to backing up and restoring Solr cores or collections, depending on how you are running Solr. If you run in SolrCloud mode, you will use the Collections API. If you run Solr in standalone mode, you will use the replication handler.

 

The backup API requires sending a command to the /replication handler to back up the system.

You can trigger a back-up with an HTTP command like this (replace “gettingstarted” with the name of the core you are working with):

http://localhost:8983/solr/book_store/replication?command=backup

 

The backup request can also take the following additional parameters:

location:

The path where the backup will be created. If the path is not absolute then the backup path will be relative to Solr’s instance directory.

name:

The snapshot will be created in a directory called snapshot.<name>. If a name is not specified then the directory name would have the following format: snapshot.<yyyyMMddHHmmssSSS>

numberToKeep:

The number of backups to keep. If maxNumberOfBackups has been specified on the replication handler in solrconfig.xml, maxNumberOfBackups is always used and attempts to use numberToKeep will cause an error. Also, this parameter is not taken into consideration if the backup name is specified. More information about maxNumberOfBackups can be found in the section Configuring the ReplicationHandler.

repository:

The name of the repository to be used for the backup. If no repository is specified then the local filesystem repository will be used automatically.

commitName:

The name of the commit which was used while taking a snapshot using the CREATESNAPSHOT command.

 

Backup status:

The backup operation can be monitored to see if it has completed by sending the details command to the /replication handler, as in this example:

http://localhost:8983/solr/book_store/replication?command=details

 

 

Now lets have a look in the Solr’s instance directory:

And there we have and the name/ localtion/etc according to the documentation, lets make a new backup and add a name to it.

http://localhost:8983/solr/book_store/replication?command=backup&name=backup1

And there we have it.

Next step, delete all items and restore from snapshot.backup1:

Delete and check that all is removed:

Now, for the magic, lets restore:

http://localhost:8983/solr/book_store/replication?command=restore&name=backup1

 

And here the index is back…..

 

 

Next Standalone Mode Backups:

Backups and restoration uses Solr’s replication handler. Out of the box, Solr includes implicit support for replication so this API can be used. Configuration of the replication handler can, however, be customized by defining your own replication handler in solrconfig.xml

RSS Azure

  • Azure and HITRUST publish shared responsibility matrix January 14, 2021

RSS Python

  • PEP 649: Deferred Evaluation Of Annotations Using Descriptors January 11, 2021

Cloud

ARM (7) azure (22) cmd (1) Django (4) Docker (1) e-lo (2) Flask (2) Github (9) Grafana (2) Information (1) Information Retrieval (11) JAVA (1) kivy (2) Kotlin (4) linux (11) mobile (2) Natural Language Prossesing (NLP) (2) Net.Core (1) Networking and Security (2) OPC (2) PEP8 (1) Philosophy (3) Python (41) Python Networking and Security (2) Reason (2) RMQ (2) Solr (11) Sql (10) VSC (1) Warframe (2) WMVARE (4) Zabbix (7)

Recent Posts

  • 2 TODO MS ARM Template 4h
  • TODO Cryptography with Python – Caesar Cipher
  • 3 TODO Udemy AZ-104 Microsoft Azure Administrator Exam Certification (Scott Duffy)
  • 1 TODO ARM Lab 104 MS (Deployment and more)
  • TODO Prerequisites for Azure administrators 101

Archives

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
©2021 e-lo | Powered by WordPress & Superb Themes