リモート Elasticsearch インスタンスのインストールと構成
このページでは、Bitbucket Data Center で機能するようにリモート Elasticsearch インスタンスをプロビジョニングする方法について説明します。
Bitbucket Data Center にはリモート Elasticsearch インスタンスがバンドルまたはインストールされないため、Bitbucket Data Center 用にリモート Elasticsearch インスタンスを用意する必要があります。
Bitbucket Data Center はクラスタの Elasticsearch へのリモート接続を 1 つのみ持つことができます。これは、スタンドアロンの Elasticsearch インストールまたはロード バランサの背後のクラスタ化されたインストールにすることができます。
トラブルシューティングのヒントやよくある質問を含む、Bitbucket による Elasticsearch の使用方法の詳細については、「コード検索の管理」ページを参照してください。
Bitbucket Data Center will only work with Elasticsearch 2.3.5.
ステップ 1: リモート マシンに Elasticsearch をインストールする
We don't provide specific instructions for installing Elasticsearch, but a good place to start is the Elasticsearch (2.3) installation instructions. Elastic provides installation packages in several different formats on their downloads page. Note that the authentication plugin – Buckler, described within the Secure Elasticsearch section – only supports versions 2.3 of Elasticsearch. Refer to the Supported platforms - Additional Tools section to see the current Elasticsearch release we support.
ステップ 2: Elasticsearch を構成する
The elasticsearch.yml
file contains configuration details for your Elasticsearch instance.
リモート Elasticsearch インスタンスを構成する方法
- Locate the
elasticsearch.yml
file within the configuration directory of your Elasticsearch (2.3) instance.
Add these parameters to your
elasticsearch.yml
fileindex.mapper.dynamic: false action.auto_create_index: false network.host: 0.0.0.0
Third party plugins, such as Elastic's Shield plugin, may require specific exceptions to be set foraction.auto_create_index
. Consult your provider's documentation for more information.
ステップ 3: Elasticsearch を保護する
リモート Elasticsearch インスタンスへのアクセスをユーザー名とパスワードで保護する必要があります。接続するすべてのユーザーに認証資格情報を要求するセキュリティ プラグインでリモート Elasticsearch インスタンスを保護することをお勧めします。アトラシアンはこのための、Buckler と呼ばれる無料のプラグインを提供しています。また、Bitbucket Server は、基本認証を提供する他のプラグイン (Elastic の Shield プラグインなど) を通じた Elasticsearch への認証もサポートしています。
Buckler プラグインを使用して リモート Elasticsearch インスタンスを保護する方法
Buckler プラグインの URL をクリップボードにコピーします。
Elasticsearch 2.3.5 Buckler 0.2.12 for ES 2.3.5 Install the plugin onto your remote Elasticsearch instance using the plugin helper in the Elasticsearch
/bin
directory:cd /path/to/elasticsearch/bin ./plugin install -b <link from table above>
- リモート Elasticsearch インストールにアクセスするには、Bitbucket の基本認証を設定します。Bitbucket Data Center と連携するリモート Elasticsearch インスタンスでは少なくとも基本 HTTP 認証を有効化することを強く推奨します。
- Create a directory called
buckler
within theelasticsearch/config
directory. Within the
elasticsearch/config
directory, create a file namedbuckler.yml
.Enable Buckler: at this point there are no configuration properties within
buckler.yml
, so the features of the Buckler plugin are disabled.
To enable the Buckler for basic HTTP authentication, you add these properties to the file, creating a username and password that Bitbucket will use to access Elasticsearch (configured in a later step).elasticsearch/config/buckler/buckler.ymlauth.basic.http.enabled: true auth.basic.username: <username> auth.basic.password: <password>
- Start your remote Elasticsearch instance. See Elasticsearch (2.3) documentation for specific instructions.
- Create a directory called
ステップ 4: Elasticsearch を Bitbucket に接続する
Elasticsearch インスタンスの構成が完了したら、それを Bitbucket に接続する必要があります。
To configure your remote Elasticsearch instance using the bitbucket.properties
file
bitbucket.properties
file, it cannot be edited later from the admin UI. Any changes that need to be made to the Elasticsearch configuration must be made within the bitbucket.properties
file.
- Locate the
bitbucket.properties
file in the<Bitbucket home directory>/shared
directory. Elasticsearch インスタンスの詳細 (上記の ステップ 3.3 で作成したもの) を追加します。
<Bitbucket ホーム ディレクトリ>/shared/bitbucket.propertiesplugin.search.elasticsearch.baseurl=http://localhost:9200/ plugin.search.elasticsearch.username=<username> plugin.search.elasticsearch.password=<password>
- ファイルを保存して閉じます。
組み込みの Elasticsearch インスタンスを開始せずに Bitbucket Server を起動します。
Linux の場合 start-bitbucket.sh --no-search
Windows : start-bitbucket.bat /no-search
これで、リモート Elasticsearch インスタンスと Bitbucket Server の連携に必要な構成は完了です。