FrankYang0529 commented on PR #17836:
URL: https://github.com/apache/kafka/pull/17836#issuecomment-2490629999
Hi @ahuang98, I updated PR description and following is manually test
results:
1. Setup three controller properties.
```
# path: ./config/kraft/controller1.properties
process.roles=controller
node.id=1
controller.quorum.bootstrap.servers=localhost:9093
listeners=CONTROLLER://:9093
advertised.listeners=CONTROLLER://localhost:9093
controller.listener.names=CONTROLLER
log.dirs=/tmp/kraft-controller-logs-1
```
```
# path: ./config/kraft/controller2.properties
process.roles=controller
node.id=2
controller.quorum.bootstrap.servers=localhost:9093
listeners=CONTROLLER://:9094
advertised.listeners=CONTROLLER://localhost:9094
controller.listener.names=CONTROLLER
log.dirs=/tmp/kraft-controller-logs-2
```
```
# path: ./config/kraft/controller3.properties
process.roles=controller
node.id=3
controller.quorum.bootstrap.servers=localhost:9093
listeners=CONTROLLER://:9095
advertised.listeners=CONTROLLER://localhost:9095
controller.listener.names=CONTROLLER
log.dirs=/tmp/kraft-controller-logs-3
```
2. Format node 1 as first standalone controller and start it.
```
> ./bin/kafka-storage.sh format -t "zuV6tFqAQhSGfFe97O-9cw" --config
./config/kraft/controller1.properties --standalone
Formatting dynamic metadata voter directory /tmp/kraft-controller-logs-1
with metadata.version 4.0-IV0.
> ./bin/kafka-server-start.sh ./config/kraft/controller1.properties
```
3. Format node 2 with no initial controller and start it.
```
> ./bin/kafka-storage.sh format -t "zuV6tFqAQhSGfFe97O-9cw" --config
./config/kraft/controller2.properties --no-initial-controllers --feature
kraft.version=1
Formatting metadata directory /tmp/kraft-controller-logs-2 with
metadata.version 4.0-IV0.
> ./bin/kafka-server-start.sh ./config/kraft/controller2.properties
```
4. Format node 3 with no initial controller and start it.
```
> ./bin/kafka-storage.sh format -t "zuV6tFqAQhSGfFe97O-9cw" --config
./config/kraft/controller3.properties --no-initial-controllers --feature
kraft.version=1
Formatting metadata directory /tmp/kraft-controller-logs-3 with
metadata.version 4.0-IV0.
> ./bin/kafka-server-start.sh ./config/kraft/controller3.properties
```
5. Check cluster status is 1 controller with 2 observers.
```
> ./bin/kafka-metadata-quorum.sh --bootstrap-controller localhost:9093
describe --status
ClusterId: zuV6tFqAQhSGfFe97O-9cw
LeaderId: 1
LeaderEpoch: 1
HighWatermark: 817
MaxFollowerLag: 0
MaxFollowerLagTimeMs: 0
CurrentVoters: [{"id": 1, "directoryId": "zD1nHI9OSyCGu29l3db2yg",
"endpoints": ["CONTROLLER://localhost:9093"]}]
CurrentObservers: [{"id": 2, "directoryId": "vX3tLI_VJKRLAMqJdFUY4Q"},
{"id": 3, "directoryId": "Mk1bbuDgirHiGzOnH4okew"}]
```
6. Add node 2 as controller and check cluster status is 2 controllers and 1
observer.
```
> ./bin/kafka-metadata-quorum.sh --bootstrap-controller localhost:9093
--command-config ./config/kraft/controller2.properties add-controller
Added controller 2 with directory id vX3tLI_VJKRLAMqJdFUY4Q and endpoints:
CONTROLLER://localhost:9094
> ./bin/kafka-metadata-quorum.sh --bootstrap-controller localhost:9093
describe --status
ClusterId: zuV6tFqAQhSGfFe97O-9cw
LeaderId: 1
LeaderEpoch: 1
HighWatermark: 960
MaxFollowerLag: 0
MaxFollowerLagTimeMs: 0
CurrentVoters: [{"id": 1, "directoryId": "zD1nHI9OSyCGu29l3db2yg",
"endpoints": ["CONTROLLER://localhost:9093"]}, {"id": 2, "directoryId":
"vX3tLI_VJKRLAMqJdFUY4Q", "endpoints": ["CONTROLLER://localhost:9094"]}]
CurrentObservers: [{"id": 3, "directoryId": "Mk1bbuDgirHiGzOnH4okew"}]
```
7. Add node 3 as controller and check cluster status is 3 controllers and 0
observer.
```
> ./bin/kafka-metadata-quorum.sh --bootstrap-controller localhost:9093
--command-config ./config/kraft/controller3.properties add-controller
Added controller 3 with directory id Mk1bbuDgirHiGzOnH4okew and endpoints:
CONTROLLER://localhost:9095
> ./bin/kafka-metadata-quorum.sh --bootstrap-controller localhost:9093
describe --status
ClusterId: zuV6tFqAQhSGfFe97O-9cw
LeaderId: 1
LeaderEpoch: 1
HighWatermark: 1123
MaxFollowerLag: 0
MaxFollowerLagTimeMs: 0
CurrentVoters: [{"id": 1, "directoryId": "zD1nHI9OSyCGu29l3db2yg",
"endpoints": ["CONTROLLER://localhost:9093"]}, {"id": 2, "directoryId":
"vX3tLI_VJKRLAMqJdFUY4Q", "endpoints": ["CONTROLLER://localhost:9094"]}, {"id":
3, "directoryId": "Mk1bbuDgirHiGzOnH4okew", "endpoints":
["CONTROLLER://localhost:9095"]}]
CurrentObservers: []
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]