-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create script-db-clients.sh * add kafka (confluent) * add home Co-authored-by: QPod0 <QPod0@[email protected]>
- Loading branch information
Showing
4 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
source /opt/utils/script-utils.sh | ||
|
||
|
||
setup_postgresql_client() { | ||
local VER_PG=${VERSION_PG:-"14"} | ||
# from: https://www.postgresql.org/download/linux/ubuntu/ | ||
echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list | ||
curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - | ||
sudo apt-get update | ||
# will download ~9MB files and use ~55MB disk after installation | ||
sudo apt-get -y install "postgresql-client-${VER_PG}" | ||
echo "@ Version of psql:" && psql --version | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Distributed under the terms of the Modified BSD License. | ||
ARG BASE_NAMESPACE | ||
ARG BASE_IMG="jdk11" | ||
FROM ${BASE_NAMESPACE:+$BASE_NAMESPACE/}${BASE_IMG} | ||
|
||
LABEL maintainer="[email protected]" | ||
|
||
COPY work /opt/utils/ | ||
|
||
ENV KAFKA_HOME=/opt/kafka | ||
|
||
RUN source /opt/utils/script-confluent-kafka.sh \ | ||
&& echo "Install confluent-kafka:" && setup_confluent_kafka \ | ||
&& echo "Clean up" && list_installed_packages && install__clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
source /opt/utils/script-utils.sh | ||
|
||
setup_confluent_kafka() { | ||
# ref: https://docs.confluent.io/platform/current/installation/installing_cp/zip-tar.html#get-the-software | ||
local VER_C_KAFKA_MINOR=${VERSION_CONFLUENT_KAFKA:-"7.2.2"} | ||
local VER_C_KAFKA_MAJOR=${VERSION_CONFLUENT_KAFKA:-"7.2"} | ||
install_tar_gz "http://packages.confluent.io/archive/${VER_C_KAFKA_MAJOR}/confluent-${VER_C_KAFKA_MINOR}.tar.gz" | ||
mv /opt/confluent-* /opt/kafka | ||
export KAFKA_HOME=/opt/kafka | ||
ls -alh ${KAFKA_HOME}/* | ||
} | ||
|
||
setup_confluent_kafka_kraft() { | ||
# ref: https://github.com/confluentinc/cp-all-in-one/blob/7.2.1-post/cp-all-in-one-kraft/update_run.sh | ||
# Docker workaround: Remove check for KAFKA_ZOOKEEPER_CONNECT parameter | ||
sed -i '/KAFKA_ZOOKEEPER_CONNECT/d' ${KAFKA_HOME}/etc/confluent/docker/configure | ||
# Docker workaround: Ignore cub zk-ready | ||
sed -i 's/cub zk-ready/echo ignore zk-ready/' ${KAFKA_HOME}/etc/confluent/docker/ensure | ||
# KRaft required step: Format the storage directory with a new cluster ID | ||
echo "kafka-storage format --ignore-formatted -t $(kafka-storage random-uuid) -c ${KAFKA_HOME}/etc/kafka/kafka.properties" >>${KAFKA_HOME}/etc/confluent/docker/ensure | ||
} |