Closed garyparrot closed 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 重開。
sh -c "./bin/kafka-storage.sh format -t $CLUSTER_ID -c /tmp/controller.properties && ./bin/kafka-server-start.sh /tmp/controller.properties"
kafka-storage.sh
kafka-server-start.sh
docker stop
docker start
這個 PR 給格式化的腳本使用 --ignore-formatted,這個選項會忽略已經格式化過的 log dir,讓後面的 kafka-server-start.sh 可以順利執行。
--ignore-formatted
目前專案的 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
可以順利執行。