Start and stop Bitbucket

This page describes the various ways you can start or stop Bitbucket Data Center and Server, depending on which method suits your needs.

Start Bitbucket during installation

The Bitbucket installer can automatically start Bitbucket. If you're not using the installer, use the instructions below that are appropriate for your needs to start Bitbucket.

このページの内容



Start/stop Bitbucket


To start/stop Bitbucket

Linux の場合

Change to your <Bitbucket Server installation directory>, then use the command that meets your needs:

bin/start-bitbucket.sh
bin/stop-bitbucket.sh


Windows の場合

Windows で Bitbucket Server を自動的に起動および停止する場合、Bitbucket Server がサービスとしてインストールされている必要があります。

You can use start-bitbucket.bat for short term debugging, using Ctrl+C will safely shutdown the instance when it is no longer needed. 

To start/stop Bitbucket Server manually when running as a service on Windows

Start and stop the Bitbucket Server service from the services console, on Windows. Ensure you start both the AtlassianBitbucket and AtlassianBitbucketElasticsearch services.

macOS の場合

Use the app icons in the <Bitbucket Server installation directory>. These link to the start-bitbucket.sh and stop-bitbucket.sh scripts in <Bitbucket Server installation directory>/bin.

Bitbucket Data Center の起動

Bitbucket Data Center の場合、リモート Elasticsearch インスタンスを別に開始する必要があります。Bitbucket Data Center セットアップの要件として、クラスタ全体に対してリモート Elasticsearch を 1 つのみにする必要があります (「Bitbucket Data Center のインストール」を参照)。リモート Elasticsearch インスタンスを起動する具体的な手順については、Elasticsearch のドキュメントを参照してください。


Bitbucket Data Center を起動する方法 (Bitbucket にバンドルされている Elasticsearch インスタンスは起動しません)

  1. Change to your <Bitbucket Server installation directory>
  2. 次のコマンドを実行します。

    start-bitbucket.sh --no-search


Start/stop Bitbucket when running as a service

On Windows and Linux systems you can choose to have Bitbucket

 installed as a service, and it will be started automatically when the system boots.


To start/stop Bitbucket manually when running as service:

Linux の場合

Manage the Bitbucket service with these commands:

# service atlbitbucket status 
# service atlbitbucket stop 
# service atlbitbucket start


If you installed Bitbucket as a systemd service (as explained in Run Bitbucket as a Linux service), use these commands instead:


# systemctl bitbucket status
# systemctl bitbucket stop
# systemctl bitbucket start

Start Bitbucket without starting bundled Elasticsearch

バンドルされている Elasticsearch を開始せずに Bitbucket を起動する理由

Bitbucket Data Center を実行中の場合: Bitbucket Data Center セットアップの要件として、クラスタ全体に対してリモート Elasticsearch を 1 つのみにする必要があります (「Bitbucket Data Center のインストール」を参照)。

You have a remote Elasticsearch instance (for whatever reason): When using a remote Elasticsearch instance, you have to start Bitbucket without starting the bundled Elasticsearch instance.

You can also refer to How to Install and configure a remote Elasticsearch instance.

You have a Docker deployment: We strongly recommend that you run Elasticsearch on a separate container. Otherwise, you won't be able to properly trigger a graceful shutdown.


To start Bitbucket without starting the bundled Elasticsearch instance

Linux の場合
start-bitbucket.sh --no-search


Windows の場合

start-bitbucket.bat /no-search

 

For Docker installations, use the -e ELASTICSEARCH_ENABLED=false parameter.  Learn more about deploying Bitbucket through Docker


Performing a graceful shutdown (Linux only)

You can send a SIGTERM signal to Bitbucket to trigger a graceful shutdown. This will give Bitbucket some time to complete any running tasks, in-flight GIT requests, and in-flight user requests before terminating. The bin/stop-bitbucket.sh script, service atlbitbucket stop command, and systemctl bitbucket stop command all use the SIGTERM signal to terminate Bitbucket. 

During a graceful shutdown:

  • Tomcat stops accepting new HTTP connections without interrupting active connections.
  • The SSH server stop accepting new SSH connections without interrupting active connections.
  • The job scheduler will not start any new jobs, but will not immediately cancel any running jobs.


The following configuration properties control how graceful shutdown works:

既定値説明
graceful.shutdown.timeout
30

The amount of time (in seconds) that Bitbucket should allocate before terminating all active HTTP requests, SSH requests, and running jobs.

server.shutdown
graceful

Sets whether Bitbucket should initiate a graceful shutdown first upon termination. If you want Bitbucket

to shut down immediately without waiting for any tasks to complete, set this to immediate.

In addition to these config properties, the BITBUCKET_SHUTDOWN_TIMEOUT environment variable controls when  Bitbucket terminates altogether. This environmental variable will override plugin.search.indexing.event.shutdown.timeout.

By default,  BITBUCKET_SHUTDOWN_TIMEOUT is set to 40. We recommend you keep this environmental variable at least 10 seconds longer than plugin.search.indexing.event.shutdown.timeout.

Gracefully shutting down Docker deployments

If Bitbucket and ElasticSearch are running in the same container, you won't be able to trigger a graceful shutdown properly. We strongly recommend that you run ElasticSearch on its own separate container.

If ElasticSearch is not running on the same container, you can trigger a graceful Bitbucket shutdown through docker stop. This command will send a SIGTERM signal to Bitbucket.

最終更新日: 2021 年 10 月 5 日

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

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