java -version
JAVA_HOME
environment variable and point it to the Java installation directory on your machine. Supported Operating Systems | Output |
Windows | Set the environment variable JAVA_HOME to C:\\Program Files\\Java\\jdkjdk1.8.0_20 |
Linux | export JAVA_HOME=/usr/local/java-current |
Mac OSX | export JAVA_HOME=/Library/Java/Home |
Supported Operating Systems | Output |
Windows | Add C:\\Program Files\\Java\\jdk1.8.0_20\\bin to the end of the system variable Path |
Linux | export PATH=$PATH:$JAVA_HOME/bin/ |
Mac OSX | not required |
java -version
command to check your Java installation../config
directory of the installation file, add the following content at the end of producer.properties
and consumer.properties
.security.protocol=SASL_PLAINTEXTsasl.mechanism=PLAIN
ckafka_client_jaas.conf
, and add the following content.KafkaClient {org.apache.kafka.common.security.plain.PlainLoginModule requiredusername="yourinstance#yourusername"password="yourpassword";};
username
to a value in the format of instance ID
+ #
+ configured username
, and password
to a configured password../bin
directory of the installation file, add the statement of the full path of the JAAS file at the beginning of kafka-console-producer.sh
and kafka-console-consumer.sh
.export KAFKA_OPTS="-Djava.security.auth.login.config=****/config/ckafka_client_jaas.conf"
./bin
directory, and produce and consume a message via CLI commands.bash kafka-console-consumer.sh --bootstrap-server XXXX:port --topic XXXX --consumer.config ../config/consumer.properties
XXXX:port
with the domain name and port for public network access, which can be obtained in the Access Mode section on the Instance Details page in the console.XXXX
with the topic name, which can be obtained on the Topic Management page in the console.bash kafka-console-producer.sh --broker-list XXXX:port --topic XXXX --producer.config ../config/producer.properties
XXXX:port
with the domain name and port for public network access, which can be obtained in the Access Mode section on the Instance Details page in the console.XXXX
with the topic name, which can be obtained on the Topic Management page in the console.
Was this page helpful?