标签:密码 后台运行 ssl protoc together generated dom cli 就是
说明: #这里的用户和密码从阿里云控制台获取
KafkaClient {
org.apache.kafka.common.security.plain.PlainLoginModule required
username="xxxxxx"
password="xxxxxx";
};
2、consumer.properties
# list of brokers used for bootstrapping knowledge about the rest of the cluster
#format: host1:port1,host2:port2 ...
bootstrap.servers=自建集群ip:9092
#consumer group id
group.id=test-consumer-group
#消费者分区分配策略
partition.assignment.strategy=org.apache.kafka.clients.consumer.RoundRobinAssignor
#What to do when there is no initial offset in Kafka or if the current
#offset does not exist any more on the server: latest, earliest, none
#auto.offset.reset=
3、producer.properties
############################# Producer Basics #############################
# list of brokers used for bootstrapping knowledge about the rest of the cluster
# format: host1:port1,host2:port2 ...
bootstrap.servers=阿里云集群ip:9093
# specify the compression codec for all data generated: none, gzip, snappy, lz4, zstd
compression.type=none
# name of the partitioner class for partitioning events; default partition spreads data randomly
#partitioner.class=
# the maximum amount of time the client will wait for the response of a request
#request.timeout.ms=
# how long `KafkaProducer.send` and `KafkaProducer.partitionsFor` will block for
#max.block.ms=
# the producer will wait for up to the given delay to allow other records to be sent so that the sends can be batched together
#linger.ms=
# the maximum size of a request in bytes
#max.request.size=
# the default batch size in bytes when batching multiple records sent to a partition
#batch.size=
# the total bytes of memory the producer can use to buffer records waiting to be sent to the server
#buffer.memory=
ssl.truststore.location=/application/kafka/cert/kafka.client.truststore.jks
ssl.truststore.password=KafkaOnsClient
security.protocol=SASL_SSL
sasl.mechanism=PLAIN
ssl.endpoint.identification.algorithm=
#最后这一行是kafka的版本高于2.x.x才需要
Kafka自建集群通过MirrorMaker同步数据到阿里云kafka标准版实操
标签:密码 后台运行 ssl protoc together generated dom cli 就是
原文地址:https://blog.51cto.com/19840202/2443515