Backup v.s. Snapshot API for Solr

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Backup v.s. Snapshot API for Solr

Kayak28
Hello, Community Members:

I have tested the behaviors of Backup API and Snapshot API, which are
written in the URL below.
https://lucene.apache.org/solr/guide/7_4/making-and-restoring-backups.html#making-and-restoring-backups
()

As far as I observed the behavior of Backup API, I now know the followings:
-  Solr's back up simply means to make a copy of a full-sized index.
- Solr's restore means to make another copy of a full-sized index from a
backup directory and refer the copy as the index.
- Backup / Restore APIs belong to Replication Handler.

Also, I know the following for Snapshot API.
- Solr can make a snapshot at any time (i.e. does not matter if it is after
commit/backup/ restore..)
- snapshot_N contains a name of the snapshot(commitName) and the
current Index path.
- N in snapshot_N is the identical number to segments_N.

I believe, by observing the Snapshot API behavior, it is impossible to
"backup" or "restore" Solr's Index.
So, my questions are"
- What is the difference between Backup API and Snapshot API?
   The above Solr's Guide says "The snapshot functionality is different
from the backup functionality as the index files aren’t copied anywhere." But,
then how Snapshot API help me to make a backup?

- Or, more basically, when should I use Snapshot API?

- What is the rule of thumb operation for Solr's backup system?

Sincerely,
Kaya Ota
Reply | Threaded
Open this post in threaded view
|

Re: Backup v.s. Snapshot API for Solr

Paras Lehana
Hey Kaya,

Are you not able to restore with the same restore backup command?

http://localhost:8983/solr/gettingstarted/replication?command=restore&name=backup_name


Replace backup_name with the snapshot name.

On Fri, 22 Nov 2019 at 11:26, Kayak28 <[hidden email]> wrote:

> Hello, Community Members:
>
> I have tested the behaviors of Backup API and Snapshot API, which are
> written in the URL below.
>
> https://lucene.apache.org/solr/guide/7_4/making-and-restoring-backups.html#making-and-restoring-backups
> ()
>
> As far as I observed the behavior of Backup API, I now know the followings:
> -  Solr's back up simply means to make a copy of a full-sized index.
> - Solr's restore means to make another copy of a full-sized index from a
> backup directory and refer the copy as the index.
> - Backup / Restore APIs belong to Replication Handler.
>
> Also, I know the following for Snapshot API.
> - Solr can make a snapshot at any time (i.e. does not matter if it is after
> commit/backup/ restore..)
> - snapshot_N contains a name of the snapshot(commitName) and the
> current Index path.
> - N in snapshot_N is the identical number to segments_N.
>
> I believe, by observing the Snapshot API behavior, it is impossible to
> "backup" or "restore" Solr's Index.
> So, my questions are"
> - What is the difference between Backup API and Snapshot API?
>    The above Solr's Guide says "The snapshot functionality is different
> from the backup functionality as the index files aren’t copied anywhere."
> But,
> then how Snapshot API help me to make a backup?
>
> - Or, more basically, when should I use Snapshot API?
>
> - What is the rule of thumb operation for Solr's backup system?
>
> Sincerely,
> Kaya Ota
>


--
--
Regards,

*Paras Lehana* [65871]
Development Engineer, Auto-Suggest,
IndiaMART Intermesh Ltd.

8th Floor, Tower A, Advant-Navis Business Park, Sector 142,
Noida, UP, IN - 201303

Mob.: +91-9560911996
Work: 01203916600 | Extn:  *8173*

--
IMPORTANT: 
NEVER share your IndiaMART OTP/ Password with anyone.
Reply | Threaded
Open this post in threaded view
|

Re: Backup v.s. Snapshot API for Solr

Kayak28
Hello, Mr. Paras:

Thank you for your response, and I apologize for confusing you.

Actually, I can do restore by /replication hander.
What I did not get the idea is, how to use the following URLs, which are
from the "Making And Restoring Backups" section of the Solr Reference
Guide.

1. http://localhost:8983/solr/admin/cores?action=CREATESNAPSHOT&core=techproducts&commitName=commit1
2. http://localhost:8983/solr/admin/cores?action=LISTSNAPSHOTS&core=techproducts&commitName=commit1
3. http://localhost:8983/solr/admin/cores?action=DELETESNAPSHOT&core=techproducts&commitName=commit1


It seems like "Snapshot", made by  CREATESNAPSHOT API, hold the path to the
index and commit name only.

How can I use a "snapshot", which is generated by  CREATESNAPSHOT API?


Sincerely,
Kaya Ota
Reply | Threaded
Open this post in threaded view
|

Re: Backup v.s. Snapshot API for Solr

Paras Lehana
Hi Kaya,

Sorry that I still cannot understand. Once you have created a snapshot with
CREATESNAPSHOT, you can restore the snapshot with same replication restore
command, right?

How can I use a "snapshot", which is generated by  CREATESNAPSHOT API?


You just used the name to restore the backup. Please try to explain what is
your use case and what do you want to achieve. Maybe I'm not able to
understand your query so I'll appreciate if someone else helps.

On Mon, 25 Nov 2019 at 12:21, Kayak28 <[hidden email]> wrote:

> Hello, Mr. Paras:
>
> Thank you for your response, and I apologize for confusing you.
>
> Actually, I can do restore by /replication hander.
> What I did not get the idea is, how to use the following URLs, which are
> from the "Making And Restoring Backups" section of the Solr Reference
> Guide.
>
> 1.
> http://localhost:8983/solr/admin/cores?action=CREATESNAPSHOT&core=techproducts&commitName=commit1
> 2.
> http://localhost:8983/solr/admin/cores?action=LISTSNAPSHOTS&core=techproducts&commitName=commit1
> 3.
> http://localhost:8983/solr/admin/cores?action=DELETESNAPSHOT&core=techproducts&commitName=commit1
>
>
> It seems like "Snapshot", made by  CREATESNAPSHOT API, hold the path to the
> index and commit name only.
>
> How can I use a "snapshot", which is generated by  CREATESNAPSHOT API?
>
>
> Sincerely,
> Kaya Ota
>


--
--
Regards,

*Paras Lehana* [65871]
Development Engineer, Auto-Suggest,
IndiaMART Intermesh Ltd.

8th Floor, Tower A, Advant-Navis Business Park, Sector 142,
Noida, UP, IN - 201303

Mob.: +91-9560911996
Work: 01203916600 | Extn:  *8173*

--
IMPORTANT: 
NEVER share your IndiaMART OTP/ Password with anyone.
Reply | Threaded
Open this post in threaded view
|

Re: Backup v.s. Snapshot API for Solr

Kayak28
Hello, Mr. Paras and Community Members:

>Once you have created a snapshot with
>CREATESNAPSHOT, you can restore the snapshot with same replication restore
>command, right?

Is it?

As far as I know,
CREATESNAPSHOT is an action to create a file, named snapshot_N, under
data/snapshot_metadata directory.

The snapshot_N is a binary file, which contains the path to the index and
the commit name you defined like below.


> ?×l solr-snapshots
> commit1:/home/vagrant/solr-7.4.0/server/solr/core1/data/index/
>
commit1 is the commit name I named and /home/vagrant/.... is the path to my
index.

My question is,  having the path to the index and the commit name, how is a
snapshot possible to restore my index?
Or is the CREATESNAPSHOT command only available for Solr Cloud mode?
(whereas my case is standalone)

I should try with SolrCloud Mode later.
Then, I wll execute CREATESNAPSHOT and restore command, let's see if I can
really restore my index on CloudMode.
I only played with a standalone mode.


2019年11月26日(火) 19:26 Paras Lehana <[hidden email]>:

> Hi Kaya,
>
> Sorry that I still cannot understand. Once you have created a snapshot with
> CREATESNAPSHOT, you can restore the snapshot with same replication restore
> command, right?
>
> How can I use a "snapshot", which is generated by  CREATESNAPSHOT API?
>
>
> You just used the name to restore the backup. Please try to explain what is
> your use case and what do you want to achieve. Maybe I'm not able to
> understand your query so I'll appreciate if someone else helps.
>
> On Mon, 25 Nov 2019 at 12:21, Kayak28 <[hidden email]> wrote:
>
> > Hello, Mr. Paras:
> >
> > Thank you for your response, and I apologize for confusing you.
> >
> > Actually, I can do restore by /replication hander.
> > What I did not get the idea is, how to use the following URLs, which are
> > from the "Making And Restoring Backups" section of the Solr Reference
> > Guide.
> >
> > 1.
> >
> http://localhost:8983/solr/admin/cores?action=CREATESNAPSHOT&core=techproducts&commitName=commit1
> > 2.
> >
> http://localhost:8983/solr/admin/cores?action=LISTSNAPSHOTS&core=techproducts&commitName=commit1
> > 3.
> >
> http://localhost:8983/solr/admin/cores?action=DELETESNAPSHOT&core=techproducts&commitName=commit1
> >
> >
> > It seems like "Snapshot", made by  CREATESNAPSHOT API, hold the path to
> the
> > index and commit name only.
> >
> > How can I use a "snapshot", which is generated by  CREATESNAPSHOT API?
> >
> >
> > Sincerely,
> > Kaya Ota
> >
>
>
> --
> --
> Regards,
>
> *Paras Lehana* [65871]
> Development Engineer, Auto-Suggest,
> IndiaMART Intermesh Ltd.
>
> 8th Floor, Tower A, Advant-Navis Business Park, Sector 142,
> Noida, UP, IN - 201303
>
> Mob.: +91-9560911996
> Work: 01203916600 | Extn:  *8173*
>
> --
> IMPORTANT:
> NEVER share your IndiaMART OTP/ Password with anyone.
>