Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bitnami/kafka] Kafka JMX Exporter , Port already in use: 5555 #12917

Closed
bharathreddy901 opened this issue Oct 12, 2022 · 6 comments
Closed

[bitnami/kafka] Kafka JMX Exporter , Port already in use: 5555 #12917

bharathreddy901 opened this issue Oct 12, 2022 · 6 comments
Assignees
Labels
kafka solved tech-issues The user has a technical issue about an application triage Triage is needed

Comments

@bharathreddy901
Copy link

bharathreddy901 commented Oct 12, 2022

Name and Version

bitnami/kafka

What steps will reproduce the bug?

Hi Team,

We are using bitnami Kafka helm charts. We have enabled the JMX Exporter.

When we ran the Kafka console commands, I am getting below error(java.rmi.server.ExportException: Port already in use: 5555)
For WorkAround,I am running below commands.

export JMX_PORT=5557
unset JMX_PORT

Is there any permanent solution to fix this.

I have no name!@kafka-0:/$ kafka-topics.sh --list --bootstrap-server kafka-0.kafka-headless.kafka.svc.cluster.local:9092
Error: Exception thrown by the agent : java.rmi.server.ExportException: Port already in use: 5555; nested exception is:
        java.net.BindException: Address already in use (Bind failed)
jdk.internal.agent.AgentConfigurationError: java.rmi.server.ExportException: Port already in use: 5555; nested exception is:
        at jdk.management.agent/sun.management.jmxremote.ConnectorBootstrap.startRemoteConnectorServer(ConnectorBootstrap.java:491)
        at jdk.management.agent/jdk.internal.agent.Agent.startAgent(Agent.java:447)
        at jdk.management.agent/jdk.internal.agent.Agent.startAgent(Agent.java:599)
Caused by: java.rmi.server.ExportException: Port already in use: 5555; nested exception is:

Thanks.

Are you using any custom parameters or values?

No response

What is the expected behavior?

No response

What do you see instead?

java.net.BindException: Address already in use (Bind failed)

Additional information

No response

@bharathreddy901 bharathreddy901 added the tech-issues The user has a technical issue about an application label Oct 12, 2022
@bitnami-bot bitnami-bot added this to Triage in Support Oct 12, 2022
@github-actions github-actions bot added the triage Triage is needed label Oct 12, 2022
@javsalgar javsalgar changed the title Kafka JMX Exporter , Port already in use: 5555 [bitnami/kafka] Kafka JMX Exporter , Port already in use: 5555 Oct 12, 2022
@bharathreddy901
Copy link
Author

Hi @fmulero @javsalgar : Please help me on above issue.

@fmulero
Copy link
Collaborator

fmulero commented Oct 13, 2022

Hi @bharathreddy901

When JMX exporter is enabled, JMX port in kafka container is set to 5555 and jmx-exporter sidecar use it to collect the metrics and expose them in port 5556. Kafka commands use the same env var (JMX_PORT), so they will try to open the port configured for the server.

As workaround you can run your commands in a separate client:

$ kubectl run kafka-client --restart='Never' -it --image docker.io/bitnami/kafka:3.3.1-debian-11-r1 --namespace default --command -- bash
I have no name!@kafka-client:/$ kafka-topics.sh --list --bootstrap-server kafka.default.svc.cluster.local:9092

@github-actions github-actions bot moved this from Triage to Pending in Support Oct 13, 2022
@bharathreddy901
Copy link
Author

Thank you @fmulero, for your inputs. I am following above workaround. Once it is fixed, Please let me know. Is there any grafana dashboards for Kafka? can you please share it for troubleshooting purpose.

@bitnami-bot bitnami-bot moved this from Pending to Triage in Support Oct 13, 2022
@fmulero
Copy link
Collaborator

fmulero commented Oct 18, 2022

There is no real issue to fix here, clients should run outside of the server pods.

If you like to contribute using a different JMX listener configuration for the kafka container The Bitnami team will be happy to review it and provide feedback. Here you can find the contributing guidelines.

@github-actions github-actions bot moved this from Triage to Pending in Support Oct 18, 2022
@bharathreddy901
Copy link
Author

Thank you @fmulero for your inputs.

@bitnami-bot bitnami-bot moved this from Pending to Triage in Support Oct 28, 2022
@fmulero fmulero closed this as completed Oct 28, 2022
@bitnami-bot bitnami-bot moved this from Triage to Solved in Support Oct 28, 2022
@fmulero fmulero added the solved label Oct 28, 2022
@fmulero fmulero removed this from Solved in Support Jan 18, 2023
@dellnoantechnp
Copy link

if you set metrics.jmx.enabled value to true, then usage like this:

$  JMX_PORT=0   kafka-console-consumer.sh  --bootstrap-server localhost:9092 --topic test 

@bitnami-bot bitnami-bot added this to Triage in Support May 15, 2023
@github-actions github-actions bot removed the solved label May 15, 2023
@javsalgar javsalgar moved this from Triage to Pending in Support May 15, 2023
@carrodher carrodher moved this from Pending to Solved in Support May 15, 2023
@github-actions github-actions bot removed this from Solved in Support May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kafka solved tech-issues The user has a technical issue about an application triage Triage is needed
Projects
None yet
Development

No branches or pull requests

4 participants