UNCLASSIFIED

You need to sign in or sign up before continuing.
Commit 7ef0bc37 authored by alexander.klepal's avatar alexander.klepal
Browse files

Merge branch 'yeti' into 'development'

script updates

See merge request !19
parents 255cb537 276389bd
Pipeline #419125 passed with stages
in 19 minutes and 30 seconds
#!/usr/bin/env python
import json
import sys
import os
import _jsonnet
import requests
# Rack awareness logic
node_labels = []
rack_labels = []
env_var = 'RACK_NODE_LABELS'
token_path = '/var/run/secrets/kubernetes.io/serviceaccount/token'
if env_var in os.environ:
rack_labels = json.loads(os.environ[env_var])
service_host = os.environ['KUBERNETES_SERVICE_HOST']
tcp_port = os.environ['KUBERNETES_PORT_443_TCP_PORT']
hostname = os.environ['HOSTNAME']
namespace = os.environ['POD_NAMESPACE']
with open(token_path) as f:
kube_token = f.read()
headers = {'Authorization': 'Bearer %s' % kube_token}
# get label value for rack awareness node label
api_url = 'https://%s:%s/api/v1/' % (service_host, tcp_port)
r = requests.get(api_url + 'namespaces/%s/pods/%s' % (namespace, hostname), headers=headers, verify=False)
if r.status_code != 200:
sys.exit(r.json())
node_name = r.json()['spec']['nodeName']
r = requests.get(api_url + 'nodes/%s' % node_name, headers=headers, verify=False)
if r.status_code != 200:
sys.exit(r.json())
node_labels = r.json()['metadata']['labels']
for label in rack_labels:
if label not in node_labels:
sys.exit('node label: %s not found in pod node metadata' % label)
pod_name = sys.argv[1]
data_file = sys.argv[2]
jsonnet_file = sys.argv[3]
output_file = sys.argv[4]
with open(data_file) as df:
data = json.load(df)
with open(jsonnet_file, "r") as jf:
jsonnet_str = jf.read()
json_str = _jsonnet.evaluate_snippet(
"snippet",
jsonnet_str,
ext_vars={
'podName': pod_name,
'data': json.dumps(data),
'nodeLabels': json.dumps(node_labels),
'rackLabels': json.dumps(rack_labels)
},
)
json_obj = json.loads(json_str)
with open(output_file, 'w') as of:
json.dump(json_obj, of)
#!/usr/bin/env bash
#
# Copyright 2020 Confluent Inc.
#
set -o nounset
set -o errexit
if [ ! -d "${CP_COMPONENT_SCRIPT_DIR}" ]; then
mkdir -p "${CP_COMPONENT_SCRIPT_DIR}"
fi
cat "${CONNECT_CONFIG_DIR}/shared/${CP_COMPONENT_NAME}.properties" > "${CP_COMPONENT_SCRIPT_DIR}/${CP_COMPONENT_NAME}.properties"
cat "${CONNECT_CONFIG_DIR}/${CP_COMPONENT_NAME}.properties" >> "${CP_COMPONENT_SCRIPT_DIR}/${CP_COMPONENT_NAME}.properties"
cat "${CONNECT_CONFIG_DIR}/shared/log4j.properties" > "${CP_COMPONENT_SCRIPT_DIR}/log4j.properties"
cat "${CONNECT_CONFIG_DIR}/log4j.properties" >> "${CP_COMPONENT_SCRIPT_DIR}/log4j.properties"
cat "${CONNECT_CONFIG_DIR}/shared/disk-usage-agent.properties" > "${CP_COMPONENT_SCRIPT_DIR}/disk-usage-agent.properties"
cat "${CONNECT_CONFIG_DIR}/shared/jvm.config" > "${CP_COMPONENT_SCRIPT_DIR}/jvm.config"
cat "${CONNECT_CONFIG_DIR}/jvm.config" >> "${CP_COMPONENT_SCRIPT_DIR}/jvm.config"
if [ -e "${CONNECT_CONFIG_DIR}/shared/jolokia.config" ]; then
cat "${CONNECT_CONFIG_DIR}/shared/jolokia.config" > "${CP_COMPONENT_SCRIPT_DIR}/jolokia.config"
fi
#!/usr/bin/env bash
#
# Copyright 2020 Confluent Inc.
#
set -o errexit
echo "===> Adding log4j config ... "
export KAFKA_LOG4J_OPTS="-Dlog4j.configuration=file:${CP_COMPONENT_SCRIPT_DIR}/log4j.properties"
##
## This condition is only required to work with older images
## TODO, this code needs to move removed as the metrics configurion
## is moved to the Operator code.
##
if [ -d /opt/confluent/etc ]; then
echo "===> Configure disk usage agent"
export EXTRA_ARGS="${EXTRA_ARGS} -javaagent:/usr/share/java/cc-base/disk-usage-agent-${CONFLUENT_VERSION}.jar=${CP_COMPONENT_SCRIPT_DIR}/disk-usage-agent.properties"
echo "===> Configure jolokia agent"
export JOLOKIA_AGENT_PORT=${JOLOKIA_AGENT_PORT:-7777}
export JOLOKIA_AGENT_HOST=${JOLOKIA_AGENT_HOST:-"0.0.0.0"}
if [ -e "${CP_COMPONENT_SCRIPT_DIR}/jolokia.config" ]; then
export JOLOKIA_EXTRA_ARGS=",$(cat < "${CP_COMPONENT_SCRIPT_DIR}/jolokia.config")"
fi
if [ -e "/opt/caas/lib/jolokia/jolokia-jvm-1.6.2-agent.jar" ]; then
export EXTRA_ARGS="${EXTRA_ARGS} -javaagent:/opt/caas/lib/jolokia/jolokia-jvm-1.6.2-agent.jar=port=${JOLOKIA_AGENT_PORT},host=${JOLOKIA_AGENT_HOST}${JOLOKIA_EXTRA_ARGS}"
else
export EXTRA_ARGS="${EXTRA_ARGS} -javaagent:/opt/caas/lib/jolokia/jolokia-jvm-1.3.6-agent.jar=port=${JOLOKIA_AGENT_PORT},host=${JOLOKIA_AGENT_HOST}${JOLOKIA_EXTRA_ARGS}"
fi
echo "===> Configure prometheus JMX agent"
export JMX_EXPORTER_AGENT_PORT=${JMX_EXPORTER_AGENT_PORT:-7778}
export JMX_EXPORTER_AGENT_HOST=${JMX_EXPORTER_AGENT_HOST:-"0.0.0.0"}
export EXTRA_ARGS="${EXTRA_ARGS} -javaagent:/opt/caas/lib/jmx_prometheus_javaagent-0.14.0.jar=${JMX_EXPORTER_AGENT_PORT}:/mnt/config/shared/jmx-exporter.yaml"
## requires for now but have to remove in the future iterations
## we need to remove javaagent from the "${CP_COMPONENT_SCRIPT_DIR}/jvm.config" as Operator addes as part of
## new stack deployment
echo "===> Configure JVM config..."
EXTRA_ARGS="$(sed '/-javaagent*/d' "${CP_COMPONENT_SCRIPT_DIR}/jvm.config" | sed '/^$/d' | tr '\n' ' ') $EXTRA_ARGS"
export EXTRA_ARGS
else
echo "===> Configure JVM config..."
EXTRA_ARGS="$(cat < "${CP_COMPONENT_SCRIPT_DIR}/jvm.config" | tr '\n' ' ') ${EXTRA_ARGS}"
export EXTRA_ARGS
fi
export KAFKA_HEAP_OPTS=' '
export KAFKA_JVM_PERFORMANCE_OPTS=' '
export JMX_PORT=' '
exec connect-distributed "${CP_COMPONENT_SCRIPT_DIR}/${CP_COMPONENT_NAME}.properties"
\ No newline at end of file
#!/usr/bin/env bash
#
# Copyright 2020 Confluent Inc.
#
set -o nounset
set -o errexit
export CP_COMPONENT_NAME=connect
export CP_COMPONENT_SCRIPT_DIR=/opt/confluentinc/etc/${CP_COMPONENT_NAME}
export CONNECT_CONFIG_DIR=/mnt/config
echo "===> User"
id
export OPERATOR_SCRIPT_DIR=/mnt/config/${CP_COMPONENT_NAME}
echo "===> Load ${CP_COMPONENT_NAME} operator scripts from path ${OPERATOR_SCRIPT_DIR}/bin"
"${OPERATOR_SCRIPT_DIR}"/bin/configure
"${OPERATOR_SCRIPT_DIR}"/bin/launch
\ No newline at end of file
#!/usr/bin/env bash
#
# Copyright 2020 Confluent Inc.
#
set -o nounset
set -o errexit
if [ ! -d "${CP_COMPONENT_SCRIPT_DIR}" ]; then
mkdir -p "${CP_COMPONENT_SCRIPT_DIR}"
fi
cat "${CONTROL_CENTER_CONFIG_DIR}/shared/${CP_COMPONENT_NAME}.properties" > "${CP_COMPONENT_SCRIPT_DIR}/${CP_COMPONENT_NAME}.properties"
cat "${CONTROL_CENTER_CONFIG_DIR}/${CP_COMPONENT_NAME}.properties" >> "${CP_COMPONENT_SCRIPT_DIR}/${CP_COMPONENT_NAME}.properties"
cat "${CONTROL_CENTER_CONFIG_DIR}/shared/log4j.properties" > "${CP_COMPONENT_SCRIPT_DIR}/log4j.properties"
cat "${CONTROL_CENTER_CONFIG_DIR}/log4j.properties" >> "${CP_COMPONENT_SCRIPT_DIR}/log4j.properties"
cat "${CONTROL_CENTER_CONFIG_DIR}/shared/disk-usage-agent.properties" > "${CP_COMPONENT_SCRIPT_DIR}/disk-usage-agent.properties"
cat "${CONTROL_CENTER_CONFIG_DIR}/shared/jvm.config" > "${CP_COMPONENT_SCRIPT_DIR}/jvm.config"
cat "${CONTROL_CENTER_CONFIG_DIR}/jvm.config" >> "${CP_COMPONENT_SCRIPT_DIR}/jvm.config"
if [ -e "${CONTROL_CENTER_CONFIG_DIR}/shared/jolokia.config" ]; then
cat "${CONTROL_CENTER_CONFIG_DIR}/shared/jolokia.config" > "${CP_COMPONENT_SCRIPT_DIR}/jolokia.config"
fi
#!/usr/bin/env bash
#
# Copyright 2020 Confluent Inc.
#
set -o errexit
echo "===> Adding log4j config ... "
export CONTROL_CENTER_LOG4J_OPTS="-Dlog4j.configuration=file:${CP_COMPONENT_SCRIPT_DIR}/log4j.properties"
##
## This condition is only required to work with older images
## TODO, this code needs to move removed as the metrics configurion
## is moved to the Operator code.
##
if [ -d /opt/confluent/etc ]; then
echo "===> Configure disk usage agent"
export CONTROL_CENTER_OPTS="${CONTROL_CENTER_OPTS} -javaagent:/usr/share/java/cc-base/disk-usage-agent-${CONFLUENT_VERSION}.jar=${CP_COMPONENT_SCRIPT_DIR}/disk-usage-agent.properties"
echo "===> Configure jolokia agent"
export JOLOKIA_AGENT_PORT=${JOLOKIA_AGENT_PORT:-7777}
export JOLOKIA_AGENT_HOST=${JOLOKIA_AGENT_HOST:-"0.0.0.0"}
if [ -e "${CP_COMPONENT_SCRIPT_DIR}/jolokia.config" ]; then
export JOLOKIA_EXTRA_ARGS=",$(cat < "${CP_COMPONENT_SCRIPT_DIR}/jolokia.config")"
fi
if [ -e "/opt/caas/lib/jolokia/jolokia-jvm-1.6.2-agent.jar" ]; then
export CONTROL_CENTER_OPTS="${CONTROL_CENTER_OPTS} -javaagent:/opt/caas/lib/jolokia/jolokia-jvm-1.6.2-agent.jar=port=${JOLOKIA_AGENT_PORT},host=${JOLOKIA_AGENT_HOST}${JOLOKIA_EXTRA_ARGS}"
else
export CONTROL_CENTER_OPTS="${CONTROL_CENTER_OPTS} -javaagent:/opt/caas/lib/jolokia/jolokia-jvm-1.3.6-agent.jar=port=${JOLOKIA_AGENT_PORT},host=${JOLOKIA_AGENT_HOST}${JOLOKIA_EXTRA_ARGS}"
fi
echo "===> Configure prometheus JMX agent"
export JMX_EXPORTER_AGENT_PORT=${JMX_EXPORTER_AGENT_PORT:-7778}
export JMX_EXPORTER_AGENT_HOST=${JMX_EXPORTER_AGENT_HOST:-"0.0.0.0"}
export CONTROL_CENTER_OPTS="${CONTROL_CENTER_OPTS} -javaagent:/opt/caas/lib/jmx_prometheus_javaagent-0.14.0.jar=${JMX_EXPORTER_AGENT_PORT}:/mnt/config/shared/jmx-exporter.yaml"
## requires for now but have to remove in the future iterations
## we need to remove javaagent from the "${CP_COMPONENT_SCRIPT_DIR}/jvm.config" as Operator addes as part of
## new stack deployment
echo "===> Configure JVM config..."
CONTROL_CENTER_OPTS="$(sed '/-javaagent*/d' "${CP_COMPONENT_SCRIPT_DIR}/jvm.config" | sed '/^$/d' | tr '\n' ' ') $CONTROL_CENTER_OPTS"
export CONTROL_CENTER_OPTS
else
echo "===> Configure JVM config..."
CONTROL_CENTER_OPTS="$(cat < "${CP_COMPONENT_SCRIPT_DIR}/jvm.config" | tr '\n' ' ') ${CONTROL_CENTER_OPTS}"
export CONTROL_CENTER_OPTS
fi
export CONTROL_CENTER_HEAP_OPTS=' '
export CONTROL_CENTER_JVM_PERFORMANCE_OPTS=' '
export CONTROL_CENTER_JMX_OPTS=' '
export JMX_PORT=' '
exec control-center-start "${CP_COMPONENT_SCRIPT_DIR}/${CP_COMPONENT_NAME}.properties"
\ No newline at end of file
#!/usr/bin/env bash
#
# Copyright 2020 Confluent Inc.
#
set -o nounset
set -o errexit
export CP_COMPONENT_NAME=controlcenter
export CP_COMPONENT_SCRIPT_DIR=/opt/confluentinc/etc/${CP_COMPONENT_NAME}
export CONTROL_CENTER_CONFIG_DIR=/mnt/config
echo "===> User"
id
export OPERATOR_SCRIPT_DIR=/mnt/config/${CP_COMPONENT_NAME}
echo "===> Load ${CP_COMPONENT_NAME} operator scripts from path ${OPERATOR_SCRIPT_DIR}/bin"
"${OPERATOR_SCRIPT_DIR}"/bin/configure
"${OPERATOR_SCRIPT_DIR}"/bin/launch
\ No newline at end of file
#!/usr/bin/env bash
#
# Copyright 2020 Confluent Inc.
#
set -o nounset
set -o errexit
if [ ! -d "${CP_COMPONENT_SCRIPT_DIR}" ]; then
mkdir -p "${CP_COMPONENT_SCRIPT_DIR}"
fi
cat "${KAFKA_CONFIG_DIR}/shared/${CP_COMPONENT_NAME}.properties" > "${CP_COMPONENT_SCRIPT_DIR}/${CP_COMPONENT_NAME}.properties"
cat "${KAFKA_CONFIG_DIR}/${CP_COMPONENT_NAME}.properties" >> "${CP_COMPONENT_SCRIPT_DIR}/${CP_COMPONENT_NAME}.properties"
cat "${KAFKA_CONFIG_DIR}/shared/log4j.properties" > "${CP_COMPONENT_SCRIPT_DIR}/log4j.properties"
cat "${KAFKA_CONFIG_DIR}/log4j.properties" >> "${CP_COMPONENT_SCRIPT_DIR}/log4j.properties"
cat "${KAFKA_CONFIG_DIR}/shared/disk-usage-agent.properties" > "${CP_COMPONENT_SCRIPT_DIR}/disk-usage-agent.properties"
cat "${KAFKA_CONFIG_DIR}/shared/jvm.config" > "${CP_COMPONENT_SCRIPT_DIR}/jvm.config"
cat "${KAFKA_CONFIG_DIR}/jvm.config" >> "${CP_COMPONENT_SCRIPT_DIR}/jvm.config"
if [ -e "${KAFKA_CONFIG_DIR}/shared/jolokia.config" ]; then
cat "${KAFKA_CONFIG_DIR}/shared/jolokia.config" > "${CP_COMPONENT_SCRIPT_DIR}/jolokia.config"
fi
#!/usr/bin/env bash
#
# Copyright 2020 Confluent Inc.
#
set -o errexit
echo "===> Configure log4j"
export KAFKA_LOG4J_OPTS="-Dlog4j.configuration=file:${CP_COMPONENT_SCRIPT_DIR}/log4j.properties"
##
## This condition is only required to work with older images
## TODO, this code needs to move removed as the metrics configurion
## is moved to the Operator code.
##
if [ -d /opt/confluent/etc ]; then
echo "===> Configure disk usage agent"
export EXTRA_ARGS="${EXTRA_ARGS} -javaagent:/usr/share/java/cc-base/disk-usage-agent-${CONFLUENT_VERSION}.jar=${CP_COMPONENT_SCRIPT_DIR}/disk-usage-agent.properties"
echo "===> Configure jolokia agent"
export JOLOKIA_AGENT_PORT=${JOLOKIA_AGENT_PORT:-7777}
export JOLOKIA_AGENT_HOST=${JOLOKIA_AGENT_HOST:-"0.0.0.0"}
if [ -e "${CP_COMPONENT_SCRIPT_DIR}/jolokia.config" ]; then
export JOLOKIA_EXTRA_ARGS=",$(cat < "${CP_COMPONENT_SCRIPT_DIR}/jolokia.config")"
fi
if [ -e "/opt/caas/lib/jolokia/jolokia-jvm-1.6.2-agent.jar" ]; then
export EXTRA_ARGS="${EXTRA_ARGS} -javaagent:/opt/caas/lib/jolokia/jolokia-jvm-1.6.2-agent.jar=port=${JOLOKIA_AGENT_PORT},host=${JOLOKIA_AGENT_HOST}${JOLOKIA_EXTRA_ARGS}"
else
export EXTRA_ARGS="${EXTRA_ARGS} -javaagent:/opt/caas/lib/jolokia/jolokia-jvm-1.3.6-agent.jar=port=${JOLOKIA_AGENT_PORT},host=${JOLOKIA_AGENT_HOST}${JOLOKIA_EXTRA_ARGS}"
fi
echo "===> Configure prometheus JMX agent"
export JMX_EXPORTER_AGENT_PORT=${JMX_EXPORTER_AGENT_PORT:-7778}
export JMX_EXPORTER_AGENT_HOST=${JMX_EXPORTER_AGENT_HOST:-"0.0.0.0"}
export EXTRA_ARGS="${EXTRA_ARGS} -javaagent:/opt/caas/lib/jmx_prometheus_javaagent-0.14.0.jar=${JMX_EXPORTER_AGENT_PORT}:/mnt/config/shared/jmx-exporter.yaml"
## requires for now but have to remove in the future iterations
## we need to remove javaagent from the "${CP_COMPONENT_SCRIPT_DIR}/jvm.config" as Operator addes as part of
## new stack deployment
echo "===> Configure JVM config..."
EXTRA_ARGS="$(sed '/-javaagent*/d' "${CP_COMPONENT_SCRIPT_DIR}/jvm.config" | sed '/^$/d' | tr '\n' ' ') ${EXTRA_ARGS}"
export EXTRA_ARGS
else
echo "===> Configure JVM config..."
EXTRA_ARGS="$(cat < "${CP_COMPONENT_SCRIPT_DIR}/jvm.config" | tr '\n' ' ') ${EXTRA_ARGS}"
export EXTRA_ARGS
fi
export KAFKA_HEAP_OPTS=' '
export KAFKA_JVM_PERFORMANCE_OPTS=' '
export JMX_PORT=' '
echo "===> Launching ${CP_COMPONENT_NAME} ... "
# shellcheck disable=SC2086
exec kafka-run-class ${EXTRA_ARGS} kafka.Kafka "${CP_COMPONENT_SCRIPT_DIR}/kafka.properties"
#!/usr/bin/env bash
#
# Copyright 2020 Confluent Inc.
#
set -o nounset
set -o errexit
export CP_COMPONENT_NAME=kafka
export CP_COMPONENT_SCRIPT_DIR=/opt/confluentinc/etc/${CP_COMPONENT_NAME}
export KAFKA_CONFIG_DIR=/mnt/config
echo "===> User"
id
export OPERATOR_SCRIPT_DIR=/mnt/config/${CP_COMPONENT_NAME}
echo "===> Load ${CP_COMPONENT_NAME} operator scripts from path ${OPERATOR_SCRIPT_DIR}/bin"
"${OPERATOR_SCRIPT_DIR}"/bin/configure
"${OPERATOR_SCRIPT_DIR}"/bin/launch
#!/usr/bin/env bash
#
# Copyright 2020 Confluent Inc.
#
set -o nounset
set -o errexit
if [ ! -d "${CP_COMPONENT_SCRIPT_DIR}" ]; then
mkdir -p "${CP_COMPONENT_SCRIPT_DIR}"
fi
cat "${KSQL_CONFIG_DIR}/shared/${CP_COMPONENT_NAME}.properties" > "${CP_COMPONENT_SCRIPT_DIR}/${CP_COMPONENT_NAME}.properties"
cat "${KSQL_CONFIG_DIR}/${CP_COMPONENT_NAME}.properties" >> "${CP_COMPONENT_SCRIPT_DIR}/${CP_COMPONENT_NAME}.properties"
cat "${KSQL_CONFIG_DIR}/shared/log4j.properties" > "${CP_COMPONENT_SCRIPT_DIR}/log4j.properties"
cat "${KSQL_CONFIG_DIR}/log4j.properties" >> "${CP_COMPONENT_SCRIPT_DIR}/log4j.properties"
cat "${KSQL_CONFIG_DIR}/shared/disk-usage-agent.properties" > "${CP_COMPONENT_SCRIPT_DIR}/disk-usage-agent.properties"
cat "${KSQL_CONFIG_DIR}/shared/jvm.config" > "${CP_COMPONENT_SCRIPT_DIR}/jvm.config"
cat "${KSQL_CONFIG_DIR}/jvm.config" >> "${CP_COMPONENT_SCRIPT_DIR}/jvm.config"
if [ -e "${KSQL_CONFIG_DIR}/shared/jolokia.config" ]; then
cat "${KSQL_CONFIG_DIR}/shared/jolokia.config" > "${CP_COMPONENT_SCRIPT_DIR}/jolokia.config"
fi
# backward compatibility
if [ -e "${KSQL_CONFIG_DIR}/shared/server_jaas.conf" ]; then
cat "${KSQL_CONFIG_DIR}/shared/server_jaas.conf > ${CP_COMPONENT_SCRIPT_DIR}/server_jaas.conf"
fi
#!/usr/bin/env bash
#
# Copyright 2019 Confluent Inc.
#
set -o errexit
echo "===> Adding log4j config ... "
export KSQL_LOG4J_OPTS="-Dlog4j.configuration=file:${CP_COMPONENT_SCRIPT_DIR}/log4j.properties"
##
## This condition is only required to work with older images
## TODO, this code needs to move removed as the metrics configurion
## is moved to the Operator code.
##
if [ -d /opt/confluent/etc ]; then
echo "===> Configure disk usage agent"
export KSQL_OPTS="${KSQL_OPTS} -javaagent:/usr/share/java/cc-base/disk-usage-agent-${CONFLUENT_VERSION}.jar=${CP_COMPONENT_SCRIPT_DIR}/disk-usage-agent.properties"
echo "===> Configure jolokia agent"
export JOLOKIA_AGENT_PORT=${JOLOKIA_AGENT_PORT:-7777}
export JOLOKIA_AGENT_HOST=${JOLOKIA_AGENT_HOST:-"0.0.0.0"}
if [ -e "${CP_COMPONENT_SCRIPT_DIR}/jolokia.config" ]; then
export JOLOKIA_EXTRA_ARGS=",$(cat < "${CP_COMPONENT_SCRIPT_DIR}/jolokia.config")"
fi
if [ -e "/opt/caas/lib/jolokia/jolokia-jvm-1.6.2-agent.jar" ]; then
export KSQL_OPTS="${KSQL_OPTS} -javaagent:/opt/caas/lib/jolokia/jolokia-jvm-1.6.2-agent.jar=port=${JOLOKIA_AGENT_PORT},host=${JOLOKIA_AGENT_HOST}${JOLOKIA_EXTRA_ARGS}"
else
export KSQL_OPTS="${KSQL_OPTS} -javaagent:/opt/caas/lib/jolokia/jolokia-jvm-1.3.6-agent.jar=port=${JOLOKIA_AGENT_PORT},host=${JOLOKIA_AGENT_HOST}${JOLOKIA_EXTRA_ARGS}"
fi
echo "===> Configure prometheus JMX agent"
export JMX_EXPORTER_AGENT_PORT=${JMX_EXPORTER_AGENT_PORT:-7778}
export JMX_EXPORTER_AGENT_HOST=${JMX_EXPORTER_AGENT_HOST:-"0.0.0.0"}
export KSQL_OPTS="${KSQL_OPTS} -javaagent:/opt/caas/lib/jmx_prometheus_javaagent-0.14.0.jar=${JMX_EXPORTER_AGENT_PORT}:/mnt/config/shared/jmx-exporter.yaml"
## requires for now but have to remove in the future iterations
## we need to remove javaagent from the "${CP_COMPONENT_SCRIPT_DIR}/jvm.config" as Operator addes as part of
## new stack deployment
echo "===> Configure JVM config..."
KSQL_OPTS="$(sed '/-javaagent*/d' "${CP_COMPONENT_SCRIPT_DIR}/jvm.config" | sed '/^$/d' | tr '\n' ' ') $KSQL_OPTS"
export KSQL_OPTS
# for basic authentication, only for backward compabilitiy
if [ -e "${CP_COMPONENT_SCRIPT_DIR}/server_jaas.conf" ]; then
export KSQL_OPTS="${KSQL_OPTS} -Djava.security.auth.login.config=${CP_COMPONENT_SCRIPT_DIR}/server_jaas.conf"
fi
echo "===> Adding KSQL healthcheck Jars in classPath ... "
export KSQL_CLASSPATH=${KSQL_CLASSPATH}:"/opt/confluent/ksql/libs/*"
else
echo "===> Configure JVM config..."
KSQL_OPTS="$(cat < "${CP_COMPONENT_SCRIPT_DIR}/jvm.config" | tr '\n' ' ') ${KSQL_OPTS}"
export KSQL_OPTS
fi
# These ensure that the "if" sections for heap sizing, GC tuning, and JMX opts in SR launch script do not trigger.
export KSQL_HEAP_OPTS=' '
export KSQL_JMX_OPTS=' '
export KSQL_JVM_PERFORMANCE_OPTS=' '
export JMX_PORT=' '
## not in-us, just a place-holder
export LOG_DIR=/mnt/log
echo "===> Launching ${CP_COMPONENT_NAME} ... "
exec ksql-run-class io.confluent.ksql.rest.server.KsqlServerMain "${CP_COMPONENT_SCRIPT_DIR}/${CP_COMPONENT_NAME}.properties"
#!/usr/bin/env bash
#
# Copyright 2020 Confluent Inc.
#
set -o nounset
set -o errexit
export CP_COMPONENT_NAME=ksqldb
export CP_COMPONENT_SCRIPT_DIR=/opt/confluentinc/etc/${CP_COMPONENT_NAME}
export KSQL_CONFIG_DIR=/mnt/config
echo "===> User"
id
export OPERATOR_SCRIPT_DIR=/mnt/config/${CP_COMPONENT_NAME}
echo "===> Load ${CP_COMPONENT_NAME} operator scripts from path ${OPERATOR_SCRIPT_DIR}/bin"
"${OPERATOR_SCRIPT_DIR}"/bin/configure
"${OPERATOR_SCRIPT_DIR}"/bin/launch
\ No newline at end of file
#!/usr/bin/env bash
#
# Copyright 2020 Confluent Inc.
#
set -o nounset
set -o errexit
if [ ! -d "${CP_COMPONENT_SCRIPT_DIR}" ]; then
mkdir -p "${CP_COMPONENT_SCRIPT_DIR}"
fi
cat "${CONNECT_CONFIG_DIR}/shared/${CP_COMPONENT_NAME}.properties" > "${CP_COMPONENT_SCRIPT_DIR}/${CP_COMPONENT_NAME}.properties"
cat "${CONNECT_CONFIG_DIR}/${CP_COMPONENT_NAME}.properties" >> "${CP_COMPONENT_SCRIPT_DIR}/${CP_COMPONENT_NAME}.properties"
cat "${CONNECT_CONFIG_DIR}/shared/log4j.properties" > "${CP_COMPONENT_SCRIPT_DIR}/log4j.properties"
cat "${CONNECT_CONFIG_DIR}/log4j.properties" >> "${CP_COMPONENT_SCRIPT_DIR}/log4j.properties"
cat "${CONNECT_CONFIG_DIR}/shared/disk-usage-agent.properties" > "${CP_COMPONENT_SCRIPT_DIR}/disk-usage-agent.properties"
cat "${CONNECT_CONFIG_DIR}/shared/jvm.config" > "${CP_COMPONENT_SCRIPT_DIR}/jvm.config"
cat "${CONNECT_CONFIG_DIR}/jvm.config" >> "${CP_COMPONENT_SCRIPT_DIR}/jvm.config"
if [ -e "${CONNECT_CONFIG_DIR}/shared/jolokia.config" ]; then
cat "${CONNECT_CONFIG_DIR}/shared/jolokia.config" > "${CP_COMPONENT_SCRIPT_DIR}/jolokia.config"
fi
#!/usr/bin/env bash
#
# Copyright 2020 Confluent Inc.
#
set -o errexit
echo "===> Adding log4j config ... "
export KAFKA_LOG4J_OPTS="-Dlog4j.configuration=file:${CP_COMPONENT_SCRIPT_DIR}/log4j.properties"
##
## This condition is only required to work with older images
## TODO, this code needs to move removed as the metrics configurion
## is moved to the Operator code.
##
if [ -d /opt/confluent/etc ]; then
echo "===> Configure disk usage agent"
export EXTRA_ARGS="${EXTRA_ARGS} -javaagent:/usr/share/java/cc-base/disk-usage-agent-${CONFLUENT_VERSION}.jar=${CP_COMPONENT_SCRIPT_DIR}/disk-usage-agent.properties"
echo "===> Configure jolokia agent"
export JOLOKIA_AGENT_PORT=${JOLOKIA_AGENT_PORT:-7777}
export JOLOKIA_AGENT_HOST=${JOLOKIA_AGENT_HOST:-"0.0.0.0"}
if [ -e "${CP_COMPONENT_SCRIPT_DIR}/jolokia.config" ]; then
export JOLOKIA_EXTRA_ARGS=",$(cat < "${CP_COMPONENT_SCRIPT_DIR}/jolokia.config")"
fi
if [ -e "/opt/caas/lib/jolokia/jolokia-jvm-1.6.2-agent.jar" ]; then
export EXTRA_ARGS="${EXTRA_ARGS} -javaagent:/opt/caas/lib/jolokia/jolokia-jvm-1.6.2-agent.jar=port=${JOLOKIA_AGENT_PORT},host=${JOLOKIA_AGENT_HOST}${JOLOKIA_EXTRA_ARGS}"
else
export EXTRA_ARGS="${EXTRA_ARGS} -javaagent:/opt/caas/lib/jolokia/jolokia-jvm-1.3.6-agent.jar=port=${JOLOKIA_AGENT_PORT},host=${JOLOKIA_AGENT_HOST}${JOLOKIA_EXTRA_ARGS}"
fi
echo "===> Configure prometheus JMX agent"
export JMX_EXPORTER_AGENT_PORT=${JMX_EXPORTER_AGENT_PORT:-7778}
export JMX_EXPORTER_AGENT_HOST=${JMX_EXPORTER_AGENT_HOST:-"0.0.0.0"}
export EXTRA_ARGS="${EXTRA_ARGS} -javaagent:/opt/caas/lib/jmx_prometheus_javaagent-0.14.0.jar=${JMX_EXPORTER_AGENT_PORT}:/mnt/config/shared/jmx-exporter.yaml"
## requires for now but have to remove in the future iterations
## we need to remove javaagent from the "${CP_COMPONENT_SCRIPT_DIR}/jvm.config" as Operator addes as part of
## new stack deployment
echo "===> Configure JVM config..."
EXTRA_ARGS="$(sed '/-javaagent*/d' "${CP_COMPONENT_SCRIPT_DIR}/jvm.config" | sed '/^$/d' | tr '\n' ' ') $EXTRA_ARGS"
export EXTRA_ARGS
else
echo "===> Configure JVM config..."
EXTRA_ARGS="$(cat < "${CP_COMPONENT_SCRIPT_DIR}/jvm.config" | tr '\n' ' ') ${EXTRA_ARGS}"
export EXTRA_ARGS
fi
export KAFKA_HEAP_OPTS=' '
export KAFKA_JVM_PERFORMANCE_OPTS=' '
export JMX_PORT=' '
exec connect-distributed "${CP_COMPONENT_SCRIPT_DIR}/${CP_COMPONENT_NAME}.properties"
\ No newline at end of file
#!/usr/bin/env bash
#
# Copyright 2020 Confluent Inc.
#
set -o nounset
set -o errexit
export CP_COMPONENT_NAME=replicator
export CP_COMPONENT_SCRIPT_DIR=/opt/confluentinc/etc/${CP_COMPONENT_NAME}
export CONNECT_CONFIG_DIR=/mnt/config
echo "===> User"
id
export OPERATOR_SCRIPT_DIR=/mnt/config/${CP_COMPONENT_NAME}
echo "===> Load ${CP_COMPONENT_NAME} operator scripts from path ${OPERATOR_SCRIPT_DIR}/bin"
"${OPERATOR_SCRIPT_DIR}"/bin/configure
"${OPERATOR_SCRIPT_DIR}"/bin/launch
\ No newline at end of file
#!/usr/bin/env bash
#
# Copyright 2020 Confluent Inc.
#
set -o nounset
set -o errexit
if [ ! -d "${CP_COMPONENT_SCRIPT_DIR}" ]; then
mkdir -p "${CP_COMPONENT_SCRIPT_DIR}"
fi
cat "${SR_CONFIG_DIR}/shared/${CP_COMPONENT_NAME}.properties" > "${CP_COMPONENT_SCRIPT_DIR}/${CP_COMPONENT_NAME}.properties"
cat "${SR_CONFIG_DIR}/${CP_COMPONENT_NAME}.properties" >> "${CP_COMPONENT_SCRIPT_DIR}/${CP_COMPONENT_NAME}.properties"
cat "${SR_CONFIG_DIR}/shared/log4j.properties" > "${CP_COMPONENT_SCRIPT_DIR}/log4j.properties"
cat "${SR_CONFIG_DIR}/log4j.properties" >> "${CP_COMPONENT_SCRIPT_DIR}/log4j.properties"
cat "${SR_CONFIG_DIR}/shared/jvm.config" > "${CP_COMPONENT_SCRIPT_DIR}/jvm.config"
cat "${SR_CONFIG_DIR}/jvm.config" >> "${CP_COMPONENT_SCRIPT_DIR}/jvm.config"
if [ -e "${SR_CONFIG_DIR}/shared/jolokia.config" ]; then
cat "${SR_CONFIG_DIR}/shared/jolokia.config" > "${CP_COMPONENT_SCRIPT_DIR}/jolokia.config"
fi
#!/usr/bin/env bash
#
# Copyright 2018 Confluent Inc.
#
set -o errexit
echo "===> Adding log4j config ... "
export SCHEMA_REGISTRY_LOG4J_OPTS="-Dlog4j.configuration=file:${CP_COMPONENT_SCRIPT_DIR}/log4j.properties"
if [ -d /opt/confluent/etc ]; then
echo "===> Configure jolokia agent"
export JOLOKIA_AGENT_PORT=${JOLOKIA_AGENT_PORT:-7777}
export JOLOKIA_AGENT_HOST=${JOLOKIA_AGENT_HOST:-"0.0.0.0"}
if [ -e "${CP_COMPONENT_SCRIPT_DIR}/jolokia.config" ]; then
export JOLOKIA_EXTRA_ARGS=",$(cat < "${CP_COMPONENT_SCRIPT_DIR}/jolokia.config")"
fi
if [ -e "/opt/caas/lib/jolokia/jolokia-jvm-1.6.2-agent.jar" ]; then
export SCHEMA_REGISTRY_OPTS="${SCHEMA_REGISTRY_OPTS} -javaagent:/opt/caas/lib/jolokia/jolokia-jvm-1.6.2-agent.jar=port=${JOLOKIA_AGENT_PORT},host=${JOLOKIA_AGENT_HOST}${JOLOKIA_EXTRA_ARGS}"
else
export SCHEMA_REGISTRY_OPTS="${SCHEMA_REGISTRY_OPTS} -javaagent:/opt/caas/lib/jolokia/jolokia-jvm-1.3.6-agent.jar=port=${JOLOKIA_AGENT_PORT},host=${JOLOKIA_AGENT_HOST}${JOLOKIA_EXTRA_ARGS}"
fi
echo "===> Configure prometheus JMX agent"
export JMX_EXPORTER_AGENT_PORT=${JMX_EXPORTER_AGENT_PORT:-7778}
export JMX_EXPORTER_AGENT_HOST=${JMX_EXPORTER_AGENT_HOST:-"0.0.0.0"}
export SCHEMA_REGISTRY_OPTS="${SCHEMA_REGISTRY_OPTS} -javaagent:/opt/caas/lib/jmx_prometheus_javaagent-0.14.0.jar=${JMX_EXPORTER_AGENT_PORT}:/mnt/config/shared/jmx-exporter.yaml"
## requires for now but have to remove in the future iterations
## we need to remove javaagent from the "${CP_COMPONENT_SCRIPT_DIR}/jvm.config" as Operator addes as part of
## new stack deployment
echo "===> Configure JVM config..."
SCHEMA_REGISTRY_OPTS="$(sed '/-javaagent*/d' "${CP_COMPONENT_SCRIPT_DIR}/jvm.config" | sed '/^$/d' | tr '\n' ' ') ${SCHEMA_REGISTRY_OPTS}"
export SCHEMA_REGISTRY_OPTS
else
echo "===> Configure JVM config..."
SCHEMA_REGISTRY_OPTS="$(cat < "${CP_COMPONENT_SCRIPT_DIR}/jvm.config" | tr '\n' ' ') ${SCHEMA_REGISTRY_OPTS}"
export SCHEMA_REGISTRY_OPTS
fi
# These ensure that the "if" sections for heap sizing, GC tuning, and JMX opts in SR launch script do not trigger.
export SCHEMA_REGISTRY_HEAP_OPTS=' '
export SCHEMA_REGISTRY_JMX_OPTS=' '
export SCHEMA_REGISTRY_JVM_PERFORMANCE_OPTS=' '
export JMX_PORT=' '
exec schema-registry-start "${CP_COMPONENT_SCRIPT_DIR}/${CP_COMPONENT_NAME}.properties"
#!/usr/bin/env bash
#
# Copyright 2020 Confluent Inc.
#
set -o nounset
set -o errexit
export CP_COMPONENT_NAME=schemaregistry
export CP_COMPONENT_SCRIPT_DIR=/opt/confluentinc/etc/${CP_COMPONENT_NAME}
export SR_CONFIG_DIR=/mnt/config
echo "===> User"
id
export OPERATOR_SCRIPT_DIR=/mnt/config/${CP_COMPONENT_NAME}
echo "===> Load ${CP_COMPONENT_NAME} operator scripts from path ${OPERATOR_SCRIPT_DIR}/bin"
"${OPERATOR_SCRIPT_DIR}"/bin/configure
"${OPERATOR_SCRIPT_DIR}"/bin/launch
\ No newline at end of file
#!/usr/bin/env bash
#
# Copyright 2020 Confluent Inc.
#
set -o nounset
set -o errexit
if [ ! -d "${CP_COMPONENT_SCRIPT_DIR}" ]; then
mkdir -p "${CP_COMPONENT_SCRIPT_DIR}"
fi
# load configuration
cat "${ZOOKEEPER_CONFIG_DIR}/myid" > "${ZOOKEEPER_DATA_DIR}/myid"
cat "${ZOOKEEPER_CONFIG_DIR}"/shared/zookeeper.properties > "${CP_COMPONENT_SCRIPT_DIR}/${CP_COMPONENT_NAME}.properties"
cat "${ZOOKEEPER_CONFIG_DIR}"/zookeeper.properties >> "${CP_COMPONENT_SCRIPT_DIR}/${CP_COMPONENT_NAME}.properties"
cat "${ZOOKEEPER_CONFIG_DIR}"/shared/log4j.properties > "${CP_COMPONENT_SCRIPT_DIR}/log4j.properties"
cat "${ZOOKEEPER_CONFIG_DIR}"/log4j.properties >> "${CP_COMPONENT_SCRIPT_DIR}/log4j.properties"
cat "${ZOOKEEPER_CONFIG_DIR}"/shared/disk-usage-agent.properties > "${CP_COMPONENT_SCRIPT_DIR}/disk-usage-agent.properties"
cat "${ZOOKEEPER_CONFIG_DIR}"/shared/jvm.config > "${CP_COMPONENT_SCRIPT_DIR}/jvm.config"
cat "${ZOOKEEPER_CONFIG_DIR}"/jvm.config >> "${CP_COMPONENT_SCRIPT_DIR}/jvm.config"
if [ -e "${ZOOKEEPER_CONFIG_DIR}/shared/jolokia.config" ]; then
cat "${ZOOKEEPER_CONFIG_DIR}"/shared/jolokia.config > "${CP_COMPONENT_SCRIPT_DIR}/jolokia.config"
fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment