@techwavedev/agi-agent-kit 1.1.7 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of @techwavedev/agi-agent-kit might be problematic. Click here for more details.
- package/CHANGELOG.md +82 -1
- package/README.md +190 -12
- package/bin/init.js +30 -2
- package/package.json +6 -3
- package/templates/base/AGENTS.md +54 -23
- package/templates/base/README.md +325 -0
- package/templates/base/directives/memory_integration.md +95 -0
- package/templates/base/execution/memory_manager.py +309 -0
- package/templates/base/execution/session_boot.py +218 -0
- package/templates/base/execution/session_init.py +320 -0
- package/templates/base/skill-creator/SKILL_skillcreator.md +23 -36
- package/templates/base/skill-creator/scripts/init_skill.py +18 -135
- package/templates/skills/ec/README.md +31 -0
- package/templates/skills/ec/aws/SKILL.md +1020 -0
- package/templates/skills/ec/aws/defaults.yaml +13 -0
- package/templates/skills/ec/aws/references/common_patterns.md +80 -0
- package/templates/skills/ec/aws/references/mcp_servers.md +98 -0
- package/templates/skills/ec/aws-terraform/SKILL.md +349 -0
- package/templates/skills/ec/aws-terraform/references/best_practices.md +394 -0
- package/templates/skills/ec/aws-terraform/references/checkov_reference.md +337 -0
- package/templates/skills/ec/aws-terraform/scripts/configure_mcp.py +150 -0
- package/templates/skills/ec/confluent-kafka/SKILL.md +655 -0
- package/templates/skills/ec/confluent-kafka/references/ansible_playbooks.md +792 -0
- package/templates/skills/ec/confluent-kafka/references/ec_deployment.md +579 -0
- package/templates/skills/ec/confluent-kafka/references/kraft_migration.md +490 -0
- package/templates/skills/ec/confluent-kafka/references/troubleshooting.md +778 -0
- package/templates/skills/ec/confluent-kafka/references/upgrade_7x_to_8x.md +488 -0
- package/templates/skills/ec/confluent-kafka/scripts/kafka_health_check.py +435 -0
- package/templates/skills/ec/confluent-kafka/scripts/upgrade_preflight.py +568 -0
- package/templates/skills/ec/confluent-kafka/scripts/validate_config.py +455 -0
- package/templates/skills/ec/consul/SKILL.md +427 -0
- package/templates/skills/ec/consul/references/acl_setup.md +168 -0
- package/templates/skills/ec/consul/references/ha_config.md +196 -0
- package/templates/skills/ec/consul/references/troubleshooting.md +267 -0
- package/templates/skills/ec/consul/references/upgrades.md +213 -0
- package/templates/skills/ec/consul/scripts/consul_health_report.py +530 -0
- package/templates/skills/ec/consul/scripts/consul_status.py +264 -0
- package/templates/skills/ec/consul/scripts/generate_values.py +170 -0
- package/templates/skills/ec/documentation/SKILL.md +351 -0
- package/templates/skills/ec/documentation/references/best_practices.md +201 -0
- package/templates/skills/ec/documentation/scripts/analyze_code.py +307 -0
- package/templates/skills/ec/documentation/scripts/detect_changes.py +460 -0
- package/templates/skills/ec/documentation/scripts/generate_changelog.py +312 -0
- package/templates/skills/ec/documentation/scripts/sync_docs.py +272 -0
- package/templates/skills/ec/documentation/scripts/update_skill_docs.py +366 -0
- package/templates/skills/ec/gitlab/SKILL.md +529 -0
- package/templates/skills/ec/gitlab/references/agent_installation.md +416 -0
- package/templates/skills/ec/gitlab/references/api_reference.md +508 -0
- package/templates/skills/ec/gitlab/references/gitops_flux.md +465 -0
- package/templates/skills/ec/gitlab/references/troubleshooting.md +518 -0
- package/templates/skills/ec/gitlab/scripts/generate_agent_values.py +329 -0
- package/templates/skills/ec/gitlab/scripts/gitlab_agent_status.py +414 -0
- package/templates/skills/ec/jira/SKILL.md +484 -0
- package/templates/skills/ec/jira/references/jql_reference.md +148 -0
- package/templates/skills/ec/jira/scripts/add_comment.py +91 -0
- package/templates/skills/ec/jira/scripts/bulk_log_work.py +124 -0
- package/templates/skills/ec/jira/scripts/create_ticket.py +162 -0
- package/templates/skills/ec/jira/scripts/get_ticket.py +191 -0
- package/templates/skills/ec/jira/scripts/jira_client.py +383 -0
- package/templates/skills/ec/jira/scripts/log_work.py +154 -0
- package/templates/skills/ec/jira/scripts/search_tickets.py +104 -0
- package/templates/skills/ec/jira/scripts/update_comment.py +67 -0
- package/templates/skills/ec/jira/scripts/update_ticket.py +161 -0
- package/templates/skills/ec/karpenter/SKILL.md +301 -0
- package/templates/skills/ec/karpenter/references/ec2nodeclasses.md +421 -0
- package/templates/skills/ec/karpenter/references/migration.md +396 -0
- package/templates/skills/ec/karpenter/references/nodepools.md +400 -0
- package/templates/skills/ec/karpenter/references/troubleshooting.md +359 -0
- package/templates/skills/ec/karpenter/scripts/generate_ec2nodeclass.py +187 -0
- package/templates/skills/ec/karpenter/scripts/generate_nodepool.py +245 -0
- package/templates/skills/ec/karpenter/scripts/karpenter_status.py +359 -0
- package/templates/skills/ec/opensearch/SKILL.md +720 -0
- package/templates/skills/ec/opensearch/references/ml_neural_search.md +576 -0
- package/templates/skills/ec/opensearch/references/operator.md +532 -0
- package/templates/skills/ec/opensearch/references/query_dsl.md +532 -0
- package/templates/skills/ec/opensearch/scripts/configure_mcp.py +148 -0
- package/templates/skills/ec/victoriametrics/SKILL.md +598 -0
- package/templates/skills/ec/victoriametrics/references/kubernetes.md +531 -0
- package/templates/skills/ec/victoriametrics/references/prometheus_migration.md +333 -0
- package/templates/skills/ec/victoriametrics/references/troubleshooting.md +442 -0
- package/templates/skills/knowledge/SKILLS_CATALOG.md +274 -4
- package/templates/skills/knowledge/intelligent-routing/SKILL.md +237 -164
- package/templates/skills/knowledge/parallel-agents/SKILL.md +345 -73
- package/templates/skills/knowledge/plugin-discovery/SKILL.md +582 -0
- package/templates/skills/knowledge/plugin-discovery/scripts/platform_setup.py +1083 -0
- package/templates/skills/knowledge/design-md/README.md +0 -34
- package/templates/skills/knowledge/design-md/SKILL.md +0 -193
- package/templates/skills/knowledge/design-md/examples/DESIGN.md +0 -154
- package/templates/skills/knowledge/notebooklm-mcp/SKILL.md +0 -71
- package/templates/skills/knowledge/notebooklm-mcp/assets/example_asset.txt +0 -24
- package/templates/skills/knowledge/notebooklm-mcp/references/api_reference.md +0 -34
- package/templates/skills/knowledge/notebooklm-mcp/scripts/example.py +0 -19
- package/templates/skills/knowledge/react-components/README.md +0 -36
- package/templates/skills/knowledge/react-components/SKILL.md +0 -53
- package/templates/skills/knowledge/react-components/examples/gold-standard-card.tsx +0 -80
- package/templates/skills/knowledge/react-components/package-lock.json +0 -231
- package/templates/skills/knowledge/react-components/package.json +0 -16
- package/templates/skills/knowledge/react-components/resources/architecture-checklist.md +0 -15
- package/templates/skills/knowledge/react-components/resources/component-template.tsx +0 -37
- package/templates/skills/knowledge/react-components/resources/stitch-api-reference.md +0 -14
- package/templates/skills/knowledge/react-components/resources/style-guide.json +0 -27
- package/templates/skills/knowledge/react-components/scripts/fetch-stitch.sh +0 -30
- package/templates/skills/knowledge/react-components/scripts/validate.js +0 -68
- package/templates/skills/knowledge/self-update/SKILL.md +0 -60
- package/templates/skills/knowledge/self-update/scripts/update_kit.py +0 -103
- package/templates/skills/knowledge/stitch-loop/README.md +0 -54
- package/templates/skills/knowledge/stitch-loop/SKILL.md +0 -235
- package/templates/skills/knowledge/stitch-loop/examples/SITE.md +0 -73
- package/templates/skills/knowledge/stitch-loop/examples/next-prompt.md +0 -25
- package/templates/skills/knowledge/stitch-loop/resources/baton-schema.md +0 -61
- package/templates/skills/knowledge/stitch-loop/resources/site-template.md +0 -104
|
@@ -0,0 +1,488 @@
|
|
|
1
|
+
# Confluent Kafka Upgrade Guide: 7.x to 8.x
|
|
2
|
+
|
|
3
|
+
Complete guide for upgrading Confluent Platform from 7.x versions to 8.x with tarball installations.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## ⚠️ EC Environment Path Mappings
|
|
8
|
+
|
|
9
|
+
> **This guide uses standard Confluent paths in examples.** For EC deployments, substitute paths as follows:
|
|
10
|
+
|
|
11
|
+
| Standard Path | EC Path |
|
|
12
|
+
| --------------------- | -------------------------------------------------------- |
|
|
13
|
+
| `/opt/confluent/` | `{{ base_path }}/opt/confluent-{{ confluent_version }}/` |
|
|
14
|
+
| `/var/kafka-logs/` | `{{ base_path }}/opt/data` |
|
|
15
|
+
| `/var/log/confluent/` | `{{ base_path }}/logs/` |
|
|
16
|
+
| `/var/ssl/kafka/` | `{{ base_path }}/opt/ssl/` |
|
|
17
|
+
| `localhost:9092` | `$BOOTSTRAP` (use SSL port 9443) |
|
|
18
|
+
| `sudo systemctl` | `systemctl --user` |
|
|
19
|
+
|
|
20
|
+
**EC Quick Setup:**
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
export KAFKA_HOME={{ base_path }}/opt/confluent-{{ confluent_version }}
|
|
24
|
+
export BOOTSTRAP={{ broker_host_1 }}:{{ broker_port }}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
See **[ec_deployment.md](ec_deployment.md)** for complete EC paths and configuration.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Table of Contents
|
|
32
|
+
|
|
33
|
+
1. [Version Compatibility Matrix](#version-compatibility-matrix)
|
|
34
|
+
2. [Breaking Changes](#breaking-changes)
|
|
35
|
+
3. [Pre-Upgrade Requirements](#pre-upgrade-requirements)
|
|
36
|
+
4. [Upgrade Order](#upgrade-order)
|
|
37
|
+
5. [Rolling Upgrade Procedure](#rolling-upgrade-procedure)
|
|
38
|
+
6. [Post-Upgrade Validation](#post-upgrade-validation)
|
|
39
|
+
7. [Rollback Procedure](#rollback-procedure)
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Version Compatibility Matrix
|
|
44
|
+
|
|
45
|
+
| Source Version | Target Version | Java Minimum | KRaft Support | Notes |
|
|
46
|
+
| -------------- | -------------- | ------------ | ------------------- | ----------------------- |
|
|
47
|
+
| 7.3.x | 8.0.x | Java 17 | Migration supported | Upgrade to 7.6 first |
|
|
48
|
+
| 7.4.x | 8.0.x | Java 17 | Migration supported | Recommended path |
|
|
49
|
+
| 7.5.x | 8.0.x | Java 17 | Migration supported | Direct upgrade possible |
|
|
50
|
+
| 7.6.x | 8.0.x | Java 17 | Migration supported | Seamless upgrade |
|
|
51
|
+
| 7.x (any) | 8.1.x | Java 17 | KRaft GA | Via 8.0.x if from <7.5 |
|
|
52
|
+
|
|
53
|
+
### Java Version Requirements
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# Check current Java version
|
|
57
|
+
java -version
|
|
58
|
+
|
|
59
|
+
# 8.x requires Java 17+
|
|
60
|
+
# Install Amazon Corretto 17 (recommended)
|
|
61
|
+
curl -LO https://corretto.aws/downloads/latest/amazon-corretto-17-x64-linux-jdk.tar.gz
|
|
62
|
+
tar -xzf amazon-corretto-17-x64-linux-jdk.tar.gz -C /opt/
|
|
63
|
+
export JAVA_HOME=/opt/amazon-corretto-17.0.9.8.1-linux-x64
|
|
64
|
+
export PATH=$JAVA_HOME/bin:$PATH
|
|
65
|
+
|
|
66
|
+
# Update KAFKA_HEAP_OPTS if needed in systemd unit
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Breaking Changes
|
|
72
|
+
|
|
73
|
+
### Removed Features
|
|
74
|
+
|
|
75
|
+
| Feature | Replacement |
|
|
76
|
+
| ------------------------------------------ | ------------------------------------- |
|
|
77
|
+
| `kafka-preferred-replica-election.sh` | Use `kafka-leader-election.sh` |
|
|
78
|
+
| `log.message.format.version` | Removed (always uses latest format) |
|
|
79
|
+
| ZooKeeper mode (new installs) | Use KRaft mode |
|
|
80
|
+
| `kafka-acls.sh --authorizer-properties` | Use `--bootstrap-server` |
|
|
81
|
+
| Legacy consumer (`kafka-console-consumer`) | Use `--bootstrap-server` (not `--zk`) |
|
|
82
|
+
|
|
83
|
+
### Deprecated Configurations to Remove
|
|
84
|
+
|
|
85
|
+
```properties
|
|
86
|
+
# ❌ REMOVE these from server.properties before upgrade
|
|
87
|
+
log.message.format.version=X.X
|
|
88
|
+
inter.broker.protocol.version=X.X (will be auto-managed)
|
|
89
|
+
zookeeper.connect=... (if migrating to KRaft)
|
|
90
|
+
|
|
91
|
+
# ✅ Add these for 8.x
|
|
92
|
+
# (controller-related settings if using KRaft)
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Configuration Changes
|
|
96
|
+
|
|
97
|
+
```properties
|
|
98
|
+
# 7.x configuration
|
|
99
|
+
log.message.format.version=3.6
|
|
100
|
+
inter.broker.protocol.version=3.6
|
|
101
|
+
zookeeper.connect=zk1:2181,zk2:2181,zk3:2181
|
|
102
|
+
|
|
103
|
+
# 8.x configuration (KRaft)
|
|
104
|
+
# REMOVE log.message.format.version
|
|
105
|
+
# REMOVE inter.broker.protocol.version
|
|
106
|
+
# REMOVE zookeeper.connect
|
|
107
|
+
|
|
108
|
+
# ADD KRaft settings
|
|
109
|
+
process.roles=broker
|
|
110
|
+
node.id=101
|
|
111
|
+
controller.quorum.voters=1@controller1:9093,2@controller2:9093,3@controller3:9093
|
|
112
|
+
controller.listener.names=CONTROLLER
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Pre-Upgrade Requirements
|
|
118
|
+
|
|
119
|
+
### 1. Environment Assessment
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
# Run pre-flight check script
|
|
123
|
+
python skills/confluent-kafka/scripts/upgrade_preflight.py \
|
|
124
|
+
--current-version 7.6 \
|
|
125
|
+
--target-version 8.0 \
|
|
126
|
+
--bootstrap-servers kafka-01:9092,kafka-02:9092,kafka-03:9092
|
|
127
|
+
|
|
128
|
+
# Manual checks
|
|
129
|
+
# Check current version
|
|
130
|
+
/opt/confluent/bin/kafka-broker-api-versions --bootstrap-server localhost:9092 --version
|
|
131
|
+
|
|
132
|
+
# Check inter.broker.protocol.version (must match across cluster)
|
|
133
|
+
grep inter.broker.protocol.version /opt/confluent/etc/kafka/server.properties
|
|
134
|
+
|
|
135
|
+
# Check for deprecated configs
|
|
136
|
+
grep -E "(log.message.format|zookeeper)" /opt/confluent/etc/kafka/server.properties
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### 2. Cluster Health Verification
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
# No under-replicated partitions
|
|
143
|
+
/opt/confluent/bin/kafka-topics --bootstrap-server localhost:9092 \
|
|
144
|
+
--describe --under-replicated-partitions
|
|
145
|
+
|
|
146
|
+
# No offline partitions
|
|
147
|
+
/opt/confluent/bin/kafka-topics --bootstrap-server localhost:9092 \
|
|
148
|
+
--describe --unavailable-partitions
|
|
149
|
+
|
|
150
|
+
# All brokers in ISR
|
|
151
|
+
/opt/confluent/bin/kafka-metadata --snapshot /var/kafka-logs/__cluster_metadata-0/00000000000000000000.log \
|
|
152
|
+
--command broker
|
|
153
|
+
|
|
154
|
+
# Controller status
|
|
155
|
+
# For ZK mode:
|
|
156
|
+
/opt/confluent/bin/zookeeper-shell localhost:2181 <<< "get /controller"
|
|
157
|
+
# For KRaft mode:
|
|
158
|
+
/opt/confluent/bin/kafka-metadata --snapshot /var/kafka-logs/__cluster_metadata-0/00000000000000000000.log \
|
|
159
|
+
--command quorum
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### 3. Backup Everything
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
# Create timestamped backup directory
|
|
166
|
+
BACKUP_DIR="/backup/confluent-upgrade-$(date +%Y%m%d-%H%M%S)"
|
|
167
|
+
mkdir -p $BACKUP_DIR
|
|
168
|
+
|
|
169
|
+
# Backup configurations
|
|
170
|
+
cp -r /opt/confluent/etc $BACKUP_DIR/etc
|
|
171
|
+
|
|
172
|
+
# Backup systemd units
|
|
173
|
+
cp /etc/systemd/system/confluent-* $BACKUP_DIR/
|
|
174
|
+
|
|
175
|
+
# Backup topic configurations
|
|
176
|
+
/opt/confluent/bin/kafka-configs --bootstrap-server localhost:9092 \
|
|
177
|
+
--entity-type topics --all --describe > $BACKUP_DIR/topic-configs.txt
|
|
178
|
+
|
|
179
|
+
# Backup ACLs
|
|
180
|
+
/opt/confluent/bin/kafka-acls --bootstrap-server localhost:9092 \
|
|
181
|
+
--list > $BACKUP_DIR/acls.txt
|
|
182
|
+
|
|
183
|
+
# If using ZK, backup ZooKeeper data
|
|
184
|
+
# (Only needed if not migrating to KRaft)
|
|
185
|
+
tar -czvf $BACKUP_DIR/zk-data.tar.gz /var/zookeeper/data
|
|
186
|
+
|
|
187
|
+
# Backup Schema Registry subjects
|
|
188
|
+
for subject in $(curl -s http://localhost:8081/subjects | jq -r '.[]'); do
|
|
189
|
+
curl -s http://localhost:8081/subjects/$subject/versions/latest > $BACKUP_DIR/schemas/$subject.json
|
|
190
|
+
done
|
|
191
|
+
|
|
192
|
+
# Create tarball of entire backup
|
|
193
|
+
tar -czvf $BACKUP_DIR.tar.gz $BACKUP_DIR
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### 4. Download New Version
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
# Download Confluent Platform 8.x tarball
|
|
200
|
+
CONFLUENT_VERSION=8.0.0
|
|
201
|
+
curl -LO https://packages.confluent.io/archive/8.0/confluent-$CONFLUENT_VERSION.tar.gz
|
|
202
|
+
|
|
203
|
+
# Verify checksum
|
|
204
|
+
sha256sum confluent-$CONFLUENT_VERSION.tar.gz
|
|
205
|
+
|
|
206
|
+
# Extract (don't overwrite yet)
|
|
207
|
+
tar -xzf confluent-$CONFLUENT_VERSION.tar.gz -C /opt/
|
|
208
|
+
# Creates /opt/confluent-$CONFLUENT_VERSION
|
|
209
|
+
|
|
210
|
+
# Distribute to all nodes
|
|
211
|
+
for host in kafka-01 kafka-02 kafka-03; do
|
|
212
|
+
scp confluent-$CONFLUENT_VERSION.tar.gz $host:/tmp/
|
|
213
|
+
done
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
## Upgrade Order
|
|
219
|
+
|
|
220
|
+
**Critical**: Follow this upgrade order to maintain cluster availability:
|
|
221
|
+
|
|
222
|
+
```
|
|
223
|
+
1. Schema Registry (all nodes)
|
|
224
|
+
↓
|
|
225
|
+
2. REST Proxy (all nodes)
|
|
226
|
+
↓
|
|
227
|
+
3. Kafka Connect (all workers)
|
|
228
|
+
↓
|
|
229
|
+
4. ksqlDB Server (all nodes)
|
|
230
|
+
↓
|
|
231
|
+
5. Control Center
|
|
232
|
+
↓
|
|
233
|
+
6. Kafka Brokers (rolling, one at a time)
|
|
234
|
+
↓
|
|
235
|
+
7. Controllers (rolling, if separate from brokers)
|
|
236
|
+
↓
|
|
237
|
+
8. ZooKeeper → KRaft Migration (if applicable)
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## Rolling Upgrade Procedure
|
|
243
|
+
|
|
244
|
+
### Step 1: Upgrade Schema Registry
|
|
245
|
+
|
|
246
|
+
```bash
|
|
247
|
+
# On each Schema Registry node (one at a time)
|
|
248
|
+
|
|
249
|
+
# 1. Stop service
|
|
250
|
+
sudo systemctl stop confluent-schema-registry
|
|
251
|
+
|
|
252
|
+
# 2. Backup current config
|
|
253
|
+
cp /opt/confluent/etc/schema-registry/schema-registry.properties /backup/
|
|
254
|
+
|
|
255
|
+
# 3. Update symlink to new version
|
|
256
|
+
sudo rm /opt/confluent
|
|
257
|
+
sudo ln -s /opt/confluent-8.0.0 /opt/confluent
|
|
258
|
+
|
|
259
|
+
# 4. Copy configuration to new version
|
|
260
|
+
cp /backup/schema-registry.properties /opt/confluent/etc/schema-registry/
|
|
261
|
+
|
|
262
|
+
# 5. Start service
|
|
263
|
+
sudo systemctl start confluent-schema-registry
|
|
264
|
+
|
|
265
|
+
# 6. Verify health
|
|
266
|
+
curl http://localhost:8081/ | jq
|
|
267
|
+
|
|
268
|
+
# Wait for healthy status before proceeding to next node
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
### Step 2: Upgrade Kafka Connect
|
|
272
|
+
|
|
273
|
+
```bash
|
|
274
|
+
# On each Connect worker (one at a time)
|
|
275
|
+
|
|
276
|
+
# 1. Pause all connectors (from any worker)
|
|
277
|
+
for connector in $(curl -s localhost:8083/connectors | jq -r '.[]'); do
|
|
278
|
+
curl -X PUT localhost:8083/connectors/$connector/pause
|
|
279
|
+
done
|
|
280
|
+
|
|
281
|
+
# 2. Stop Connect worker
|
|
282
|
+
sudo systemctl stop confluent-kafka-connect
|
|
283
|
+
|
|
284
|
+
# 3. Update symlink
|
|
285
|
+
sudo rm /opt/confluent
|
|
286
|
+
sudo ln -s /opt/confluent-8.0.0 /opt/confluent
|
|
287
|
+
|
|
288
|
+
# 4. Copy configuration
|
|
289
|
+
cp /backup/connect-distributed.properties /opt/confluent/etc/kafka/
|
|
290
|
+
|
|
291
|
+
# 5. Copy custom connectors
|
|
292
|
+
cp -r /backup/connectors /opt/confluent/share/java/
|
|
293
|
+
|
|
294
|
+
# 6. Start Connect worker
|
|
295
|
+
sudo systemctl start confluent-kafka-connect
|
|
296
|
+
|
|
297
|
+
# 7. Verify worker joined cluster
|
|
298
|
+
curl http://localhost:8083/ | jq
|
|
299
|
+
|
|
300
|
+
# After all workers upgraded, resume connectors
|
|
301
|
+
for connector in $(curl -s localhost:8083/connectors | jq -r '.[]'); do
|
|
302
|
+
curl -X PUT localhost:8083/connectors/$connector/resume
|
|
303
|
+
done
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
### Step 3: Upgrade Kafka Brokers (Rolling)
|
|
307
|
+
|
|
308
|
+
**CRITICAL**: Upgrade ONE broker at a time. Wait for ISR sync before proceeding.
|
|
309
|
+
|
|
310
|
+
```bash
|
|
311
|
+
# Pre-upgrade per broker
|
|
312
|
+
BROKER_ID=101
|
|
313
|
+
BROKER_HOST=kafka-01
|
|
314
|
+
|
|
315
|
+
# 1. Verify broker is not controller (for ZK mode)
|
|
316
|
+
/opt/confluent/bin/zookeeper-shell localhost:2181 <<< "get /controller" | grep -v $BROKER_ID
|
|
317
|
+
|
|
318
|
+
# 2. Controlled shutdown (gracefully migrate leadership)
|
|
319
|
+
sudo systemctl stop confluent-server
|
|
320
|
+
|
|
321
|
+
# 3. Wait for partitions to be reassigned
|
|
322
|
+
sleep 60
|
|
323
|
+
/opt/confluent/bin/kafka-topics --bootstrap-server kafka-02:9092 \
|
|
324
|
+
--describe --under-replicated-partitions
|
|
325
|
+
|
|
326
|
+
# 4. Update symlink
|
|
327
|
+
sudo rm /opt/confluent
|
|
328
|
+
sudo ln -s /opt/confluent-8.0.0 /opt/confluent
|
|
329
|
+
|
|
330
|
+
# 5. Merge configurations
|
|
331
|
+
# Copy old config
|
|
332
|
+
cp /backup/server.properties /opt/confluent/etc/kafka/
|
|
333
|
+
|
|
334
|
+
# Remove deprecated settings
|
|
335
|
+
sed -i '/log.message.format.version/d' /opt/confluent/etc/kafka/server.properties
|
|
336
|
+
sed -i '/inter.broker.protocol.version/d' /opt/confluent/etc/kafka/server.properties
|
|
337
|
+
|
|
338
|
+
# 6. Start broker
|
|
339
|
+
sudo systemctl start confluent-server
|
|
340
|
+
|
|
341
|
+
# 7. Verify broker joined cluster
|
|
342
|
+
/opt/confluent/bin/kafka-broker-api-versions --bootstrap-server localhost:9092
|
|
343
|
+
|
|
344
|
+
# 8. Wait for full ISR sync
|
|
345
|
+
watch "/opt/confluent/bin/kafka-topics --bootstrap-server localhost:9092 \
|
|
346
|
+
--describe --under-replicated-partitions | wc -l"
|
|
347
|
+
|
|
348
|
+
# Only proceed to next broker when under-replicated = 0
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
### Step 4: Upgrade Control Center
|
|
352
|
+
|
|
353
|
+
```bash
|
|
354
|
+
# Control Center can be upgraded last (non-critical)
|
|
355
|
+
|
|
356
|
+
sudo systemctl stop confluent-control-center
|
|
357
|
+
|
|
358
|
+
sudo rm /opt/confluent
|
|
359
|
+
sudo ln -s /opt/confluent-8.0.0 /opt/confluent
|
|
360
|
+
|
|
361
|
+
cp /backup/control-center.properties /opt/confluent/etc/confluent-control-center/
|
|
362
|
+
|
|
363
|
+
# Update any version-specific settings
|
|
364
|
+
# control.center.connect.cluster=... (verify endpoints)
|
|
365
|
+
|
|
366
|
+
sudo systemctl start confluent-control-center
|
|
367
|
+
|
|
368
|
+
# Verify UI is accessible
|
|
369
|
+
curl -I http://localhost:9021
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
---
|
|
373
|
+
|
|
374
|
+
## Post-Upgrade Validation
|
|
375
|
+
|
|
376
|
+
### 1. Verify All Components
|
|
377
|
+
|
|
378
|
+
```bash
|
|
379
|
+
# Check all service versions
|
|
380
|
+
for service in confluent-server confluent-schema-registry confluent-kafka-connect; do
|
|
381
|
+
echo "=== $service ==="
|
|
382
|
+
systemctl status $service | head -5
|
|
383
|
+
done
|
|
384
|
+
|
|
385
|
+
# Broker version
|
|
386
|
+
/opt/confluent/bin/kafka-broker-api-versions --bootstrap-server localhost:9092 --version
|
|
387
|
+
|
|
388
|
+
# Schema Registry version
|
|
389
|
+
curl -s http://localhost:8081/ | jq
|
|
390
|
+
|
|
391
|
+
# Connect version
|
|
392
|
+
curl -s http://localhost:8083/ | jq
|
|
393
|
+
|
|
394
|
+
# Control Center (check UI)
|
|
395
|
+
curl -I http://localhost:9021
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
### 2. Cluster Health Check
|
|
399
|
+
|
|
400
|
+
```bash
|
|
401
|
+
# Run comprehensive health check
|
|
402
|
+
python skills/confluent-kafka/scripts/kafka_health_check.py \
|
|
403
|
+
--bootstrap-servers kafka-01:9092,kafka-02:9092,kafka-03:9092 \
|
|
404
|
+
--output reports/kafka/post-upgrade/
|
|
405
|
+
|
|
406
|
+
# Verify no under-replicated partitions
|
|
407
|
+
/opt/confluent/bin/kafka-topics --bootstrap-server localhost:9092 \
|
|
408
|
+
--describe --under-replicated-partitions
|
|
409
|
+
|
|
410
|
+
# Verify all consumer groups are healthy
|
|
411
|
+
/opt/confluent/bin/kafka-consumer-groups --bootstrap-server localhost:9092 \
|
|
412
|
+
--all-groups --describe
|
|
413
|
+
|
|
414
|
+
# Verify connectors are running
|
|
415
|
+
curl -s http://localhost:8083/connectors | jq -r '.[]' | while read c; do
|
|
416
|
+
echo "$c: $(curl -s http://localhost:8083/connectors/$c/status | jq -r '.connector.state')"
|
|
417
|
+
done
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
### 3. Functional Testing
|
|
421
|
+
|
|
422
|
+
```bash
|
|
423
|
+
# Produce test message
|
|
424
|
+
echo "upgrade-test-$(date +%s)" | /opt/confluent/bin/kafka-console-producer \
|
|
425
|
+
--bootstrap-server localhost:9092 \
|
|
426
|
+
--topic upgrade-test
|
|
427
|
+
|
|
428
|
+
# Consume test message
|
|
429
|
+
/opt/confluent/bin/kafka-console-consumer \
|
|
430
|
+
--bootstrap-server localhost:9092 \
|
|
431
|
+
--topic upgrade-test \
|
|
432
|
+
--from-beginning \
|
|
433
|
+
--max-messages 1
|
|
434
|
+
|
|
435
|
+
# Test Schema Registry
|
|
436
|
+
curl -X POST -H "Content-Type: application/vnd.schemaregistry.v1+json" \
|
|
437
|
+
--data '{"schema": "{\"type\": \"string\"}"}' \
|
|
438
|
+
http://localhost:8081/subjects/upgrade-test-value/versions
|
|
439
|
+
```
|
|
440
|
+
|
|
441
|
+
---
|
|
442
|
+
|
|
443
|
+
## Rollback Procedure
|
|
444
|
+
|
|
445
|
+
If upgrade fails, rollback to previous version:
|
|
446
|
+
|
|
447
|
+
```bash
|
|
448
|
+
# 1. Stop the failed service
|
|
449
|
+
sudo systemctl stop confluent-server
|
|
450
|
+
|
|
451
|
+
# 2. Restore previous symlink
|
|
452
|
+
sudo rm /opt/confluent
|
|
453
|
+
sudo ln -s /opt/confluent-7.6.0 /opt/confluent
|
|
454
|
+
|
|
455
|
+
# 3. Restore configuration from backup
|
|
456
|
+
cp $BACKUP_DIR/etc/kafka/server.properties /opt/confluent/etc/kafka/
|
|
457
|
+
|
|
458
|
+
# 4. Start service
|
|
459
|
+
sudo systemctl start confluent-server
|
|
460
|
+
|
|
461
|
+
# 5. Verify cluster health
|
|
462
|
+
/opt/confluent/bin/kafka-broker-api-versions --bootstrap-server localhost:9092
|
|
463
|
+
/opt/confluent/bin/kafka-topics --bootstrap-server localhost:9092 \
|
|
464
|
+
--describe --under-replicated-partitions
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
### Rollback Considerations
|
|
468
|
+
|
|
469
|
+
- **Inter-broker protocol**: Brokers can communicate across one minor version difference
|
|
470
|
+
- **Log format**: 8.x log format is backward compatible with 7.x readers
|
|
471
|
+
- **Metadata**: KRaft metadata is NOT backward compatible if migration was started
|
|
472
|
+
- **Schema Registry**: Subject compatibility is maintained, no rollback needed
|
|
473
|
+
|
|
474
|
+
---
|
|
475
|
+
|
|
476
|
+
## Ansible Upgrade Playbook
|
|
477
|
+
|
|
478
|
+
For automated rolling upgrades, see [ansible_playbooks.md](ansible_playbooks.md) for the complete playbook.
|
|
479
|
+
|
|
480
|
+
Quick example:
|
|
481
|
+
|
|
482
|
+
```bash
|
|
483
|
+
# Run rolling upgrade
|
|
484
|
+
ansible-playbook -i inventory/confluent.ini playbooks/upgrade.yml \
|
|
485
|
+
-e confluent_target_version=8.0.0 \
|
|
486
|
+
-e rolling_restart=true \
|
|
487
|
+
--limit brokers
|
|
488
|
+
```
|