Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

ElasticSearch service reports port 7990 already in use

Helen October 13, 2022

I have installed Bitbucket Server from scratch, version 7.21.3 on Windows Server 2016.

The installation is secured by using a non-default user account to run the BitBucket and ElasticSearch services, and Apache redirects http:7990 to https. Crowd is used for user authentication, and SSO is set up and working.

Bitbucket itself appears to be working without problems, however the ElasticSearch service does not start up properly.

When I start the ElasticSearch service, it stops again immediately, and reports the following error in atlassianbitbucketsearch-stderr.log:
org.springframeowrk.boot.web.server.PortInUseException: Port 7990 is already in use

Port 7990 is Bitbucket's default port, so it seems reasonable that this port is in use. I'm not sure why ElasticSearch is also trying to use it.

I have tried stopping Bitbucket, then starting ElasticSearch, then starting BitBucket again, and while ElasticSearch starts up and keeps running, obviously BitBucket does not.

I have bypassed Apache and returned to the original http:7990 set up, but I still have the same problem.

Any help on why is ElasticSearch trying to use Bitbucket's port, and how do I get around this so ElasticSearch runs properly would be appreciated!

1 answer

0 votes
Charlie Misonne
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 14, 2022

Hi @Helen

The elasticsearch port is defined in <Bitbucket home directory>/shared/search/elasticsearch.yml. Can you check which port is defined in that file?

You can also follow this procedure.

Helen October 16, 2022

Ah, I don't seem to have that file at all! That might explain something :P

Looking at https://confluence.atlassian.com/bitbucketserver0721/running-bitbucket-server-as-a-windows-service-1115666779.html, there should have been a robocopy executed to copy files from the installation directory to the that location.

The robocopy refers to "config-template" directory which doesn't exist in my Bitbucket installation.

I think I need to robocopy the <bitbucket-install>\opensearch\config directory. There is an opensearch.yml file in it, which I think is my equivilent of elasticsearch.yml.

Like Charlie Misonne likes this
Charlie Misonne
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 17, 2022

Indeed, you seem to be missing some files.

Let me know if you are able to solve it :-)

Helen October 17, 2022

I resolved it by removing the Bitbucket installation and installing from scratch; the service just refused to pick up on the proper ports.

I clearly stuffed something up during the initial installation because it installed just fine the second time.

Charlie Misonne
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 20, 2022

ok, I'm glad it was resolved!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
7.21.3
TAGS
AUG Leaders

Atlassian Community Events