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

Kafka create_topic deprecated option #2279

Closed
ffeldbauer opened this issue May 27, 2022 · 9 comments
Closed

Kafka create_topic deprecated option #2279

ffeldbauer opened this issue May 27, 2022 · 9 comments

Comments

@ffeldbauer
Copy link
Contributor

ffeldbauer commented May 27, 2022

Hey,

according to app/alarm/Readme.md I downloaded Kafka 2.12 and tried to run create_alarm_topics.sh.
I got a --zookeeper: deprecated option error.

I had to modify the script this way to get it working:

14,15c14,15
<     kafka/bin/kafka-topics.sh  --zookeeper localhost:2181 --create --replication-factor 1 --partitions 1 --topic $topic
<     kafka/bin/kafka-configs.sh --zookeeper localhost:2181 --entity-type topics --alter --entity-name $topic \
---
>     kafka/bin/kafka-topics.sh  --bootstrap-server localhost:9092 --create --replication-factor 1 --partitions 1 --topic $topic
>     kafka/bin/kafka-configs.sh --bootstrap-server localhost:9092 --entity-type topics --alter --entity-name $topic \
22,23c22,23
<     kafka/bin/kafka-topics.sh  --zookeeper localhost:2181 --create --replication-factor 1 --partitions 1 --topic $topic
<     kafka/bin/kafka-configs.sh --zookeeper localhost:2181 --entity-type topics --alter --entity-name $topic \
---
>     kafka/bin/kafka-topics.sh  --bootstrap-server localhost:9092 --create --replication-factor 1 --partitions 1 --topic $topic
>     kafka/bin/kafka-configs.sh --bootstrap-server localhost:9092 --entity-type topics --alter --entity-name $topic \
@ffeldbauer
Copy link
Contributor Author

ffeldbauer commented May 27, 2022

OK just noticed, the readme says kafka_2.12-2.3.0 I downloaded kafka_2.12-3.2.0

@kasemir
Copy link
Collaborator

kasemir commented May 27, 2022

I've seen a 'warning' about the zookeeper vs. bootstrap-server option for a while, but it all "worked" and seemed compatible that way. Do you get an actual failure, i.e. you MUST use --bootstrap-server? Then it might be time to update the example scripts...

@kasemir
Copy link
Collaborator

kasemir commented May 27, 2022

I'm on kafka-2.13-2.8.0 and while I get "--zookeeper is deprecated" warning, it still works fine...

@kasemir
Copy link
Collaborator

kasemir commented May 27, 2022

To avoid the deprecation message, I'll go ahead and replace --zookeeper.
When only replacing it with --bootstrap-server, omitting the change in the port number, I got the totally meaningless error

[2022-05-27 08:59:57,842] WARN Exception causing close of session 0x0: Unreasonable length = 308375649 (org.apache.zookeeper.server.NIOServerCnxn)

in the zookeeper output.. Using the changed port number as in your diff it seems fine.

kasemir added a commit that referenced this issue May 27, 2022
with  --bootstrap-server.
Note that port number also needs to change from 2181 to 9092,
otherwise zookeeper gives strange messages
```
WARN Exception causing close of session 0x0: Unreasonable length =
308375649 (org.apache.zookeeper.server.NIOServerCnxn)
```
and clients will hang

#2279
@kasemir
Copy link
Collaborator

kasemir commented May 27, 2022

Examples now use --bootstrap-server.
Still curious if this was an abortive error for your setup of just a warning..

@ffeldbauer
Copy link
Contributor Author

florian@palumapc1:~$ /opt/kafka/bin/kafka-topics.sh  --zookeeper localhost:2181  --create --replication-factor 1 --partitions 1 --topic test
Exception in thread "main" joptsimple.UnrecognizedOptionException: zookeeper is not a recognized option
        at joptsimple.OptionException.unrecognizedOption(OptionException.java:108)
        at joptsimple.OptionParser.handleLongOptionToken(OptionParser.java:510)
        at joptsimple.OptionParserState$2.handleArgument(OptionParserState.java:56)
        at joptsimple.OptionParser.parse(OptionParser.java:396)
        at kafka.admin.TopicCommand$TopicCommandOptions.<init>(TopicCommand.scala:567)
        at kafka.admin.TopicCommand$.main(TopicCommand.scala:47)
        at kafka.admin.TopicCommand.main(TopicCommand.scala)

As you can see, on my version it is an Error.
The --zookeeper option points to the zookeeper server (that's why it uses 2181 as port), the --bootstrap-server option instead connects to the Kafka server, therefore the port has to be changed to 9092

@kasemir
Copy link
Collaborator

kasemir commented May 27, 2022

Interesting. kafka-2.13-2.8.0 just shows a warning, thanks for confirming that you get an error with kafka_2.12-3.2.0.
I guess the latter number "3.2" is really the kafka version, so "3.2" is ahead of "2.8".

In the Java code we use the "bootstrap.servers" property, I assume that works OK?

@ffeldbauer
Copy link
Contributor Author

I only did some rough tests, yet, but except for the changes in the example scripts I did not touch anything and alarm server and gui seem to have worked.
I was able to modify the config from the GUI and acknowledge my test alarms.

@kasemir
Copy link
Collaborator

kasemir commented May 27, 2022

Great, thanks!

@kasemir kasemir closed this as completed May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants