How to update the ports used by the bundled Elasticsearch

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

The bundled Elasticsearch that comes with Bitbucket uses the following ports by default:

Port number

Purpose

Remarks

7992 (TCP)Elasticsearch HTTP interface portThis port is primarily used to receive HTTP and REST API requests from Bitbucket Server. As requests to this port are being made from the same server, this port does not need to be accessible from outside.
7993 (TCP)Elasticsearch transport/node communication portThis port is used to connect Elasticsearch to a cluster and to enable node-to-node communication. This port cannot be blocked, as it will prevent Elasticsearch from starting - but this port does not need to be accessible from the outside, as the bundled Elasticsearch instance is not part of a cluster.

Reference: Which ports does Bitbucket Server listen on, and what are they used for?


If the Elasticsearch port values need to be changed for any reason, the procedures under the Solution section below can be followed.


Warning

Please take that if the port values are changed, they will be overwritten and reset to the default values when Bitbucket is upgraded.

Any modifications to the ports will need to be re-applied after the upgrade.

For this reason, it is recommended to keep the default Elasticsearch port values.


Environment

This Knowledgebase article only applies to Bitbucket instances that use the bundled Elasticsearch.

Solution

  1. Create a back up of the <Bitbucket home directory>/shared/search/elasticsearch.yml file
  2. Edit the <Bitbucket home directory>/shared/search/elasticsearch.yml file
  3. To change the HTTP interface port, change the value in the following line:

    http.port: 7992

    Changing the HTTP port would require the Elasticsearch URL to be updated with the new port value.

    This can be done either through the UI in Administration > Server settings > Search > Elasticsearch URL or through the plugin.search.elasticsearch.baseurl configuration property

  4. To change the transport/node communication port, change the value in the following line:

    transport.tcp.port: 7993
  5. Save the file
  6. Restart Bitbucket


Last modified on Jun 28, 2021

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.