Error[8]: Undefined offset: 3, File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 121
File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 473, decode(

ambari-kafka 开启 sasl 认证 创建 kafka_server_jaas.conf、kafka_client_jaas.conf
vim /opt/kafka_server_jaas.conf
#其中kafka为admin用户,格式:user_用户名="密码"
KafkaServer {
org.apache.kafka.common.security.plain.PlainLoginModule required
   username="kafka"
   password="kafka-secret"
   user_kafka="kafka-secret"
   user_test="test-secret";
};


vim /opt/kafka_client_jaas.conf
KafkaClient {
        org.apache.kafka.common.security.plain.PlainLoginModule required
        username="kafka"
        password="kafka-secret";
};
页面修改配置
listeners  -->  SASL_PLAINTEXT://localhost:6667
sasl.enabled.mechanisms -->  PLAIN
sasl.mechanism.inter.broker.protocol --> PLAIN
security.inter.broker.protocol --> SASL_PLAINTEXT

添加配置
export KAFKA_OPTS="-Djava.security.auth.login.config=/opt/kafka_server_jaas.conf"

添加配置
super.users  -->  User:kafka

修改配置
**在 conf/consumer.properties、conf/producer.properties 添加以下两行**
security.protocol=SASL_PLAINTEXT
sasl.mechanism=PLAIN

需要在 kafka-console-consumer.sh、kafka-console-producer.sh
    添加
        -Djava.security.auth.login.config=/opt/kafka_client_jaas.conf
    修改后:
        exec $(dirname [+++])/kafka-run-class.sh -Djava.security.auth.login.config=/opt/kafka_client_jaas.conf kafka.tools.ConsoleProducer "$@"

消费:
    bin/kafka-console-consumer.sh --bootstrap-server ambari1:6667 --topic topic01 --from-beginning --consumer.config conf/consumer.properties --group test-consumer-group
生产:
    bin/kafka-console-producer.sh --broker-list ambari1:6667 --topic topic01 --producer.config conf/producer.properties

)
File: /www/wwwroot/outofmemory.cn/tmp/route_read.php, Line: 126, InsideLink()
File: /www/wwwroot/outofmemory.cn/tmp/index.inc.php, Line: 165, include(/www/wwwroot/outofmemory.cn/tmp/route_read.php)
File: /www/wwwroot/outofmemory.cn/index.php, Line: 30, include(/www/wwwroot/outofmemory.cn/tmp/index.inc.php)
ambari-kafka 开启 sasl 认证_随笔_内存溢出

ambari-kafka 开启 sasl 认证

ambari-kafka 开启 sasl 认证,第1张

ambari-kafka 开启 sasl 认证 创建 kafka_server_jaas.conf、kafka_client_jaas.conf
vim /opt/kafka_server_jaas.conf
#其中kafka为admin用户,格式:user_用户名="密码"
KafkaServer {
org.apache.kafka.common.security.plain.PlainLoginModule required
   username="kafka"
   password="kafka-secret"
   user_kafka="kafka-secret"
   user_test="test-secret";
};


vim /opt/kafka_client_jaas.conf
KafkaClient {
        org.apache.kafka.common.security.plain.PlainLoginModule required
        username="kafka"
        password="kafka-secret";
};
页面修改配置
listeners  -->  SASL_PLAINTEXT://localhost:6667
sasl.enabled.mechanisms -->  PLAIN
sasl.mechanism.inter.broker.protocol --> PLAIN
security.inter.broker.protocol --> SASL_PLAINTEXT

添加配置
export KAFKA_OPTS="-Djava.security.auth.login.config=/opt/kafka_server_jaas.conf"

添加配置
super.users  -->  User:kafka

修改配置
**在 conf/consumer.properties、conf/producer.properties 添加以下两行**
security.protocol=SASL_PLAINTEXT
sasl.mechanism=PLAIN

需要在 kafka-console-consumer.sh、kafka-console-producer.sh
    添加
        -Djava.security.auth.login.config=/opt/kafka_client_jaas.conf
    修改后:
        exec $(dirname )/kafka-run-class.sh -Djava.security.auth.login.config=/opt/kafka_client_jaas.conf kafka.tools.ConsoleProducer "$@"

消费:
    bin/kafka-console-consumer.sh --bootstrap-server ambari1:6667 --topic topic01 --from-beginning --consumer.config conf/consumer.properties --group test-consumer-group
生产:
    bin/kafka-console-producer.sh --broker-list ambari1:6667 --topic topic01 --producer.config conf/producer.properties

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5683224.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存