opensource4you / astraea

釋放kafka的無限潛能
Apache License 2.0
129 stars 46 forks source link

[SCRIPT] Enable to restart kafka container #1799

Closed garyparrot closed 1 year ago

garyparrot commented 1 year ago

目前專案的 kafka container 的啟動指令是 sh -c "./bin/kafka-storage.sh format -t $CLUSTER_ID -c /tmp/controller.properties && ./bin/kafka-server-start.sh /tmp/controller.properties",這個啟動的指令會在 container restart 時再執行一次,而從第二次執行開始前面的 kafka-storage.sh 會因為已經格式化過而噴錯,進而導致後面的 kafka-server-start.sh 沒辦法執行,因此專案腳本的 container 沒辦法透過 docker stop, docker start 重開。

這個 PR 給格式化的腳本使用 --ignore-formatted,這個選項會忽略已經格式化過的 log dir,讓後面的 kafka-server-start.sh 可以順利執行。