No Kafka server to stop error handling of Kafka

Use the command to close the Kafka service. If it is found that it cannot be deleted, an error is reported, as shown in the following figure



Modify Kafka server

PIDS=$(ps ax | grep -i 'kafka\.Kafka' | grep java | grep -v grep | awk '{print $1}')

Change to

PIDS=$(jps -lm | grep -i 'kafka.Kafka'| awk '{print $1}')

command details: use the JPS – LM command to list all Java processes, then screen out the Kafka process through the pipeline by using the grep – I ‘Kafka. Kafka’ command, and finally take out the process number by using awk


The specific modification is shown in the figure below





Similar Posts: