Closed Bug 805861 Opened 12 years ago Closed 12 years ago

create a script to save an index

Categories

(Marketplace Graveyard :: Search, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
2012-11-15

People

(Reporter: tarek, Assigned: jason)

References

Details

ES Indexes take a long time to build, we should start to use the snapshot feature in case something goes wrong on a reindexation
Target Milestone: --- → 2012-11-01
Is this a dev bug or an ops bug?
Assignee: nobody → tarek
it's a devops bug ? :)

I guess we need to :

1/ try out the snapshot feature on -dev [ops]
2/ build a script that calls this feature [dev]
3/ hook it in the reindex command  [dev]
Blocks: 763722
Jason, would you organize #1 with Tarek?
Assignee: tarek → jthomas
From IRC:

< oremj> tarek: I think we are using the default gateway
< oremj> and the snapshot docs say they don't work with the default gw
< oremj> sounds like a snapshot with the default gateway just means copying the storage

I guess we could provide a system script to run this backup, we can invoke from Django's command machinery.
I created a script that tars the index data on each node for a specified index [1].

It takes around 5 minutes to backup addons_dev index and 45 minutes to backup addons_dev_stats index.

To perform a restore we will need restore the tar on each node and perform a full cluster restart. I will be testing the restore tomorrow from 6AM-7AM PST. 

[1] https://gist.github.com/4035724
Target Milestone: 2012-11-01 → 2012-11-15
During today's testing I performed the following on the addons dev/stage elasticsearch cluster:

1. Created a backup of addons_dev-20121024062906 index using script.
2. Deleted addons_dev-20121024062906 from elasticsearch. This broke addons-dev.allizom.org search.
3. Stopped elasticsearch on all nodes.
4. Restored backup of addons_dev-20121024062906 index to elasticsearch.
5. Started elasticsearch on all nodes. Verified addons_dev alias and addons_dev-20121024062906 index is available in elasticsearch.
6. Tested addons-dev.allizom.org search, looks okay.
cool!

out of curiosity, how big is the backup ? can we do this every day ?
(this == 1.)
(In reply to Tarek Ziadé (:tarek) from comment #7)
> cool!
> 
> out of curiosity, how big is the backup ? can we do this every day ?

Compressed addons_dev index is ~400MB, addons_dev_stats is ~4GB.

We can configure this via cron to run every day and remove backups older than 7 days. How does that sound?
(In reply to Jason Thomas [:jason] from comment #9)
> (In reply to Tarek Ziadé (:tarek) from comment #7)
> > cool!
> > 
> > out of curiosity, how big is the backup ? can we do this every day ?
> 
> Compressed addons_dev index is ~400MB, addons_dev_stats is ~4GB.
> 
> We can configure this via cron to run every day and remove backups older
> than 7 days. How does that sound?

Sounds good to me
Added backup cron to dev/stage and prod for addons indices.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.