Make Kafka listen on all interfaces

It seems that even if host.name is configured with IPv4,
Kafka still listens on IPv6 (if available). As a consequence
in some scenarios (https://review.openstack.org/#/c/409144/
Patch-Set 13) some services are unable to connect to Kafka.

Change-Id: I12be88eac41edefde8b3936f4a92de4f636907d9
This commit is contained in:
Jakub Wachowski 2016-12-13 14:55:17 +01:00
parent dfd1b2f201
commit cbf8e42732
2 changed files with 1 additions and 5 deletions

View File

@ -26,7 +26,7 @@ broker.id=0
port=9092
# Hostname the broker will bind to. If not set, the server will bind to all interfaces
host.name=127.0.0.1
#host.name=127.0.0.1
# Hostname the broker will advertise to producers and consumers. If not set, it uses the
# value for "host.name" if configured. Otherwise, it will use the value returned from

View File

@ -456,10 +456,6 @@ function install_kafka {
sudo chmod 644 /etc/kafka/server.properties
if [[ ${SERVICE_HOST} ]]; then
sudo sed -i "s/host\.name=127\.0\.0\.1/host.name=${SERVICE_HOST}/g" /etc/kafka/server.properties
fi
sudo systemctl enable kafka
sudo systemctl start kafka || sudo systemctl restart kafka