Kafka在CentOS上的安全配置主要包括以下方面:
server.properties中设置security.protocol为sasl_plaintext或sasl_ssl,指定security.inter.broker.protocol和sasl.mechanism(如PLAIN、SCRAM-SHA-256、Kerberos),并创建JAAS配置文件(如kafka_server_jaas.conf)加载认证模块。security.protocol=ssl,指定信任库(ssl.truststore.location)和密钥库(ssl.keystore.location)路径及密码,使用keytool工具管理证书。kafka-acls.sh工具设置用户/组对主题的访问权限,配置authorizer.class.name为SimpleAclAuthorizer。firewall-cmd开放Kafka端口(默认9092),建议将Kafka部署在VPC或专用子网中。/etc/passwd等关键文件权限。/etc/security/limits.conf限制进程数和文件描述符,防止资源滥用。参考来源: