Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I initialize the whitelist for Apache-Zookeeper?

I'm new to Apache Kafka. I've installed it into a Ubuntu Linux VM (18.04).

I've started up Zookeeper from the Kafka directory with the default configuration. Apache Kafka Startup

The Zookeeper looks like it started successfully. From another Terminal window I am attempting to test. I'm connecting to it with Telnet and am attempting to send a "stat" command.

When I do so, I get the following error message: Zookeeper Error Message

I'm a newbie to Apache/kafka and have limited linux experience. I googled around but it wasn't really clear to me how to update the whitelist.

I found the following snippet from Zookeeper documentation:

4lw.commands.whitelist (Java system property: zookeeper.4lw.commands.whitelist)

New in 3.4.10: This property contains a list of comma separated Four Letter Words commands. It is introduced to provide fine grained control over the set of commands ZooKeeper can execute, so users can turn off certain commands if necessary. By default it contains all supported four letter word commands except "wchp" and "wchc", if the property is not specified. If the property is specified, then only commands listed in the whitelist are enabled.

Here's an example of the configuration that enables stat, ruok, conf, and isro command while disabling the rest of Four Letter Words command: 4lw.commands.whitelist=stat, ruok, conf, isro Users can also use asterisk option so they don't have to include every command one by one in the list. As an example, this will enable all four letter word commands: 4lw.commands.whitelist=*

Can someone please explain the whitelist usage and how to correctly initialize it?

Thanks, JohnB

like image 629
JohnB Avatar asked Jul 01 '20 00:07

JohnB


People also ask

How do I change the admin port on zookeeper?

By default, Admin Server binds to port 8080, in case port 8080 already in use this exception will be thrown. Add below property to conf/zoo. cfg file and restart zk server. That easy- I will try and report.

Which of the four letter word commands will show you the status of a zookeeper server?

The ZooKeeper service can be monitored in one of two primary ways; 1) the command port through the use of 4 letter words and 2) JMX. See the appropriate section for your environment/requirements.


2 Answers

For me, adding one of the following lines (or a variation) to the config/zookeeper.properties file (in the installation folder) worked.

  • 4lw.commands.whitelist=stat, ruok, conf, isro
  • 4lw.commands.whitelist=*
like image 99
zmike Avatar answered Oct 12 '22 21:10

zmike


This worked for me; setting the environment variable on the command line.

KAFKA_OPTS="-Dzookeeper.4lw.commands.whitelist=*" bin/zookeeper-server-start.sh config/zookeeper.properties
like image 9
JohnB Avatar answered Oct 12 '22 21:10

JohnB