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.
- This topic is available for MRS 3.x or later.
Modifying Kafka Topics Using the Kafka Client
- Access the ZooKeeper instance page.
Log in to FusionInsight Manager. For details, see Accessing FusionInsight Manager (MRS 3.x or Later). Choose Cluster > Services > ZooKeeper > Instances.
- View the IP addresses of the ZooKeeper role instance.
Record the IP address of any ZooKeeper instance.
- Prepare the client based on service requirements. Log in to the node where the client is installed.
Log in to the node where the client is installed. For details, see Using an MRS Client.
- Switch to the client installation directory, for example, /opt/client/Kafka/kafka/bin.
cd /opt/client/Kafka/kafka/bin
- Configure environment variables.
source /opt/client/bigdata_env
- Perform user authentication. (Skip this step for normal clusters.)
kinit Component service user
- Use kafka-topics.sh to modify the topic.
./kafka-topics.sh --alter --topic Topic name --config Configuration item=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 Kafka cluster:21007 --command-config ../config/client.properties --topic Topic name
Using Kafka UI to Modify Kafka Topics (MRS 3.1.2 and Later Versions)
- 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 operations on the page, for example, creating a topic, you need to grant related permissions to users. For details, see Kafka User Permissions.
- On the right of KafkaManager WebUI, click the URL to 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.
- Choose Topics.
- In the Operation column of the item to be modified, choose Action > Config. On the displayed page, change the values of Key and Value of the topic. To add multiple items, 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