kafka/confluent:producerconfig使用docker图像更改默认最大请求大小

xlpyo6sf  于 2021-06-07  发布在  Kafka
关注(0)|答案(1)|浏览(385)

我正在使用kafka/confluent(3.2.0)在mongodb示例上检索更改。
源进程由debezium source connector管理,他使用source connect api,并使用mesos(dc/os)扩展合流connect docker映像部署在我们的系统上。kafka本身使用框架版本部署在同一dc/os上。
由于我们收到了一些比默认大小大的消息,我更改了这些kafka安装参数:
•replica.fetch.max.字节
•message.max.字节
都是4mb。
然后我用这个启动连接器docker映像

docker run -d --rm --net=bridge --name=kafka-connect-mongodb -e CONNECT_BOOTSTRAP_SERVERS=${KAFKA_BOOTSTRAP_SERVERS} -e CONNECT_REST_PORT=${CONNECT_REST_PORT}  -e CONNECT_GROUP_ID="mongo-to-kafka-source-connector" -e CONNECT_CONFIG_STORAGE_TOPIC="${CONFIG.TOPIC}"  -e CONNECT_OFFSET_STORAGE_TOPIC="${OFFSETS.TOPIC}"   -e CONNECT_STATUS_STORAGE_TOPIC="${STATUS.TOPIC}"   -e CONNECT_KEY_CONVERTER="io.confluent.connect.avro.AvroConverter"   -e CONNECT_VALUE_CONVERTER="io.confluent.connect.avro.AvroConverter"   -e CONNECT_KEY_CONVERTER_SCHEMA_REGISTRY_URL="${SCHEMA_REGISTRY_LISTENERS}"   -e CONNECT_VALUE_CONVERTER_SCHEMA_REGISTRY_URL="${SCHEMA_REGISTRY_LISTENERS}"   -e CONNECT_INTERNAL_KEY_CONVERTER="org.apache.kafka.connect.json.JsonConverter"   -e CONNECT_INTERNAL_VALUE_CONVERTER="org.apache.kafka.connect.json.JsonConverter"   -e CONNECT_REST_ADVERTISED_HOST_NAME="${CONNECTOR_HOME}"   -e CONNECT_LOG4J_ROOT_LOGLEVEL=INFO  -e CONNECT_MAX_REQUEST_SIZE=4194304 -e KAFKA_MAX_REQUEST_SIZE=4194304  mongodb-source-connector:1.1

我更改了传递kafka\u max\u request\u size和connect\u max\u request\u size的默认max.request.size生产者值,日志被正确更改为4mb。
当我开始从mongodb提取时,问题就出现了。为了做到这一点,我运行这个职位

curl -X POST \  
http://hostname:8083/connectors \
  -d '{ 
  "name": "source_connector",  
  "config": {
    "tasks.max":"1",
    "connector.class": "io.debezium.connector.mongodb.MongoDbConnector", 
    "mongodb.hosts": "mongodbhost:27017", 
    "mongodb.name": "replica", 
    "collection.whitelist": "db[.]table",
    "max.request.size": "4194304"
  }
}'

但是日志上说

[2017-10-09 12:22:56,036] INFO ProducerConfig values: 
    acks = all
    batch.size = 16384
    block.on.buffer.full = false
    bootstrap.servers = [PLAINTEXT://172.17.0.3:9093]
    buffer.memory = 33554432
    client.id = 
    compression.type = none
    connections.max.idle.ms = 540000
    interceptor.classes = null
    key.serializer = class org.apache.kafka.common.serialization.ByteArraySerializer
    linger.ms = 0
    max.block.ms = 9223372036854775807
    max.in.flight.requests.per.connection = 1
    max.request.size = 1048576
    metadata.fetch.timeout.ms = 60000
    metadata.max.age.ms = 300000
    metric.reporters = []
    metrics.num.samples = 2
    metrics.sample.window.ms = 30000
    partitioner.class = class org.apache.kafka.clients.producer.internals.DefaultPartitioner
    receive.buffer.bytes = 32768
    reconnect.backoff.ms = 50
    request.timeout.ms = 2147483647
    retries = 2147483647
    retry.backoff.ms = 100
    sasl.jaas.config = null
    sasl.kerberos.kinit.cmd = /usr/bin/kinit
    sasl.kerberos.min.time.before.relogin = 60000
    sasl.kerberos.service.name = null
    sasl.kerberos.ticket.renew.jitter = 0.05
    sasl.kerberos.ticket.renew.window.factor = 0.8
    sasl.mechanism = GSSAPI
    security.protocol = PLAINTEXT
    send.buffer.bytes = 131072
    ssl.cipher.suites = null
    ssl.enabled.protocols = [TLSv1.2, TLSv1.1, TLSv1]
    ssl.endpoint.identification.algorithm = null
    ssl.key.password = null
    ssl.keymanager.algorithm = SunX509
    ssl.keystore.location = null
    ssl.keystore.password = null
    ssl.keystore.type = JKS
    ssl.protocol = TLS
    ssl.provider = null
    ssl.secure.random.implementation = null
    ssl.trustmanager.algorithm = PKIX
    ssl.truststore.location = null
    ssl.truststore.password = null
    ssl.truststore.type = JKS
    timeout.ms = 30000
    value.serializer = class org.apache.kafka.common.serialization.ByteArraySerializer

因此,在启动源进程时,将使用max.request.size的默认值。
这是完整的日志。
我不明白我错过了什么。

wz3gfoph

wz3gfoph1#

irc聊天帮助了我:在启动docker映像时,我必须指定kafka\u producer\u max\u request\u size和connect\u producer\u max\u request\u size。

相关问题