coder
asked on
want to backup postgres database and elasticsearch from production
Hi Experts,
I want to backup Postgres database and copy the elasticsearch index to zip file from production.
Do have to do any safety steps before backup, since it is production.
Will there be any outage?
Any help is highly appreciated.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
1) With pg_dump you can leave the PostgreSQL daemon running.
If you copy over raw database files, best to do 1x sync (long), then shutdown PostgreSQL to do 2nd sync (fast), then restart.
2) With Elasticsearch I'm unsure.
My guess is so long a you aren't injecting new data into the index, you can leave the system live.
This really depends on if you inject new index data in bulk infrequently, or inject index data incrementally all the time.
Key here is to ensure all the index data is quiesced/static/dormant/un changing during backups... depending on your exact system implementation.
If you copy over raw database files, best to do 1x sync (long), then shutdown PostgreSQL to do 2nd sync (fast), then restart.
2) With Elasticsearch I'm unsure.
My guess is so long a you aren't injecting new data into the index, you can leave the system live.
This really depends on if you inject new index data in bulk infrequently, or inject index data incrementally all the time.
Key here is to ensure all the index data is quiesced/static/dormant/un
ASKER
Thanks David,
I had taken dump and I had also copied the elasticsearch index to another machine. My task is done and it is finished
I had taken dump and I had also copied the elasticsearch index to another machine. My task is done and it is finished
ASKER
Thanks for your response. My concern was Do I have to make the systems down while taking pg_dump or to copy the elasticsearch data from /var/lib/elasticsearch folder.
Today I had copied and taken a dump of Postgres with pg_dump. I haven't made the system down to copy to do this.
Thanks for your response. Now my task is done. But in future, I have to think of taking frequent backup and making the system up (something like mirroring, with two or three systems running parallel or do load balancing kind of stuff when one system is down, it can start the other system up. I have to think and we need to design the architecture for this in future)