First, the problem scenario:
The actual production there is always a lot of problems kafka cluster inter-network environment. kafka cluster may be multiple network cards, corresponding to multiple network segments. We need to communicate with the cluster, that is, cross-segment production and consumption issues between different network segments.
Second, the solution: custom listeners and protocol
step:
1, adding a new listeners in the LIS, to the target segment of the local IP, comma delimited listener
2, in advertised.listeners also registered above IP
3, the listener registration protocol used in the listener.security.protocol.map, PLAINTEXT represents plain text, i.e., without the use of SSL encryption.
4. To listen across multiple network segments that add multiple listener follow the above steps
note:
1, listener name is custom, no fixed! ! !
2, different listener to use a different port number! ! !
Third, the time bragging
Before this paper appeared, the Chinese Internet over other methods can google to specific solutions, such as listening address configuration 0.0.0.0 and other methods, in fact, it did not able to solve. Error demonstration as follows:
Later, studying kafka official documents, and finally found a concrete solution. Later, another netizen to consult me, the perfect solution to his problem
。。。
Put me Niubi bad
If you resolve your problem, please point Like Comment attention, please share ~