-
Notifications
You must be signed in to change notification settings - Fork 561
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
Java Kafka Client fails to connect to docker image #123
Comments
|
we should probably consider exposing similar configurations via environment variable, perhaps even 1-1 with the kafka environment variables if there is a strong connection between configurations. it would seem to make sense for this sort of network configuration. |
@loopingrage we're working on the issue related to advertised host in #125. in the meantime, i was able to get the java client to connect successfully to redpanda running in docker using host networking, if that is an option for you:
|
I'm running within a Docker Compose environment so host networking unfortunately does not work in my case. The Just a thought. Is there a way to mount my own redpanda config file into the container? If you place the config file in its own directory that would be it pretty easy for me to do using a a Docker Compose volume that mounts a config on the Docker host. We do this for our own software where environment variables are not flexible enough to express the multitude of config options. |
@loopingrage yes, @0x5d i think has some instructions to make this volume mount + config trick work until #125 lands. |
Any thoughts @0x5d? |
Hi @loopingrage. You can put the config file (redpanda.yaml) in a directory and mount it into /etc/redpanda/ on the container. You can use this as a template (complete reference: https://vectorized.io/documentation/advanced-configuration/): config_file: /etc/redpanda/redpanda.yaml
redpanda:
admin:
address: 0.0.0.0
port: 9644
advertised_kafka_api:
address: 127.0.0.1
port: 45677
advertised_rpc_api:
address: <container hostname>
port: 33145
data_directory: /var/lib/redpanda/data
developer_mode: true
kafka_api:
address: <container hostname>
port: 9092
kafka_api_tls:
cert_file: ""
enabled: false
key_file: ""
truststore_file: ""
node_id: <node id>
rpc_server:
address: <container hostname>
port: 33145
seed_servers: []
auto_create_topics_enabled: true
rpk:
enable_usage_stats: true
tune_network: false
tune_disk_scheduler: false
tune_disk_nomerges: false
tune_disk_irq: false
tune_fstrim: false
tune_cpu: false
tune_aio_events: false
tune_clocksource: false
tune_swappiness: false
enable_memory_locking: false
tune_coredump: false |
I start a single node Redpanda container with docker compose like that:
And it works well with Kafka Connect Distributed. |
excellent @rk3rn3r @loopingrage multi-network support just landed in the core so we now supported named listeners like you expect in kafka. that's being wired up right now through |
Closing this as multi-listener is now configurable from config file and command line args. Please open a new issue if there are still issues. |
Added 2 additional jobs backport-type to get the backport that the user wants to create; type-pr to create backport draft pull requests when commenting on issues. The type-branch job creates the issue or the PR based on the source of the comment (PR or issue). Examples: * comment on issues: /backport v21.11.x: Creates backport issue and adds milestone/assignees * comment on backport-issues (issues that the bot created to track a backport): /backport 123: Cherry-picking the commits of PR redpanda-data#123 and creates a draft PR. Adds the issue link in the PR description * comment on PR: /backport v21.11.x: Cherry-picking the commits of the PR that the user posted the comment and creates the draft PR
Added 2 additional jobs backport-type to get the backport that the user wants to create; type-pr to create backport draft pull requests when commenting on issues. The type-branch job creates the issue or the PR based on the source of the comment (PR or issue). Examples: * comment on issues: /backport v21.11.x: Creates backport issue and adds milestone/assignees * comment on backport-issues (issues that the bot created to track a backport): /backport 123: Cherry-picking the commits of PR redpanda-data#123 and creates a draft PR. Adds the issue link in the PR description * comment on PR: /backport v21.11.x: Cherry-picking the commits of the PR that the user posted the comment and creates the draft PR
Added 2 additional jobs backport-type to get the backport that the user wants to create; type-pr to create backport draft pull requests when commenting on issues. The type-branch job creates the issue or the PR based on the source of the comment (PR or issue). Examples: * comment on issues: /backport v21.11.x: Creates backport issue and adds milestone/assignees * comment on backport-issues (issues that the bot created to track a backport): /backport 123: Cherry-picking the commits of PR redpanda-data#123 and creates a draft PR. Adds the issue link in the PR description * comment on PR: /backport v21.11.x: Cherry-picking the commits of the PR that the user posted the comment and creates the draft PR
Added 2 additional jobs backport-type to get the backport that the user wants to create; type-pr to create backport draft pull requests when commenting on issues. The type-branch job creates the issue or the PR based on the source of the comment (PR or issue). Examples: * comment on issues: /backport v21.11.x: Creates backport issue and adds milestone/assignees * comment on backport-issues (issues that the bot created to track a backport): /backport 123: Cherry-picking the commits of PR redpanda-data#123 and creates a draft PR. Adds the issue link in the PR description * comment on PR: /backport v21.11.x: Cherry-picking the commits of the PR that the user posted the comment and creates the draft PR
I spun up an instance of
vectorized/redpanda:latest
and tried connecting from the my Docker host using the standard Java client. This is what I see in my application log:I believe this is due to the fact that the Java client connects to redpanda as a bootsrtap and as part of the Kafka protocol handshake it is give the address to the actual broker which in this case seems to resolve to
0.0.0.0
.This is from the docker logs:
I'm migrating my app from Apache Kafka and for my existing config I had to specify some environment variables to get the bootstrap process to work including:
Note the support for multiple ports mapping to different host names. This was needed to work in both docker compose where the host name for the kafka container was literally
kafka
and when connecting from the host using an exposed port.Does your Docker image have support for similar ENV configs? The redpanda docker image on Docker Hub doesn't have a README yet (I know you're working on one).
The text was updated successfully, but these errors were encountered: