Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically load database dump at container startup #44

Closed
supasteev0 opened this issue Oct 12, 2020 · 1 comment
Closed

Automatically load database dump at container startup #44

supasteev0 opened this issue Oct 12, 2020 · 1 comment

Comments

@supasteev0
Copy link

Hi,

I would like to know if there would be a way to start the aerospike-server container and automatically restore a dump after the server has started.
My goal is to provide an easy way for developers to start the container with a dump from staging or production (mounted as volume or burnt into a custom image), so that they can work locally with a dataset from one of these environment.

I have not find anything in the entrypoint that could make this possible.
I know that official Postgresql or mongodb images provide this kind of feature, as you can run a script or load a dump that is located in a folder like /docker-entrypoint-initdb.d. The script is run after the server is started so that you can automate any task, such as a database restore, create users , etc ..., when the container starts.

Is a feature like this planned in the future ?
Or could you provide some guidance in order to achieve this ?

Thank you for your help

@volmarl
Copy link
Contributor

volmarl commented Oct 19, 2020

This is more of a docker automation in running a script post startup. This could be a shell script that runs asbackup and asrestore inline. Please see Section 5-3:

https://discuss.aerospike.com/t/how-to-migrate-aerospike-from-one-cluster-to-another/1281

and

# Example
asbackup -h SOURCE_NODE_IP -n NAMESPACE_NAME --outputfile - | asrestore -h TARGET_NODE_IP --inputfile - --unique

More details on asrestore options that could be run from within the container.

https://www.aerospike.com/docs/tools/backup/asrestore.html

@volmarl volmarl closed this as completed Nov 6, 2020
pvinh-spike pushed a commit that referenced this issue Jun 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants