feat: add Apache Kafka#1871
Open
tanansatpal wants to merge 6 commits into
Open
Conversation
>> >> Adds a new script: >> >> - kafka: Apache Kafka 4.x in KRaft mode (no ZooKeeper), single-node >> broker + controller, OpenJDK 21 on Debian 13. CLI tools linked into >> /usr/local/bin. Cluster info saved to /root/kafka.creds >> >> The script is tested end-to-end on Proxmox VE 9.1.
1. Rename from Kafka to Apache kafka 2. Remove comments 3. Add user and group by default for new installation 4. remove hardcoded scala version
1. Fix the installer issue because of name change 2. remove hardcode scala version from kafka.sh as well 3. EnvironmentFile issue with export not supported, only key value
User facing logs prints Apache Kafka instead of just kafka
Rename Kafka to Apache Kafka
CrazyWolf13
requested changes
May 29, 2026
| CURRENT=$(cat /opt/kafka/.version 2>/dev/null || echo "0.0.0") | ||
|
|
||
| if [[ "$RELEASE" == "$CURRENT" ]]; then | ||
| msg_ok "Apache Kafka is already at v${CURRENT}." |
| msg_ok "Stopped Apache Kafka" | ||
|
|
||
| msg_info "Backing up configuration" | ||
| cp -a /opt/kafka/config /opt/kafka-config.bak |
Member
There was a problem hiding this comment.
points in folder names are not really ideal
Comment on lines
+56
to
+57
| cd /tmp | ||
| curl -fsSLO "https://downloads.apache.org/kafka/${RELEASE}/kafka_${SCALA_VERSION}-${RELEASE}.tgz" |
Member
There was a problem hiding this comment.
move to tmp instead of of cd to tmp
Comment on lines
+59
to
+66
| mv /opt/kafka /opt/kafka.old | ||
| tar -xzf "kafka_${SCALA_VERSION}-${RELEASE}.tgz" -C /opt | ||
| mv "/opt/kafka_${SCALA_VERSION}-${RELEASE}" /opt/kafka | ||
| cp -a /opt/kafka-config.bak/. /opt/kafka/config/ | ||
| echo "${RELEASE}" >/opt/kafka/.version | ||
| chown -R kafka:kafka /opt/kafka | ||
| rm -f "/tmp/kafka_${SCALA_VERSION}-${RELEASE}.tgz" | ||
| rm -rf /opt/kafka-config.bak /opt/kafka.old |
Member
There was a problem hiding this comment.
you may be able to use this: https://github.com/community-scripts/ProxmoxVE/blob/main/misc/tools.func#L8610
Comment on lines
+102
to
+105
| cat <<'EOF' >/opt/kafka/config/kafka-env.sh | ||
| KAFKA_HEAP_OPTS="-Xms512M -Xmx1G" | ||
| KAFKA_JVM_PERFORMANCE_OPTS="-server -XX:+UseG1GC -XX:MaxGCPauseMillis=20 -XX:InitiatingHeapOccupancyPercent=35 -XX:+ExplicitGCInvokesConcurrent -XX:MaxInlineLevel=15 -Djava.awt.headless=true" | ||
| LOG_DIR=/var/log/kafka |
Member
There was a problem hiding this comment.
possibly add this to a website note, if people add more ram
|
|
||
| msg_info "Saving cluster info" | ||
| { | ||
| echo "Apache Kafka Version: ${KAFKA_VERSION}" |
| echo "Config: /opt/kafka/config/server.properties" | ||
| } >/root/kafka.creds | ||
| chmod 600 /root/kafka.creds | ||
| msg_ok "Saved cluster info to /root/kafka.creds" |
Member
There was a problem hiding this comment.
an msg block for things that take like 1 second doesn't really make sense, can you reduce the usage a bit?
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scripts which are clearly AI generated and not further revised by the Author of this PR (in terms of Coding Standards and Script Layout) may be closed without review.
✍️ Description
Adds a new script that installs Apache Kafka in KRaft mode (single-node
combined broker + controller) on Debian 12. Runs natively under OpenJDK 17,
exposes :9092 (clients) and :9093 (controller, internal). CLI tools are
linked into /usr/local/bin for global use. Cluster info is saved to
/root/kafka.creds.
🔗 Related PR / Issue
Link: #
✅ Prerequisites (X in brackets)
arm64 Support (X in brackets)
🛠️ Type of Change (X in brackets)
README,AppName.md,CONTRIBUTING.md, or other docs.🔍 Code & Security Review (X in brackets)
Code_Audit.md&CONTRIBUTING.mdguidelinesAppName.sh,AppName-install.sh,AppName.json)📋 Additional Information (optional)
📦 Application Requirements (for new scripts)
🌐 Source
Apache Kafka
Apache Kafka | GitHub