Follow

RBKB-2016-0002 How to backup and restore a master node in redBorder Live

How to backup and restore a master node in redBorder Live

 

 

The purpose of this document is to be a guide in making a master node backup and how to perform a master node restore in redborder live.

 

1 - Master node backup

There are a two possible destinations to perform the backup:

A. Store the data in a bucket in AWS remote.

To perform a backup in a s3 bucket it's mandatory to have created and configured a backup bucket in AWS. A detailed explanation of how do this from scratch can be found in Annex A.

The command that must be executed is:

user@master ~]# rb_backup_node.rb -b -s
Checking S3 access ... [ OK ]
The backup will be stored in s3://s3backupbucket/master-backup-2018-07-06.tar.gz ... [ OK ]
Chef-server backup in progress ...                                                                   [  OK  ]
Making backup of node master ...                                                                      [  OK  ]

B. Store the data in a file

The command that must be executed is:

user@master ~]# rb_backup_cluster.rb -b -f backup_file.tar.gz
Chef-server backup in progress ...                                                           [  OK  ]
Making backup of node master ...                                                              [  OK  ]

2 - Master node restore

There are some basic rules for restoring succesfully a master node in redborder live:

  1. The node that will be based to restore the master node must be corezk.
  2. Everything will be restored except manager nodes associated to the master node when backup was performed.

There are a two source posibilities to perform the restore:

A. Data stored in a file:

To perform a restore from a the command that must be executed is:

user@nodei2 ~]# rb_backup_node.rb -r -f backup_file.tar.gz
Changing nodei2 node name to master node name ... [ OK ]
Stoping all services ...                                                                              [  OK  ]
Restoring files ...                                                           [  OK  ]
Restoring postgresql service ...                                                                      [  OK  ]
Restoring chef-server database ...                                                                    [  OK  ]
Restoring cookbooks ...                                                                               [  OK  ]
Reconfiguring chef-server ...                                                                         [  OK  ]
Restarting chef services ...                                                                          [  OK  ]
Deleting node manager02 from cluster config ... [ OK ]
Deleting node manager03 from cluster config ... [ OK ]
Aplying new config (please, be patient) ... [ OK ]
Changing node IPs ... [ OK ]
Restoring nodei2 node name ... [ OK ]

 B. Data stored in a AWS Remote:

Work in progress.

 

Annex A . Creating a bucket in AWS

In AWS Panel, go to the section Storage & Content Delivery and click on the S3 option:

Now you are viewing the buckets you have in your AWS Service. To create a new bucket, press the Create Bucket button:

Name the bucket and select the region where you want to store the bucket and press the create button:

In order to have standard names in the guide we are going to name the bucket:

rb-backup-example

2. Create a user to access the buckets:

In AWS Panel, go to the section Security & Identity and click on the Identity & Access Management option:

Go to Users and press the Create New Users button:


Enter the username you want and press the create button:

Now you must write down the Access Key ID and the Secret Access Key:

3. Give bucket access and control permissions to the user:

Go to Users and select the user you created before. Then, go to Permissions and press the Attach Policy button:

Select Policy Generator and press the Select button:

Now we need to allow access and modification permissions to the bucket that we created before. To do that, two ARN statements must be created for the bucket we want to give the permissions to. For example, if we have a bucket named rb-bucket-example, the ARN statements we need to create are:

arn:aws:s3:::rb-bucket-example

arn:aws:s3:::rb-bucket-example/*

Once the statements have been added, press the Next Step button:

And apply the policy:

Annex B - Configuring clusters for backup

The backup segments of the Remote S3 must be configured in the cluster.

Go to Tools -> General Settings and click on “Backup segments (Remote S3)” to reveal the options.


Then we need to fill out the appropriate parameters:

  • Access key, secret key and hostname are the same in all clusters.
  • The Bucket field depends on the cluster being configured because you are linking the cluster itself with the AWS S3 bucket you created before.
Have more questions? Submit a request

Comments

Powered by Zendesk