Kafka Access Configuration on Windows Using EIPs
Scenario
This section describes how to bind Elastic IP addresses (EIPs) to a cluster and configure Kafka files so that sample files can be compiled locally.
Procedure
- Apply for an EIP for each node in the cluster and add public IP addresses and corresponding host domain names of all nodes to the Windows local hosts file. (If a host name contains uppercase letters, change them to lowercase letters.)
- On the VPC console, apply for EIPs (the number of EIPs you buy should be equal to the number of nodes in the cluster), click the name of each node in the MRS cluster, and bind an EIP to each node on the EIPs page.
For details, see
. - Record the mapping between the public IP addresses and private IP addresses. Change the private IP addresses in the hosts file to the corresponding public IP addresses.
- On the VPC console, apply for EIPs (the number of EIPs you buy should be equal to the number of nodes in the cluster), click the name of each node in the MRS cluster, and bind an EIP to each node on the EIPs page.
- Change the IP addresses in the krb5.conf file to the corresponding host names.
- Configure security group rules for the cluster.
- On the Dashboard page, choose Add Security Group Rule > Manage Security Group Rule.
- On the Inbound Rules tab page, click Add Rule. In the Add Inbound Rule dialog box, configure the Windows IP address and port 21007.
- On the Dashboard page, choose Add Security Group Rule > Manage Security Group Rule.
- On Manager, choose Cluster > Services > Kafka > Configurations > All Configurations, search for and add the key-value pair advertised.listeners =SASL_PLAINTEXT://:21007,SASL_SSL://:21009,TRACE://:21013 in the kafka.config.expandor parameter, save the configuration, and restart the Kafka cluster.
- Before running the sample code, change the Kafka connection string in the sample code to hostname1:21007, hostname2:21007, hostname3:21007.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.