Druid Port

Hi,

I have installed Druid as written in official documentation but all other services such as zookeeper were already installed in my system.

But when I am trying to run druid service suing command :

**bin/supervise -c quickstart/tutorial/conf/tutorial-cluster.conf**
I am getting en error: **Cannot start up because port[2181] is already in use.**

Please find the screenshot. Is this error due to zookeeper because zookeeper by defaults run on port 2181.
If so, how can I change the port no. of druid to make it run successful.

Hi Divyansh,

Seems like the port to start the zookeeper has already been used so you are not able to start the Druid.

You can check by using netstat -an | grep 2181 and see which service using the port.

-Hemanth

It is showing tcp6.

PLease find the screenshot.

KIndly help, what should I do now as on running netstat -an | grep 2181 command it is showing tcp6 that is actually zookeeper. Please tell how can i change the port no of Druid or if there is any other solution.

Hi Divyansh,

You can change the “clientPort” under “zoo.cfg” and see that helps.

Typically the ZK runs on 2181 port and that’s why you are seeing the issue.

Thanks,

Hemanth

Hello, on changing it to port 2080 in zoo.cfg still getting the same error.

Hi,

no matter the port you set, the error you get is due to the bin/verify-default-ports script that is launched every time you start your cluster.

It checks all the ports listed

my @ports = (1527, 2181, 8081, 8082, 8083, 8090, 8091, 8200, 9095);

You could change 2181 with 2080 in it

Little precision :

those ports are checked only when using tutorial-cluster.conf, that contain

:verify bin/verify-java
:verify bin/verify-default-ports

that’s right. Just comment port check and you will be good to go

You need perform verify port under bin then It will work.

I am running druid nodes on custom ports.

Thanks

Ashish

Port issue is resolved but wen I am running the same command in that case command[zk] is getting failed.

Please find the attached screenshots.

Hi,

Could you please attach the content of the logfile ?

Please find the screenshot of error logs

What errors are being logged in the ZK log file: /home/knoldus/apache-druid-0.14.2-incubating/var/sv/zk.log?

Please find the attached screenshot of errors logs in zk.log

If you’re following the quickstart, likely you didn’t download ZooKeeper to the expected directory. As described here: https://druid.apache.org/docs/latest/tutorials/index.html#download-zookeeper, it should be in a directory named ‘zk’ in the package root. In your case, it should be at /home/knoldus/apache-druid-0.14.2-incubating/zk.

I movied ti to the root directry of apache druid. Do I need to make any changes in configuration or anywhere in bashrc.

Please find the attached error logs and screenshot of bashrc.

error log.txt (53.3 KB)

I think the quickstart script sets the required environment variables and disregards what is in your bashrc. The error is that port 2181 is already in use - you probably have another instance of ZK running that is conflicting.

In the log we can see that zk is trying to bind the 2181 port.
Didn’t you change that Conf ?