Using Bitbucket DIY Backup in AWS

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

デプロイ方法としての AWS クイック スタート テンプレートはアトラシアンではサポートされなくなりましたテンプレートは今後も利用できますが、保守や更新は行われません。

より効率的で堅牢なインフラストラクチャと運用のセットアップのために、Helm チャートを使用して Data Center 製品を Kubernetes クラスターにデプロイすることをお勧めします。Kubernetes へのデプロイに関する詳細はこちらをご確認ください。

AWS は、現在、AWS クイック スタート テンプレートで使用される起動設定を起動テンプレートに切り替えることを推奨していますが、AWS クイック スタート テンプレートのサポートは終了しているため、アトラシアンではこの切り替えを行う予定はありません。そのため、このテンプレートを使用して起動設定を作成することはできません。

This page describes considerations for DIY Backup and Restore of Bitbucket instances deployed in an Amazon Web Services (AWS) environment.

About Bitbucket Server DIY Backup for AWS

The Bitbucket Server DIY Backup tools fully support backup and restore of Bitbucket instances deployed on Amazon Elastic Block Store (EBS) volumes and/or Amazon Relational Database Service (RDS) instances.

The tools work by taking EBS and/or RDS snapshots of Bitbucket's database and shared home directory volume. These snapshots can later be launched as new EBS volumes and/or RDS instances, and attached to your running instance, thus restoring Bitbucket to a specific point in time.

The benefits of using native Amazon EBS and RDS support in Bitbucket Server DIY Backup are:

  • taking AWS native snapshots are faster than filesystem level copying
  • backup-associated downtimes can be eliminated
  • the snapshots are stored with the redundancy and durability of S3
  • it makes it easy to relocate an instance to a different Region or Availability Zone in the future

The scripts use the AWS CLI toolset, which is included in all instances launched from the AMI, regardless of the method you used to launch it.

BitbucketServer.template または BitbucketDataCenter.template 経由で Bitbucket インスタンスを起動した場合、EC2 ノードはすでに IAM ロールに所属していて、EBS ボリュームおよび/または RDS インスタンスのバックアップおよび復元に必要な権限を付与するポリシーが適用されています。AWS での Bitbucket インスタンスの起動にこれらの CloudFormation テンプレートのいずれかを使用しなかった場合、下記の「インスタンス ロールのセット アップ」セクションで、同様の権限を持つサンプル ポリシーをご確認ください。

Configuring the Bitbucket Server DIY Backup in AWS

If you launched your Bitbucket instance via BitbucketServer.template or BitbucketDataCenter.template, there is already a copy of the Bitbucket Server DIY Backup tools pre-installed and pre-configured on your instance. Just SSH to your instance (the shared file server node in the case of Bitbucket Data Center), and run:

cd /opt/atlassian/bitbucket-diy-backup
git pull
./bitbucket.diy-backup.sh 

If you launched your Bitbucket instance in AWS manually, you need to clone the Bitbucket Server DIY Backup repository and configure the variables manually.

git clone git@bitbucket.org:atlassianlabs/atlassian-bitbucket-diy-backup.git
cd atlassian-bitbucket-diy-backup
cp -i bitbucket.diy-backup.vars.sh.example-aws bitbucket.diy-backup.vars.sh

次に、bitbucket.diy-backup.vars.sh を環境に合わせて編集します。

Once you have configured bitbucket.diy-backup.vars.sh correctly, you can then run your backups by typing:

./bitbucket.diy-backup.sh

詳細については、「Bitbucket のゼロ ダウンタイム バックアップ」を参照してください。

Setting up the instance role

The DIY backup and restore scripts use the AWS CLI toolset to do their job. These tools need to authenticate with AWS in order to gain access to your resources (EBS volumes, snapshots, etc). The recommended way of providing credentials to the instance is by launching it with an instance role that has a suitable policy attached. If you are using the Bitbucket Server CloudFormation template, it'll take care of creating a policy for you and attach it to the instance at launch time.

If you need to create your own policy, you can use this JSON object as an example of the minimum permissions required for an instance:

{
    "Statement": [
        {
            "Resource": [
                "*"
            ],
            "Action": [
                "ec2:AttachVolume",
                "ec2:CreateSnapshot",
                "ec2:CreateTags",
                "ec2:CreateVolume",
                "ec2:DescribeSnapshots",
                "ec2:DescribeVolumes",
				"ec2:DetachVolume"
            ],
            "Effect": "Allow"
        }
    ],
    "Version": "2012-10-17"
}

For other ways of configuring the AWS CLI toolset, please refer to the documentation.

Last modified on Mar 10, 2021

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.