Step 1
Graylog Backup Data
First we need to stop all the service of elasticsearch graylog-server
service elasticsearch stop
service graylog-server stop
Step 2
Now we are going to take dump backup from mongodb.
Mongo has content and setting of graylog. Use the below command to take dump backup.
logger -s -i “Dumping MongoDB” mkdir -p /u01/backup-graylogDB mongodump -h 127.0.0.1 -d graylog -o /u01/backup-graylogDB
This one for backup the contents and settings with data.
loger -s -i “Dumping MongoDB” tar -zcf /u01/backup-graylogDB/elasticsearch.tar.gz --directory=/var/lib/elasticsearch graylog
By default graylog indices have 12 gb by compressing it will reduce the size and save disk size.
Step 3
Graylog Restore Data
We need to stop the service like above.
Now untar the compress backup files with below command
tar xzf graylog.dump.tar.gz
tar xzf elasticsearch.tar.gz
Now restore the mongo Database with below command.
mongorestore -d graylog ./graylog
Now move the elasticsearch backup to their path.
mv elasticsearch /var/lib/elasticsearch
Now start the services of elasticsearch and graylog-server
service graylog-server start
service elasticsearch start
That’s all.
No comments:
Post a Comment