当前位置:首页 > 服务端 > Kafka单节点及集群配置安装

Kafka单节点及集群配置安装

2022年09月17日 11:27:57服务端8

一.单节点

  1.上传Kafka安装包到Linux系统【当前为Centos7】。

  2.解压,配置conf/server.property。

    2.1配置broker.id

      Kafka单节点及集群配置安装 _ JavaClub全栈架构师技术笔记

    2.2配置log.dirs

      Kafka单节点及集群配置安装 _ JavaClub全栈架构师技术笔记

    2.3配置zookeeper.connect

      Kafka单节点及集群配置安装 _ JavaClub全栈架构师技术笔记

  3.启动Zookeeper集群

    Kafka单节点及集群配置安装 _ JavaClub全栈架构师技术笔记

    Kafka单节点及集群配置安装 _ JavaClub全栈架构师技术笔记

    Kafka单节点及集群配置安装 _ JavaClub全栈架构师技术笔记

    备注:zookeeper集群启动时,先启动的节点因节点启动过少而出现not running这种情况,是正常的,把所有节点都启动之后这个情况就会消失!

  3.启动Kafka服务

    执行:./kafka-server-start.sh ../config/server.properties &

    启动日志:   

Kafka单节点及集群配置安装 _ JavaClub全栈架构师技术笔记
[root@master bin]# ./kafka-server-start.sh ../config/server.properties &
[1] 2190
[root@master bin]# [2019-04-07 10:47:29,730] INFO Registered kafka:type=kafka.Log4jController MBean (kafka.utils.Log4jControllerRegistration$)
[2019-04-07 10:47:32,457] INFO starting (kafka.server.KafkaServer)
[2019-04-07 10:47:32,464] INFO Connecting to zookeeper on master:2181 (kafka.server.KafkaServer)
[2019-04-07 10:47:32,571] INFO [ZooKeeperClient] Initializing a new session to master:2181. (kafka.zookeeper.ZooKeeperClient)
[2019-04-07 10:47:32,603] INFO Client environment:zookeeper.version=3.4.13-2d71af4dbe22557fda74f9a9b4309b15a7487f03, built on 06/29/2018 00:39 GMT (org.apache.zookeeper.ZooKeeper)
[2019-04-07 10:47:32,603] INFO Client environment:host.name=master (org.apache.zookeeper.ZooKeeper)
[2019-04-07 10:47:32,603] INFO Client environment:java.version=1.8.0_172 (org.apache.zookeeper.ZooKeeper)
[2019-04-07 10:47:32,604] INFO Client environment:java.vendor=Oracle Corporation (org.apache.zookeeper.ZooKeeper)
[2019-04-07 10:47:32,604] INFO Client environment:java.home=/usr/local/soft/jdk1.8.0_172/jre (org.apache.zookeeper.ZooKeeper)
[2019-04-07 10:47:32,604] INFO Client environment:java.class.path=.:/usr/local/soft/jdk1.8.0_172/jre/lib/rt.jar:/usr/local/soft/jdk1.8.0_172/lib/dt.jar:/usr/local/soft/jdk1.8.0_172/lib/tools.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/activation-1.1.1.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/aopalliance-repackaged-2.5.0-b42.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/argparse4j-0.7.0.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/audience-annotations-0.5.0.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/commons-lang3-3.8.1.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/connect-api-2.1.1.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/connect-basic-auth-extension-2.1.1.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/connect-file-2.1.1.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/connect-json-2.1.1.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/connect-runtime-2.1.1.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/connect-transforms-2.1.1.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/guava-20.0.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/hk2-api-2.5.0-b42.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/hk2-locator-2.5.0-b42.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/hk2-utils-2.5.0-b42.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/jackson-annotations-2.9.8.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/jackson-core-2.9.8.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/jackson-databind-2.9.8.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/jackson-jaxrs-base-2.9.8.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/jackson-jaxrs-json-provider-2.9.8.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/jackson-module-jaxb-annotations-2.9.8.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/javassist-3.22.0-CR2.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/javax.annotation-api-1.2.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/javax.inject-1.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/javax.inject-2.5.0-b42.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/javax.servlet-api-3.1.0.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/javax.ws.rs-api-2.1.1.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/javax.ws.rs-api-2.1.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/jaxb-api-2.3.0.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/jersey-client-2.27.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/jersey-common-2.27.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/jersey-container-servlet-2.27.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/jersey-container-servlet-core-2.27.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/jersey-hk2-2.27.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/jersey-media-jaxb-2.27.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/jersey-server-2.27.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/jetty-client-9.4.12.v20180830.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/jetty-continuation-9.4.12.v20180830.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/jetty-http-9.4.12.v20180830.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/jetty-io-9.4.12.v20180830.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/jetty-security-9.4.12.v20180830.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/jetty-server-9.4.12.v20180830.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/jetty-servlet-9.4.12.v20180830.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/jetty-servlets-9.4.12.v20180830.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/jetty-util-9.4.12.v20180830.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/jopt-simple-5.0.4.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/kafka_2.11-2.1.1.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/kafka_2.11-2.1.1-sources.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/kafka-clients-2.1.1.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/kafka-log4j-appender-2.1.1.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/kafka-streams-2.1.1.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/kafka-streams-examples-2.1.1.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/kafka-streams-scala_2.11-2.1.1.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/kafka-streams-test-utils-2.1.1.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/kafka-tools-2.1.1.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/log4j-1.2.17.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/lz4-java-1.5.0.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/maven-artifact-3.6.0.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/metrics-core-2.2.0.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/osgi-resource-locator-1.0.1.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/plexus-utils-3.1.0.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/reflections-0.9.11.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/rocksdbjni-5.14.2.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/scala-library-2.11.12.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/scala-logging_2.11-3.9.0.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/scala-reflect-2.11.12.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/slf4j-api-1.7.25.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/slf4j-log4j12-1.7.25.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/snappy-java-1.1.7.2.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/validation-api-1.1.0.Final.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/zkclient-0.11.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/zookeeper-3.4.13.jar:/usr/local/soft/kafka_2.11-2.1.1/bin/../libs/zstd-jni-1.3.7-1.jar (org.apache.zookeeper.ZooKeeper)
[2019-04-07 10:47:32,605] INFO Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib (org.apache.zookeeper.ZooKeeper)
[2019-04-07 10:47:32,606] INFO Client environment:java.io.tmpdir=/tmp (org.apache.zookeeper.ZooKeeper)
[2019-04-07 10:47:32,606] INFO Client environment:java.compiler=<NA> (org.apache.zookeeper.ZooKeeper)
[2019-04-07 10:47:32,606] INFO Client environment:os.name=Linux (org.apache.zookeeper.ZooKeeper)
[2019-04-07 10:47:32,606] INFO Client environment:os.arch=amd64 (org.apache.zookeeper.ZooKeeper)
[2019-04-07 10:47:32,607] INFO Client environment:os.version=3.10.0-693.el7.x86_64 (org.apache.zookeeper.ZooKeeper)
[2019-04-07 10:47:32,607] INFO Client environment:user.name=root (org.apache.zookeeper.ZooKeeper)
[2019-04-07 10:47:32,607] INFO Client environment:user.home=/root (org.apache.zookeeper.ZooKeeper)
[2019-04-07 10:47:32,607] INFO Client environment:user.dir=/usr/local/soft/kafka_2.11-2.1.1/bin (org.apache.zookeeper.ZooKeeper)
[2019-04-07 10:47:32,630] INFO Initiating client connection, connectString=master:2181 sessionTimeout=6000 watcher=kafka.zookeeper.ZooKeeperClient$ZooKeeperClientWatcher$@351d00c0 (org.apache.zookeeper.ZooKeeper)
[2019-04-07 10:47:32,712] INFO Opening socket connection to server master/192.168.245.136:2181. Will not attempt to authenticate using SASL (unknown error) (org.apache.zookeeper.ClientCnxn)
[2019-04-07 10:47:32,720] INFO [ZooKeeperClient] Waiting until connected. (kafka.zookeeper.ZooKeeperClient)
[2019-04-07 10:47:32,775] INFO Socket connection established to master/192.168.245.136:2181, initiating session (org.apache.zookeeper.ClientCnxn)
[2019-04-07 10:47:32,885] INFO Session establishment complete on server master/192.168.245.136:2181, sessionid = 0x1000023437d0000, negotiated timeout = 6000 (org.apache.zookeeper.ClientCnxn)
[2019-04-07 10:47:32,911] INFO [ZooKeeperClient] Connected. (kafka.zookeeper.ZooKeeperClient)
[2019-04-07 10:47:35,633] INFO Cluster ID = 1AkrnNRhRiW9PWHA77R9lA (kafka.server.KafkaServer)
[2019-04-07 10:47:35,648] WARN No meta.properties file under dir /usr/local/soft/kafka_2.11-2.1.1/logs/meta.properties (kafka.server.BrokerMetadataCheckpoint)
[2019-04-07 10:47:36,138] INFO KafkaConfig values: 
    advertised.host.name = null
    advertised.listeners = null
    advertised.port = null
    alter.config.policy.class.name = null
    alter.log.dirs.replication.quota.window.num = 11
    alter.log.dirs.replication.quota.window.size.seconds = 1
    authorizer.class.name = 
    auto.create.topics.enable = true
    auto.leader.rebalance.enable = true
    background.threads = 10
    broker.id = 0
    broker.id.generation.enable = true
    broker.rack = null
    client.quota.callback.class = null
    compression.type = producer
    connection.failed.authentication.delay.ms = 100
    connections.max.idle.ms = 600000
    controlled.shutdown.enable = true
    controlled.shutdown.max.retries = 3
    controlled.shutdown.retry.backoff.ms = 5000
    controller.socket.timeout.ms = 30000
    create.topic.policy.class.name = null
    default.replication.factor = 1
    delegation.token.expiry.check.interval.ms = 3600000
    delegation.token.expiry.time.ms = 86400000
    delegation.token.master.key = null
    delegation.token.max.lifetime.ms = 604800000
    delete.records.purgatory.purge.interval.requests = 1
    delete.topic.enable = true
    fetch.purgatory.purge.interval.requests = 1000
    group.initial.rebalance.delay.ms = 0
    group.max.session.timeout.ms = 300000
    group.min.session.timeout.ms = 6000
    host.name = 
    inter.broker.listener.name = null
    inter.broker.protocol.version = 2.1-IV2
    kafka.metrics.polling.interval.secs = 10
    kafka.metrics.reporters = []
    leader.imbalance.check.interval.seconds = 300
    leader.imbalance.per.broker.percentage = 10
    listener.security.protocol.map = PLAINTEXT:PLAINTEXT,SSL:SSL,SASL_PLAINTEXT:SASL_PLAINTEXT,SASL_SSL:SASL_SSL
    listeners = null
    log.cleaner.backoff.ms = 15000
    log.cleaner.dedupe.buffer.size = 134217728
    log.cleaner.delete.retention.ms = 86400000
    log.cleaner.enable = true
    log.cleaner.io.buffer.load.factor = 0.9
    log.cleaner.io.buffer.size = 524288
    log.cleaner.io.max.bytes.per.second = 1.7976931348623157E308
    log.cleaner.min.cleanable.ratio = 0.5
    log.cleaner.min.compaction.lag.ms = 0
    log.cleaner.threads = 1
    log.cleanup.policy = [delete]
    log.dir = /tmp/kafka-logs
    log.dirs = /usr/local/soft/kafka_2.11-2.1.1/logs
    log.flush.interval.messages = 9223372036854775807
    log.flush.interval.ms = null
    log.flush.offset.checkpoint.interval.ms = 60000
    log.flush.scheduler.interval.ms = 9223372036854775807
    log.flush.start.offset.checkpoint.interval.ms = 60000
    log.index.interval.bytes = 4096
    log.index.size.max.bytes = 10485760
    log.message.downconversion.enable = true
    log.message.format.version = 2.1-IV2
    log.message.timestamp.difference.max.ms = 9223372036854775807
    log.message.timestamp.type = CreateTime
    log.preallocate = false
    log.retention.bytes = -1
    log.retention.check.interval.ms = 300000
    log.retention.hours = 168
    log.retention.minutes = null
    log.retention.ms = null
    log.roll.hours = 168
    log.roll.jitter.hours = 0
    log.roll.jitter.ms = null
    log.roll.ms = null
    log.segment.bytes = 1073741824
    log.segment.delete.delay.ms = 60000
    max.connections.per.ip = 2147483647
    max.connections.per.ip.overrides = 
    max.incremental.fetch.session.cache.slots = 1000
    message.max.bytes = 1000012
    metric.reporters = []
    metrics.num.samples = 2
    metrics.recording.level = INFO
    metrics.sample.window.ms = 30000
    min.insync.replicas = 1
    num.io.threads = 8
    num.network.threads = 3
    num.partitions = 1
    num.recovery.threads.per.data.dir = 1
    num.replica.alter.log.dirs.threads = null
    num.replica.fetchers = 1
    offset.metadata.max.bytes = 4096
    offsets.commit.required.acks = -1
    offsets.commit.timeout.ms = 5000
    offsets.load.buffer.size = 5242880
    offsets.retention.check.interval.ms = 600000
    offsets.retention.minutes = 10080
    offsets.topic.compression.codec = 0
    offsets.topic.num.partitions = 50
    offsets.topic.replication.factor = 1
    offsets.topic.segment.bytes = 104857600
    password.encoder.cipher.algorithm = AES/CBC/PKCS5Padding
    password.encoder.iterations = 4096
    password.encoder.key.length = 128
    password.encoder.keyfactory.algorithm = null
    password.encoder.old.secret = null
    password.encoder.secret = null
    port = 9092
    principal.builder.class = null
    producer.purgatory.purge.interval.requests = 1000
    queued.max.request.bytes = -1
    queued.max.requests = 500
    quota.consumer.default = 9223372036854775807
    quota.producer.default = 9223372036854775807
    quota.window.num = 11
    quota.window.size.seconds = 1
    replica.fetch.backoff.ms = 1000
    replica.fetch.max.bytes = 1048576
    replica.fetch.min.bytes = 1
    replica.fetch.response.max.bytes = 10485760
    replica.fetch.wait.max.ms = 500
    replica.high.watermark.checkpoint.interval.ms = 5000
    replica.lag.time.max.ms = 10000
    replica.socket.receive.buffer.bytes = 65536
    replica.socket.timeout.ms = 30000
    replication.quota.window.num = 11
    replication.quota.window.size.seconds = 1
    request.timeout.ms = 30000
    reserved.broker.max.id = 1000
    sasl.client.callback.handler.class = null
    sasl.enabled.mechanisms = [GSSAPI]
    sasl.jaas.config = null
    sasl.kerberos.kinit.cmd = /usr/bin/kinit
    sasl.kerberos.min.time.before.relogin = 60000
    sasl.kerberos.principal.to.local.rules = [DEFAULT]
    sasl.kerberos.service.name = null
    sasl.kerberos.ticket.renew.jitter = 0.05
    sasl.kerberos.ticket.renew.window.factor = 0.8
    sasl.login.callback.handler.class = null
    sasl.login.class = null
    sasl.login.refresh.buffer.seconds = 300
    sasl.login.refresh.min.period.seconds = 60
    sasl.login.refresh.window.factor = 0.8
    sasl.login.refresh.window.jitter = 0.05
    sasl.mechanism.inter.broker.protocol = GSSAPI
    sasl.server.callback.handler.class = null
    security.inter.broker.protocol = PLAINTEXT
    socket.receive.buffer.bytes = 102400
    socket.request.max.bytes = 104857600
    socket.send.buffer.bytes = 102400
    ssl.cipher.suites = []
    ssl.client.auth = none
    ssl.enabled.protocols = [TLSv1.2, TLSv1.1, TLSv1]
    ssl.endpoint.identification.algorithm = https
    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
    transaction.abort.timed.out.transaction.cleanup.interval.ms = 60000
    transaction.max.timeout.ms = 900000
    transaction.remove.expired.transaction.cleanup.interval.ms = 3600000
    transaction.state.log.load.buffer.size = 5242880
    transaction.state.log.min.isr = 1
    transaction.state.log.num.partitions = 50
    transaction.state.log.replication.factor = 1
    transaction.state.log.segment.bytes = 104857600
    transactional.id.expiration.ms = 604800000
    unclean.leader.election.enable = false
    zookeeper.connect = master:2181
    zookeeper.connection.timeout.ms = 6000
    zookeeper.max.in.flight.requests = 10
    zookeeper.session.timeout.ms = 6000
    zookeeper.set.acl = false
    zookeeper.sync.time.ms = 2000
 (kafka.server.KafkaConfig)
[2019-04-07 10:47:36,198] INFO KafkaConfig values: 
    advertised.host.name = null
    advertised.listeners = null
    advertised.port = null
    alter.config.policy.class.name = null
    alter.log.dirs.replication.quota.window.num = 11
    alter.log.dirs.replication.quota.window.size.seconds = 1
    authorizer.class.name = 
    auto.create.topics.enable = true
    auto.leader.rebalance.enable = true
    background.threads = 10
    broker.id = 0
    broker.id.generation.enable = true
    broker.rack = null
    client.quota.callback.class = null
    compression.type = producer
    connection.failed.authentication.delay.ms = 100
    connections.max.idle.ms = 600000
    controlled.shutdown.enable = true
    controlled.shutdown.max.retries = 3
    controlled.shutdown.retry.backoff.ms = 5000
    controller.socket.timeout.ms = 30000
    create.topic.policy.class.name = null
    default.replication.factor = 1
    delegation.token.expiry.check.interval.ms = 3600000
    delegation.token.expiry.time.ms = 86400000
    delegation.token.master.key = null
    delegation.token.max.lifetime.ms = 604800000
    delete.records.purgatory.purge.interval.requests = 1
    delete.topic.enable = true
    fetch.purgatory.purge.interval.requests = 1000
    group.initial.rebalance.delay.ms = 0
    group.max.session.timeout.ms = 300000
    group.min.session.timeout.ms = 6000
    host.name = 
    inter.broker.listener.name = null
    inter.broker.protocol.version = 2.1-IV2
    kafka.metrics.polling.interval.secs = 10
    kafka.metrics.reporters = []
    leader.imbalance.check.interval.seconds = 300
    leader.imbalance.per.broker.percentage = 10
    listener.security.protocol.map = PLAINTEXT:PLAINTEXT,SSL:SSL,SASL_PLAINTEXT:SASL_PLAINTEXT,SASL_SSL:SASL_SSL
    listeners = null
    log.cleaner.backoff.ms = 15000
    log.cleaner.dedupe.buffer.size = 134217728
    log.cleaner.delete.retention.ms = 86400000
    log.cleaner.enable = true
    log.cleaner.io.buffer.load.factor = 0.9
    log.cleaner.io.buffer.size = 524288
    log.cleaner.io.max.bytes.per.second = 1.7976931348623157E308
    log.cleaner.min.cleanable.ratio = 0.5
    log.cleaner.min.compaction.lag.ms = 0
    log.cleaner.threads = 1
    log.cleanup.policy = [delete]
    log.dir = /tmp/kafka-logs
    log.dirs = /usr/local/soft/kafka_2.11-2.1.1/logs
    log.flush.interval.messages = 9223372036854775807
    log.flush.interval.ms = null
    log.flush.offset.checkpoint.interval.ms = 60000
    log.flush.scheduler.interval.ms = 9223372036854775807
    log.flush.start.offset.checkpoint.interval.ms = 60000
    log.index.interval.bytes = 4096
    log.index.size.max.bytes = 10485760
    log.message.downconversion.enable = true
    log.message.format.version = 2.1-IV2
    log.message.timestamp.difference.max.ms = 9223372036854775807
    log.message.timestamp.type = CreateTime
    log.preallocate = false
    log.retention.bytes = -1
    log.retention.check.interval.ms = 300000
    log.retention.hours = 168
    log.retention.minutes = null
    log.retention.ms = null
    log.roll.hours = 168
    log.roll.jitter.hours = 0
    log.roll.jitter.ms = null
    log.roll.ms = null
    log.segment.bytes = 1073741824
    log.segment.delete.delay.ms = 60000
    max.connections.per.ip = 2147483647
    max.connections.per.ip.overrides = 
    max.incremental.fetch.session.cache.slots = 1000
    message.max.bytes = 1000012
    metric.reporters = []
    metrics.num.samples = 2
    metrics.recording.level = INFO
    metrics.sample.window.ms = 30000
    min.insync.replicas = 1
    num.io.threads = 8
    num.network.threads = 3
    num.partitions = 1
    num.recovery.threads.per.data.dir = 1
    num.replica.alter.log.dirs.threads = null
    num.replica.fetchers = 1
    offset.metadata.max.bytes = 4096
    offsets.commit.required.acks = -1
    offsets.commit.timeout.ms = 5000
    offsets.load.buffer.size = 5242880
    offsets.retention.check.interval.ms = 600000
    offsets.retention.minutes = 10080
    offsets.topic.compression.codec = 0
    offsets.topic.num.partitions = 50
    offsets.topic.replication.factor = 1
    offsets.topic.segment.bytes = 104857600
    password.encoder.cipher.algorithm = AES/CBC/PKCS5Padding
    password.encoder.iterations = 4096
    password.encoder.key.length = 128
    password.encoder.keyfactory.algorithm = null
    password.encoder.old.secret = null
    password.encoder.secret = null
    port = 9092
    principal.builder.class = null
    producer.purgatory.purge.interval.requests = 1000
    queued.max.request.bytes = -1
    queued.max.requests = 500
    quota.consumer.default = 9223372036854775807
    quota.producer.default = 9223372036854775807
    quota.window.num = 11
    quota.window.size.seconds = 1
    replica.fetch.backoff.ms = 1000
    replica.fetch.max.bytes = 1048576
    replica.fetch.min.bytes = 1
    replica.fetch.response.max.bytes = 10485760
    replica.fetch.wait.max.ms = 500
    replica.high.watermark.checkpoint.interval.ms = 5000
    replica.lag.time.max.ms = 10000
    replica.socket.receive.buffer.bytes = 65536
    replica.socket.timeout.ms = 30000
    replication.quota.window.num = 11
    replication.quota.window.size.seconds = 1
    request.timeout.ms = 30000
    reserved.broker.max.id = 1000
    sasl.client.callback.handler.class = null
    sasl.enabled.mechanisms = [GSSAPI]
    sasl.jaas.config = null
    sasl.kerberos.kinit.cmd = /usr/bin/kinit
    sasl.kerberos.min.time.before.relogin = 60000
    sasl.kerberos.principal.to.local.rules = [DEFAULT]
    sasl.kerberos.service.name = null
    sasl.kerberos.ticket.renew.jitter = 0.05
    sasl.kerberos.ticket.renew.window.factor = 0.8
    sasl.login.callback.handler.class = null
    sasl.login.class = null
    sasl.login.refresh.buffer.seconds = 300
    sasl.login.refresh.min.period.seconds = 60
    sasl.login.refresh.window.factor = 0.8
    sasl.login.refresh.window.jitter = 0.05
    sasl.mechanism.inter.broker.protocol = GSSAPI
    sasl.server.callback.handler.class = null
    security.inter.broker.protocol = PLAINTEXT
    socket.receive.buffer.bytes = 102400
    socket.request.max.bytes = 104857600
    socket.send.buffer.bytes = 102400
    ssl.cipher.suites = []
    ssl.client.auth = none
    ssl.enabled.protocols = [TLSv1.2, TLSv1.1, TLSv1]
    ssl.endpoint.identification.algorithm = https
    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
    transaction.abort.timed.out.transaction.cleanup.interval.ms = 60000
    transaction.max.timeout.ms = 900000
    transaction.remove.expired.transaction.cleanup.interval.ms = 3600000
    transaction.state.log.load.buffer.size = 5242880
    transaction.state.log.min.isr = 1
    transaction.state.log.num.partitions = 50
    transaction.state.log.replication.factor = 1
    transaction.state.log.segment.bytes = 104857600
    transactional.id.expiration.ms = 604800000
    unclean.leader.election.enable = false
    zookeeper.connect = master:2181
    zookeeper.connection.timeout.ms = 6000
    zookeeper.max.in.flight.requests = 10
    zookeeper.session.timeout.ms = 6000
    zookeeper.set.acl = false
    zookeeper.sync.time.ms = 2000
 (kafka.server.KafkaConfig)
[2019-04-07 10:47:36,717] INFO [ThrottledChannelReaper-Fetch]: Starting (kafka.server.ClientQuotaManager$ThrottledChannelReaper)
[2019-04-07 10:47:36,717] INFO [ThrottledChannelReaper-Produce]: Starting (kafka.server.ClientQuotaManager$ThrottledChannelReaper)
[2019-04-07 10:47:36,748] INFO [ThrottledChannelReaper-Request]: Starting (kafka.server.ClientQuotaManager$ThrottledChannelReaper)
[2019-04-07 10:47:36,980] INFO Loading logs. (kafka.log.LogManager)
[2019-04-07 10:47:37,027] INFO Logs loading complete in 46 ms. (kafka.log.LogManager)
[2019-04-07 10:47:37,097] INFO Starting log cleanup with a period of 300000 ms. (kafka.log.LogManager)
[2019-04-07 10:47:37,115] INFO Starting log flusher with a default period of 9223372036854775807 ms. (kafka.log.LogManager)
[2019-04-07 10:47:43,023] INFO Awaiting socket connections on 0.0.0.0:9092. (kafka.network.Acceptor)
[2019-04-07 10:47:43,297] INFO [SocketServer brokerId=0] Started 1 acceptor threads (kafka.network.SocketServer)
[2019-04-07 10:47:43,468] INFO [ExpirationReaper-0-Produce]: Starting (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper)
[2019-04-07 10:47:43,469] INFO [ExpirationReaper-0-Fetch]: Starting (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper)
[2019-04-07 10:47:43,491] INFO [ExpirationReaper-0-DeleteRecords]: Starting (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper)
[2019-04-07 10:47:43,617] INFO [LogDirFailureHandler]: Starting (kafka.server.ReplicaManager$LogDirFailureHandler)
[2019-04-07 10:47:43,763] INFO Creating /brokers/ids/0 (is it secure? false) (kafka.zk.KafkaZkClient)
[2019-04-07 10:47:43,793] INFO Result of znode creation at /brokers/ids/0 is: OK (kafka.zk.KafkaZkClient)
[2019-04-07 10:47:43,799] INFO Registered broker 0 at path /brokers/ids/0 with addresses: ArrayBuffer(EndPoint(master,9092,ListenerName(PLAINTEXT),PLAINTEXT)) (kafka.zk.KafkaZkClient)
[2019-04-07 10:47:43,821] WARN No meta.properties file under dir /usr/local/soft/kafka_2.11-2.1.1/logs/meta.properties (kafka.server.BrokerMetadataCheckpoint)
[2019-04-07 10:47:44,255] INFO [ExpirationReaper-0-topic]: Starting (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper)
[2019-04-07 10:47:44,255] INFO [ExpirationReaper-0-Heartbeat]: Starting (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper)
[2019-04-07 10:47:44,275] INFO [ExpirationReaper-0-Rebalance]: Starting (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper)
[2019-04-07 10:47:44,374] INFO Successfully created /controller_epoch with initial epoch 0 (kafka.zk.KafkaZkClient)
[2019-04-07 10:47:44,424] INFO [GroupCoordinator 0]: Starting up. (kafka.coordinator.group.GroupCoordinator)
[2019-04-07 10:47:44,470] INFO [GroupCoordinator 0]: Startup complete. (kafka.coordinator.group.GroupCoordinator)
[2019-04-07 10:47:44,636] INFO [GroupMetadataManager brokerId=0] Removed 0 expired offsets in 184 milliseconds. (kafka.coordinator.group.GroupMetadataManager)
[2019-04-07 10:47:44,805] INFO [ProducerId Manager 0]: Acquired new producerId block (brokerId:0,blockStartProducerId:0,blockEndProducerId:999) by writing to Zk with path version 1 (kafka.coordinator.transaction.ProducerIdManager)
[2019-04-07 10:47:45,012] INFO [TransactionCoordinator id=0] Starting up. (kafka.coordinator.transaction.TransactionCoordinator)
[2019-04-07 10:47:45,048] INFO [TransactionCoordinator id=0] Startup complete. (kafka.coordinator.transaction.TransactionCoordinator)
[2019-04-07 10:47:45,096] INFO [Transaction Marker Channel Manager 0]: Starting (kafka.coordinator.transaction.TransactionMarkerChannelManager)
[2019-04-07 10:47:45,480] INFO [/config/changes-event-process-thread]: Starting (kafka.common.ZkNodeChangeNotificationListener$ChangeEventProcessThread)
[2019-04-07 10:47:45,536] INFO [SocketServer brokerId=0] Started processors for 1 acceptors (kafka.network.SocketServer)
[2019-04-07 10:47:45,541] INFO Kafka version : 2.1.1 (org.apache.kafka.common.utils.AppInfoParser)
[2019-04-07 10:47:45,542] INFO Kafka commitId : 21234bee31165527 (org.apache.kafka.common.utils.AppInfoParser)
[2019-04-07 10:47:45,572] INFO [KafkaServer id=0] started (kafka.server.KafkaServer)
View Code

    端口检测:

    Kafka单节点及集群配置安装 _ JavaClub全栈架构师技术笔记

    其中9092为kafka的监听端口,2181位zookeeper的使用端口。

  4.单机连通性测试

    4.1启动生产者producer

      Kafka单节点及集群配置安装 _ JavaClub全栈架构师技术笔记

    4.2启动消费者consumer

      Kafka单节点及集群配置安装 _ JavaClub全栈架构师技术笔记

    4.3测试

      生产者生产数据:

      Kafka单节点及集群配置安装 _ JavaClub全栈架构师技术笔记

      消费者消耗数据:

      Kafka单节点及集群配置安装 _ JavaClub全栈架构师技术笔记

二.Kafka集群搭建

  未完待续......

 

作者:云山之巅
来源链接:https://www.cnblogs.com/yszd/p/10664405.html

版权声明:
1、JavaClub(https://www.javaclub.cn)以学习交流为目的,由作者投稿、网友推荐和小编整理收藏优秀的IT技术及相关内容,包括但不限于文字、图片、音频、视频、软件、程序等,其均来自互联网,本站不享有版权,版权归原作者所有。

2、本站提供的内容仅用于个人学习、研究或欣赏,以及其他非商业性或非盈利性用途,但同时应遵守著作权法及其他相关法律的规定,不得侵犯相关权利人及本网站的合法权利。
3、本网站内容原作者如不愿意在本网站刊登内容,请及时通知本站(javaclubcn@163.com),我们将第一时间核实后及时予以删除。


本文链接:https://www.javaclub.cn/server/42368.html

标签: Kafka
分享给朋友:

“Kafka单节点及集群配置安装” 的相关文章

kafka消息中间件-快速学习

为什么需要消息队列   周末无聊刷着手机,某宝网APP突然蹦出来一条消息“为了回馈老客户,女朋友买一送一,活动仅限今天!”。买一送一还有这种好事,那我可不能错过!忍不住立马点了去。于是选了两个最新款,下单、支付一气呵成!满足的躺在床上,想着马上有女朋友了,竟然幸福的失眠了…...

kafka集群搭建

kafka集群搭建

本文将记录使用kafka镜像,分别在两种场景下搭建3节点集群:1.在一台机器上使用容器方式安装kafka集群;2.在三台机器上使用容器方式安装kafka集群。 此次使用的是wurstmeister的,下载量是比较大的。使用下面命令下载: docker pull wur...

kafka消息长度限制

更改为10M 客户端代码增加:max_request_size=10485760, 服务端配置:replica.fetch.max.bytes=10485760,message.max.bytes=10485760...

【kafka】安装部署kafka集群(kafka版本:kafka_2.12-2.3.0)

3.2.1 下载kafka并安装kafka_2.12-2.3.0.tgz tar -zxvf kafka_2.12-2.3.0.tgz 3.2.2 配置kafka集群 在config/server.properties中修改参数: [had...

在CentOS 7上安装Kafka

简介 Kafka 是一种高吞吐的分布式发布订阅消息系统,能够替代传统的消息队列用于解耦合数据处理,缓存未处理消息等,同时具有更高的吞吐率,支持分区、多副本、冗余,因此被广泛用于大规模消息数据处理应用。Kafka 支持Java 及多种其它语言客户端,可与Hadoop、Storm、S...

kafka的基本概念和工作流程分析

kafka的基本概念和工作流程分析

为什么需要消息队列   周末无聊刷着手机,某宝网APP突然蹦出来一条消息“为了回馈老客户,女朋友买一送一,活动仅限今天!”。买一送一还有这种好事,那我可不能错过!忍不住立马点了去。于是选了两个最新款,下单、支付一气呵成!满足的躺在床上,想着马上有女朋友了,竟然幸福的失眠了…...

Linux下Kafka下载与安装教程

Linux下Kafka下载与安装教程

原文链接:http://www.studyshare.cn/software/details/1176/0 一、预备环境 Kafka是java生态圈中的一员,运行在java虚拟机上,按Kafka官方说明,java环境推荐Java8;Kafka需要Zookeeper保存集群的...

Linux安装新版Kafka3.0

Linux安装新版Kafka3.0

最近开始玩Kafka了,想着装一下新版本的玩玩,然后网上找Kafka3.0的安装教程,发现安装Kafka3.0的倒是有,但是zookeeper还是单独安装的,这就不满足我的需求了,我就是单纯的想玩玩Kafka,我还得再去另外安装zookeepe...

kafka集群原理介绍

kafka集群原理介绍 @(博客文章)[kafka|大数据] 目录 kafka集群原理介绍 (一)基础理论 二、配置文件 三、错误处理 本系统文章共三篇,分别为 1、ka...

Kafka 快速入门(安装)

Kafka 快速入门(安装)

kafka学习目录:kafka目录 二、Kafka 快速入门 2.1、windows版安装 2.1.1、Quick Start 本次安装学习在Windows操作系统进行。(Linux版本的差别不大,运行脚本文件后缀从bat...

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。