Clustering with Bitbucket

This feature is only for customers with an active Bitbucket Data Center resources license.


Bitbucket Data Center allows you to run a cluster of multiple Bitbucket nodes, providing high availability, scalable capacity, and performance and scale. We’ll tell you about the benefits, and give you an overview of what you’ll need to run Bitbucket in a clustered environment.

Ready to get started? See Set up a Bitbucket Data Center cluster.


このページの内容

クラスタ化のメリット

クラスタリングは、連続アップタイム、すぐに利用できる拡張性、および高負荷下でのパフォーマンスを必要とする、大規模およびミッションクリティカルな Data Center デプロイメントを使用しているエンタープライズ向けに設計されています。

メリットの一部をご紹介します。

  • High availability and failover

    If one node in your cluster goes down, the others take on the load, ensuring your users have uninterrupted access to Bitbucket.

  • 大規模なパフォーマンス

    Each node added to your cluster increases concurrent user capacity, and improves response time as user activity grows.

  • Instant scalability

    Add new nodes to your cluster without downtime or additional licensing fees. Data and apps are automatically synced.

  • Upgrade with no downtime

    Perform a rolling upgrade to the latest bug fix update of your feature release, without any downtime. Apply critical bug fixes and security updates to your site while providing users with uninterrupted access to Bitbucket.

アーキテクチャ

次の画像は、一般的な構成を示しています。

A Bitbucket Data Center cluster consists of:

  • Multiple identical application nodes running Bitbucket Data Center.

  • トラフィックをすべてのアプリケーション ノードに分散するロード バランサ。

  • A shared file system that stores repositories, attachments, and other shared files. 

  • すべてのノードが読み取るおよび書き込むデータベース

  • An Elasticsearch instance that enables searching for projects, repositories, and code

All application nodes are active and process requests. A user will access the same Bitbucket node for all requests until their session times out, they log out, or a node is removed from the cluster. 

詳細

ライセンス

Data Center ライセンスは、ノードの数ではなくクラスタのユーザー数に基づきます。つまり、新しいサーバーや CPU に追加のライセンス料金は発生せず、いつでも環境を拡張できます。

You can monitor the available license seats in the Licensing page in the admin console.

このプロセスを自動化する(たとえば、割り当て限界に近づいた場合にアラートを送信する)場合は、REST API を使用することができます。

Your Bitbucket license determines which features and infrastructure choices are available. Head to Bitbucket Server and Data Center feature comparison for a full run down of the differences between a Server license and a Data Center license. 

ホーム ディレクトリ

To run Bitbucket in a cluster, you'll need an additional home directory, known as the shared home.

Each Bitbucket node has a local home that contains logs, caches, and temporary files. Everything else is stored in the shared home, which is accessible to each Bitbucket node in the cluster.

ローカル ホームと共有ホームの内容の概要は次のとおりです。

ローカル ホーム共有ホーム
  • logs

  • caches

  • temporary files

  • 設定ファイル

  • data directory with:

    • repositories

    • attachments

    • avatars

  • plugins

キャッシング

When clustered, Bitbucket uses a distributed cache that is managed using Hazelcast. Caches are kept in sync through remote invalidation instead of being replicated or partitioned across all the Bitbucket nodes in a cluster.

このキャッシュ ソリューションのため、遅延を最小化するには、ノードが物理的に同じ場所またはリージョン (AWS や Azure の場合) にある必要があります。

クラスタ ノード検出

クラスタ ノードを設定する場合、各クラスタノードの IP アドレスかマルチキャスト アドレスのいずれかを指定します。

マルチキャストを使用する場合:

Bitbucket will broadcast a join request on the multicast network address. Bitbucket must be able to open a UDP port on this multicast address, or it won't be able to find the other cluster nodes. Once the nodes are discovered, each responds with a unicast (normal) IP address and port where it can be contacted for cache updates. Bitbucket must be able to open a UDP port for regular communication with the other nodes.

マルチキャスト アドレスはクラスタ名から自動生成されるか、最初のノードのセットアップ時に自分で入力することができます。 

Elasticsearch

Elasticsearch provides search functionality for Bitbucket. It provides a fast, full-text search engine that enables searching for projects, repositories, and code within Bitbucket.

インフラストラクチャと要件

ハードウェアやインフラの選択はあなた次第です。以下はハードウェアおよびインフラストラクチャ要件を計画するときに考える必要がある領域です。

Deploying Bitbucket Data Center on AWS and Azure

If you plan to run Bitbucket Data Center on AWS or Azure, you can use our templates to deploy the whole infrastructure. You’ll get your Bitbucket Data Center nodes, Elasticsearch, database and storage all configured and ready to use in minutes. For more info, see the following resources:

サーバー要件

You should not run additional applications (other than core operating system services) on the same servers as Bitbucket. Running Bitbucket, Jira, and Confluence on a dedicated Atlassian software server works well for small installations but is discouraged when running at scale. 

Bitbucket Data Center can be run successfully on virtual machines.

クラスタ ノードの要件

各ノードはまったく同じである必要はありませんが、一貫性のあるパフォーマンスのために、可能な限り同質になるようにします。すべてのクラスタ ノードは以下を満たす必要があります。

  • be a dedicated machine, physical or virtual

  • 同じデータ センターまたはリージョン内にあること (AWS と Azure の場合)

  • be connected in a high speed LAN (that is, high bandwidth and low latency)

  • have the same OS, Java and application server version. See Supported platforms 

  • 同じメモリ設定(JVM と物理メモリの両方)(推奨)

  • be configured with the same time zone (and keep the current time synchronized). Using ntpd or a similar service is a good way to ensure this

  • Although a password is used to authenticate the nodes, we recommend that you use a firewall and/or network segregation to make sure that only specific nodes are allowed to connect to a Bitbucket cluster node’s Hazelcast port, which by default is port 5701

  You must ensure the clocks on your nodes don't diverge, as it can result in a range of problems with your cluster.

いくつのノードが必要ですか?

Your Data Center license does not restrict the number of nodes in your cluster. The right number of nodes depends on the size and shape of your Bitbucket instance, and the size of your nodes.

See our Bitbucket Data Center load profiles guide for help sizing your instance. In general, we recommend starting small and growing as you need.

データベース

You should ensure your intended database is listed in the current Supported platforms, with one exception: we do not support MySQL due to inherent deadlocks that can occur in this database engine at high load. The load on an average cluster solution is higher than on a standalone installation, so it is crucial to use a supported database.

データベースの高可用性のための追加要件

Running Bitbucket Data Center in a cluster removes the application server as a single point of failure. You can also do this for the database through the following supported configurations:

  • Amazon RDS Multi-AZ: this database setup features a primary database that replicates to a standby in a different availability zone. If the primary goes down, the standby takes its place.

  • Amazon PostgreSQL 互換 Aurora: 1 つ以上のリーダー (別のアベイラビリティ ゾーンを推奨) にレプリケートするデータベース ノードを備えたクラスタです。ライターが停止した場合、Aurora はライターの 1 つをプロモートして代わりにします。

The AWS Quick Start deployment option allows you to deploy Bitbucket Data Center with either one, from scratch. If you want to set up an Amazon Aurora cluster with an existing Bitbucket Data Center instance, refer to Configuring Bitbucket Data Center to work with Amazon Aurora.

共有ホームおよびストレージの要件

Bitbucket Data Center requires a high performance shared file system such as a SAN, NAS, RAID server, or high-performance file server optimized for I/O. 

  • The shared file system must run on a dedicated machine. 

  • The file system must be available to all cluster nodes via a high-speed LAN (it must be in the same physical data center). 

  • The shared file system should be accessible via NFS as a single mount point. 

  • Due to known performance issues, we only support NFSv3 at this time.

Load balancer

You can use the load balancer of your choice. Bitbucket Data Center does not bundle a load balancer.

  • Your load balancer should run on a dedicated machine.

  • Your load balancer must have a high-speed LAN connection to the Bitbucket cluster nodes (that is, high bandwidth and low latency). 

  • Your load balancer must support both HTTP mode (for web traffic) and TCP mode (for SSH traffic). 

  • Terminating SSL (HTTPS) at your load balancer and running plain HTTP from the load balancer to Bitbucket is highly recommended for performance. 

  • Your load balancer should support "session affinity" (also known as "sticky sessions").

  • If you don't have a preference for your load balancer, we provide instructions for haproxy, a popular Open Source software load balancer.

多くのロード バランサでは、プールから URL を自動的に削除するために、バックエンドの正常性を常に確認するための URL が必要です。これには、安定していて高速であるが、不要なリソースを消費しない程度に軽量な URL を使用することが重要です。次の URL は Jira のステータスを返し、この目的に使用することができます。 

URL期待される内容予想 HTTP ステータス
http://<bitbucketurl>/status{"state":"RUNNING"}200 OK
すべてのステータス コードとレスポンスを表示する...

HTTP ステータス コード

レスポンス エンティティ

説明

200

{"state":"RUNNING"}

通常実行

500

{"state":"ERROR"}

エラー状態

503

{"state":"STARTING"}

アプリケーションが起動

503

{"state":"STOPPING"}

アプリケーションが停止中

200

{"state":"FIRST_RUN"}

アプリケーションが初めて実行され、まだ設定されていない

404


アプリケーションが予期しない方法で起動に失敗(web アプリケーションのデプロイが失敗)

ノードが長いGCの一時停止などの小さな問題を、生き残ることができるよう監視を設定するときは、いくつかの推奨事項は、以下のとおりです。 

  • ノードを削除する前に2回連続して失敗を待ちます。

  • ノードがプールから削除される前に30秒と言うならば、ノードへの既存の接続が終了するのを許可します。  

For more info, see Load balancer configuration options or Install Bitbucket Data Center (section about configuring the load balancer).

ネットワークアダプタ

サーバー間の通信に個別のネットワーク アダプタを使用します。クラスタ ノードはサーバー間通信用の個別の物理ネットワーク(個別の NIC など)を持っている必要があります。これはクラスタの実行を高速および信頼性を高くするのに最適な方法です。その他のデータ ストリーミングを多数持つネットワークを介してクラスタ ノードに接続する場合、パフォーマンスの問題が発生する可能性があります。 

Elasticsearch ノード

Bitbucket Data Center requires a connection to a remote Elasticsearch installation to enable code search. Although code search is not critical for high availability, it is possible run a cluster of Elasticsearch nodes to achieve high availability for the Bitbucket's code search index. The easiest way to set up and deploy an Elasticsearch cluster for Bitbucket Data Center is to use the Amazon's Elasticsearch service, but you can also set up a remote Elasticsearch instance on your own hardware.

要件

  • Bitbucket Data Center currently works with Elasticsearch 5.5.1 - 5.5.3, 6.5.3, and 6.8.6.

  • Bitbucket Data Center can have only one remote connection to Elasticsearch for your cluster. 

  • This may be a standalone Elasticsearch installation or a clustered installation behind a load balancer. 

For more info, see Administer code search and How to install Elasticsearch.

アプリの互換性

The process for installing Marketplace apps (also known as add-ons) in a Bitbucket cluster is the same as for a standalone installation. You will not need to stop the cluster, or bring down any nodes to install or update an app. 

The Atlassian Marketplace indicates apps that are compatible with Bitbucket Data Center. Learn more about Data Center approved apps

準備はよろしいですか? 

Head to Set up a Bitbucket Data Center cluster for a step-by-step guide to enabling and configuring your cluster.

最終更新日 2022 年 5 月 9 日

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

はい
いいえ
この記事についてのフィードバックを送信する

このセクションの項目

Powered by Confluence and Scroll Viewport.