Help Center/
MapReduce Service/
User Guide (Kuala Lumpur Region)/
Troubleshooting/
Using Kafka/
Configuring Logs for Shell Commands on the Client
Updated on 2022-12-14 GMT+08:00
Configuring Logs for Shell Commands on the Client
Issue
How do I set the log level for shell commands on the client?
Procedure
- Log in to the node where the Kafka client is installed as the client installation user.
- Switch to the Kafka client installation directory, for example, /opt/client.
cd /opt/client
- Run the following command to switch to the Kafka client configuration directory:
cd Kafka/kafka/config
- Open the tools-log4j.properties file, change WARN to INFO, and save the file.
- Switch to the Kafka client installation directory, for example, /opt/client.
cd /opt/client
- Run the following command to configure environment variables:
source bigdata_env
- Run the following command to perform user authentication (skip this step for a cluster in common mode):
kinit Component service user
- Run the following command to switch to the Kafka client installation directory:
cd Kafka/kafka/bin
- Run the following command to obtain the topic information. The log information can be viewed on the console.
kafka-topics.sh --list --zookeeper 10.5.144.2:2181/kafka
[2017-02-17 14:34:27,005] INFO JAAS File name: /opt/client/Kafka/./kafka/config/jaas.conf (org.I0Itec.zkclient.ZkClient) [2017-02-17 14:34:27,007] INFO Starting ZkClient event thread. (org.I0Itec.zkclient.ZkEventThread) [2017-02-17 14:34:27,013] INFO Client environment:zookeeper.version=V100R002C10, built on 05/12/2016 08:56 GMT (org.apache.zookeeper.ZooKeeper) [2017-02-17 14:34:27,013] INFO Client environment:host.name=10-10-144-2 (org.apache.zookeeper.ZooKeeper) [2017-02-17 14:34:27,013] INFO Client environment:java.version=1.8.0_72 (org.apache.zookeeper.ZooKeeper) [2017-02-17 14:34:27,013] INFO Client environment:java.vendor=Oracle Corporation (org.apache.zookeeper.ZooKeeper) [2017-02-17 14:34:27,013] INFO Client environment:java.home=/opt/client/JDK/jdk/jre (org.apache.zookeeper.ZooKeeper) Test __consumer_offsets counter test test2 test3 test4
Parent topic: Using Kafka
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot