#自定义一些启动配置#!/bin/bash、/etc/profileexport JMX_PORT=xxxxexport KAFKA_HEAP_OPTS="-Xmx6g -Xms6g -XX:metaspaceSize=96m -XX:+UseG1GC -XX:MaxGCPauseMillis=20 -XX:InitiatingHeapOccupancyPercent=35 -XX:G1HeapRegionSize=16M -XX:MinmetaspaceFreeRatio=50 -XX:MaxmetaspaceFreeRatio=80"bindir=$(cd $(dirname $0); pwd)cd $bindirnohup $bindir/bin/kafka-server-start.sh $bindir/config/server.properties > /dev/null 2>&1 bin/kafka-server-start.sh启动脚本修改exec $base_dir/kafka-run-class.sh $EXTRA_ARGS -Djava.security.auth.login.config=$base_dir/../config/kafka-server-jaas.conf kafka.Kafka "$@"#broker安全认证配置 kafka-server-jaas.conf KafkaServer {org.apache.kafka.common.security.scram.ScramLoginModule requiredusername="xxx"password="xxx";};# 客户端安全认证配置 ../config/kafka-client-jaas.conf KafkaClient {org.apache.kafka.common.security.scram.ScramLoginModule requiredusername="xxx"password="xxx";};#副本迁移命令kafka-reassign-partitions-acl.sh添加安全认证配置echo $base_direxec $(dirname $0)/kafka-run-class.sh -Djava.security.auth.login.config=/opt/bigdata/app/kafka/config/kafka-client-jaas.conf kafka.admin.ReassignPartitionsCommand "$@"