Modifying Kafka Topic Configurations
Scenario
You can use a cluster client to create Kafka topics based on service requirements. Management permission is required for clusters with Kerberos authentication enabled. You can also modify topic configurations on Kafka UI.
- In security mode, when modifying topic configurations on the Kafka UI, ensure that the Kafka UI login user belongs to the kafkaadmin user group or the corresponding operation permission is granted to the user. Otherwise, the authentication fails.
- In non-security mode, Kafka UI does not authenticate any operation.
Modifying Kafka Topics Using the Kafka Client
- Access the ZooKeeper instance page.
Log in to FusionInsight Manager. For details, see Accessing FusionInsight Manager. Choose Cluster > Services > ZooKeeper > Instances.
- View the IP addresses of the ZooKeeper role instance.
Record any IP address of the ZooKeeper instance.
- Prepare a client based on service requirements. Log in to the node where the client is installed by referring to Using an MRS Client.
- Run the following command to switch to the client directory, for example, /opt/client /Kafka/kafka/bin:
cd /opt/client/Kafka/kafka/bin
- Run the following command to set environment variables:
source /opt/client/bigdata_env
- Run the following command to perform user authentication (skip this step in normal mode).
kinit Component service user
- Use kafka-topics.sh to modify the topic.
./kafka-topics.sh --alter --topic topic name--config configuration item=configuration value --zookeeper service IP address of any ZooKeeper node:clientPort/kafka
- Use kafka-topics.sh to view the modified topic.
- ./kafka-topics.sh --describe --zookeeper service IP address of any ZooKeeper node:clientPort/kafka --topic topic name
- ./kafka-topics.sh --describe --bootstrap-server IP address of the Kafkacluster:21007 --command-config ../config/client.properties --topic topic name
Modifying Kafka Topics Using KafkaUI
- Access the Kafka UI.
- Log in to FusionInsight Manager as a user who has the permission to access the Kafka UI and choose Cluster > Services > Kafka.
If you need to perform related operations on the page, for example, creating a topic, you need to grant related permissions to the user. For details, see Kafka User Permissions.
- On the right of KafkaManager WebUI, click the URL to access Kafka UI.
- Log in to FusionInsight Manager as a user who has the permission to access the Kafka UI and choose Cluster > Services > Kafka.
- Click Topics. The topic management page is displayed.
- Click Action > Config in the Operation column of the item to be modified. On the page that is displayed, modify the Key and Value of the topic. To add multiple values, click . Click OK.
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.
For any further questions, feel free to contact us through the chatbot.
Chatbot