Bitbucket Server の起動と停止
このページでは、ニーズに適した方法で Bitbucket Server を起動または停止できるさまざまな方法について説明します。
インストール中に Bitbucket を起動する
Bitbucket Server インストーラーでは Bitbucket Server を自動的に起動できます。インストーラーを使用していない場合は、ニーズに適した以下の方法を使用して Bitbucket を起動します。
On this page
Bitbucket Server の起動 / 停止
Bitbucket Server を起動 / 停止する方法
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.
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 インスタンスは起動しません)
- Change to your
<Bitbucket Server installation directory>
次のコマンドを実行します。
start-bitbucket.sh --no-search
サービスとして実行中の Bitbucket Server の起動 / 停止
Windows および Linux システムでは、Bitbucket Server をサービスとしてインストールし、システムが起動すると自動的に Bitbucket Server を開始するように選択できます。
サービスとして実行中の Bitbucket Server を手動で起動 / 停止する方法
Linux の場合
次のコマンドを使用して Bitbucket Server サービスを管理します。
# service atlbitbucket status
# service atlbitbucket stop
# service atlbitbucket start
If you installed Bitbucket as a systemd service (as explained in Running Bitbucket Server as a Linux service), use these commands instead:
# systemctl bitbucket status
# systemctl bitbucket stop
# systemctl bitbucket start
Windows の場合
Start and stop the Bitbucket Server service from the services console, on Windows. Ensure you start both the AtlassianBitbucket
and AtlassianBitbucketElasticsearch
services.
バンドルされている Elasticsearch を起動せずに Bitbucket Server を起動
バンドルされた Elasticsearch インスタンスを起動せずに Bitbucket Server を起動する方法
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
command all use the systemctl bitbucket
stop 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 config 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.