kafka集群配置与安装
2017-03-09 19:48
369 查看
#LicensedtotheApacheSoftwareFoundation(ASF)underoneormore
#contributorlicenseagreements.SeetheNOTICEfiledistributedwith
#thisworkforadditionalinformationregardingcopyrightownership.
#TheASFlicensesthisfiletoYouundertheApacheLicense,Version2.0
#(the"License");youmaynotusethisfileexceptincompliancewith
#theLicense.YoumayobtainacopyoftheLicenseat
#
#'target='_blank'>http://www.apache.org/licenses/LICENSE-2.0[/code] ##Unlessrequiredbyapplicablelaworagreedtoinwriting,software#distributedundertheLicenseisdistributedonan"ASIS"BASIS,#WITHOUTWARRANTIESORCONDITIONSOFANYKIND,eitherexpressorimplied.#SeetheLicenseforthespecificlanguagegoverningpermissionsand#limitationsundertheLicense.#seekafka.server.KafkaConfigforadditionaldetailsanddefaults#############################ServerBasics##############################Theidofthebroker.Thismustbesettoauniqueintegerforeachbroker.broker.id=0#############################SocketServerSettings##############################Theportthesocketserverlistensonport=9092#Hostnamethebrokerwillbindto.Ifnotset,theserverwillbindtoallinterfaceshost.name=10.189.122.207#Hostnamethebrokerwilladvertisetoproducersandconsumers.Ifnotset,itusesthe#valuefor"host.name"ifconfigured.Otherwise,itwillusethevaluereturnedfrom#java.net.InetAddress.getCanonicalHostName().#advertised.host.name=<hostnameroutablebyclients>#TheporttopublishtoZooKeeperforclientstouse.Ifthisisnotset,#itwillpublishthesameportthatthebrokerbindsto.#advertised.port=<portaccessiblebyclients>#Thenumberofthreadshandlingnetworkrequestsnum.network.threads=3#ThenumberofthreadsdoingdiskI/Onum.io.threads=8#Thesendbuffer(SO_SNDBUF)usedbythesocketserversocket.send.buffer.bytes=102400#Thereceivebuffer(SO_RCVBUF)usedbythesocketserversocket.receive.buffer.bytes=102400#Themaximumsizeofarequestthatthesocketserverwillaccept(protectionagainstOOM)socket.request.max.bytes=104857600#############################LogBasics##############################Acommaseperatedlistofdirectoriesunderwhichtostorelogfileslog.dirs=/tmp/kafka-logs#Thedefaultnumberoflogpartitionspertopic.Morepartitionsallowgreater#parallelismforconsumption,butthiswillalsoresultinmorefilesacross#thebrokers.num.partitions=2#Thenumberofthreadsperdatadirectorytobeusedforlogrecoveryatstartupandflushingatshutdown.#ThisvalueisrecommendedtobeincreasedforinstallationswithdatadirslocatedinRAIDarray.num.recovery.threads.per.data.dir=1#############################LogFlushPolicy##############################Messagesareimmediatelywrittentothefilesystembutbydefaultweonlyfsync()tosync#theOScachelazily.Thefollowingconfigurationscontroltheflushofdatatodisk.#Thereareafewimportanttrade-offshere:#1.Durability:Unflusheddatamaybelostifyouarenotusingreplication.#2.Latency:Verylargeflushintervalsmayleadtolatencyspikeswhentheflushdoesoccurastherewillbealotofdatatoflush.#3.Throughput:Theflushisgenerallythemostexpensiveoperation,andasmallflushintervalmayleadtoexceessiveseeks.#Thesettingsbelowallowonetoconfiguretheflushpolicytoflushdataafteraperiodoftimeor#everyNmessages(orboth).Thiscanbedonegloballyandoverriddenonaper-topicbasis.#Thenumberofmessagestoacceptbeforeforcingaflushofdatatodisk#log.flush.interval.messages=10000#Themaximumamountoftimeamessagecansitinalogbeforeweforceaflush#log.flush.interval.ms=1000#############################LogRetentionPolicy##############################Thefollowingconfigurationscontrolthedisposaloflogsegments.Thepolicycan#besettodeletesegmentsafteraperiodoftime,orafteragivensizehasaccumulated.#Asegmentwillbedeletedwhenever*either*ofthesecriteriaaremet.Deletionalwayshappens#fromtheendofthelog.#Theminimumageofalogfiletobeeligiblefordeletionlog.retention.hours=24#Asize-basedretentionpolicyforlogs.Segmentsareprunedfromthelogaslongastheremaining#segmentsdon'tdropbelowlog.retention.bytes.#log.retention.bytes=1073741824#Themaximumsizeofalogsegmentfile.Whenthissizeisreachedanewlogsegmentwillbecreated.log.segment.bytes=1073741824#Theintervalatwhichlogsegmentsarecheckedtoseeiftheycanbedeletedaccording#totheretentionpolicieslog.retention.check.interval.ms=300000#Bydefaultthelogcleanerisdisabledandthelogretentionpolicywilldefaulttojustdeletesegmentsaftertheirretentionexpires.#Iflog.cleaner.enable=trueissetthecleanerwillbeenabledandindividuallogscanthenbemarkedforlogcompaction.log.cleaner.enable=false#############################Zookeeper##############################Zookeeperconnectionstring(seezookeeperdocsfordetails).#Thisisacommaseparatedhost:portpairs,eachcorrespondingtoazk#server.e.g."127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002".#Youcanalsoappendanoptionalchrootstringtotheurlstospecifythe#rootdirectoryforallkafkaznodes.zookeeper.connect=10.189.122.207:2181,10.189.122.208:2181,10.189.122.213:2181#Timeoutinmsforconnectingtozookeeperzookeeper.connection.timeout.ms=6000
config目录下server.conf的配置如上所示,其它的broker服务器需要修改broker.id与host.name(zk上显示的),然后通过bin/kafka-server-start.sh
config/server.properties进行启动.
相关文章推荐
- kafka_2.11-0.10.1.1集群搭建安装配置
- kafka集群安装配置
- zookeeper、kafka的安装与配置以及集群
- Kafka详细教程:下载、安装、配置与集群部署
- Kafka集群安装配置
- kafka学习2:kafka集群安装与配置
- kafka_2.12-0.10.2.1集群搭建安装配置
- kafka+zookeeper集群安装与配置(CENTOS7环境)及开发中遇到的问题解决
- 安装配置kafka集群
- kafka集群安装与配置
- kafka集群安装、配置
- Kafka安装配置(集群模式)
- kafka_2.11-1.0.0单机和集群的安装和配置
- Kafka集群安装配置,kafka后台运行的方式,Kafka配置文件中的参数说明
- kafka_2.10-0.8.1.1.tgz的1或3节点集群的下载、安装和配置(图文详细教程)绝对干货
- kafka集群安装与配置
- kafka学习 (一)集群安装配置
- Zookeeper3.4.6与Kafka0.8.1.1集群安装和配置详细步骤
- kafka安装及配置-集群(转)
- Kafka 集群的安装与配置