Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[kafka] Using $(hostname -s) vs ${HOSTNAME} #1146

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions kafka/cruise-control.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function build_cruise_control() {

function update_kafka_metrics_reporter() {
if [[ ! -d "${CRUISE_CONTROL_HOME}" ]]; then
echo "Kafka is not installed on this node ${HOSTNAME}, skip configuring Cruise Control."
echo "Kafka is not installed on this node $(hostname -s), skip configuring Cruise Control."
return 0
fi

Expand Down Expand Up @@ -100,7 +100,7 @@ function start_cruise_control_server() {
err "Metrics topic __CruiseControlMetrics was not found in the cluster."
fi

echo "Start Cruise Control server on ${HOSTNAME}."
echo "Start Cruise Control server on $(hostname -s)."
pushd ${CRUISE_CONTROL_HOME}
./kafka-cruise-control-start.sh config/cruisecontrol.properties &
popd
Expand All @@ -111,7 +111,7 @@ function main() {
build_cruise_control
update_kafka_metrics_reporter
# Run CC on the first master node.
if [[ "${HOSTNAME}" == *-m || "${HOSTNAME}" == *-m-0 ]]; then
if [[ "$(hostname -s)" == *-m || "$(hostname -s)" == *-m-0 ]]; then
configure_cruise_control_server
start_cruise_control_server
fi
Expand Down
4 changes: 2 additions & 2 deletions kafka/kafka-manager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function configure_and_start_cmak(){
cd /opt/"${KAFKA_MANAGER_VERSION}"
sed -i 's/cmak.zkhosts="kafka-manager-zookeeper:2181"/cmak.zkhosts=\"'"${zkhosts}"'\"/g' conf/application.conf

echo "Starting Kafka Manager server on ${HOSTNAME}:${KAFKA_MANAGER_HTTP_PORT}."
echo "Starting Kafka Manager server on $(hostname -s):${KAFKA_MANAGER_HTTP_PORT}."
./bin/cmak -Dconfig.file=conf/application.conf -Dhttp.port="${KAFKA_MANAGER_HTTP_PORT}" &
}

Expand All @@ -94,7 +94,7 @@ function main(){
exit 1
else
# Run Kafka Manager on the first master node.
if [[ "${HOSTNAME}" == *-m || "${HOSTNAME}" == *-m-0 ]]; then
if [[ "$(hostname -s)" == *-m || "$(hostname -s)" == *-m-0 ]]; then
install_packages
add_sources
install_sbt
Expand Down