幼儿饰品瑜伽美体用品微软
投稿投诉
微软创意
爱情通信
用品婚姻
爱好看病
美体软件
影音星座
瑜伽周边
星座办公
饰品塑形
搞笑减肥
幼儿两性
智家潮品

Windows系统下模拟Kafka集群参数调优

  配置kafka运行环境
  kafka的包中已经包含了zookeeper但是我还是喜欢单独下载一个zookeeper下载kafka
  https:archive。apache。orgdistkafka2。6。3kafka2。122。6。3。tgz下载zookeeper
  https:www。apache。orgdyncloser。luazookeeperzookeeper3。6。3apachezookeeper3。6。3bin。tar。gz配置zookeeper
  解压下载的zookeeper安装包
  复制三份并修改文件夹的名字(其实可以用三份配置但是我喜欢复制三份)修改点一新建zkData文件夹
  在每一份的目录下新建zkData文件夹
  修改点二新建myid文件
  在每一份的zkData文件夹中新建myid文件,并分别把内容修改为123
  修改点三修改配置文件
  将conf目录下的zoosample。cfg文件修改为zoo。cfg,并修改文件内容
  修改文件内容
  第一处dataDir修改为zkData文件夹注意路径要用双反斜杠
  第二处端口号因为是在一台机器上跑多个实例所以端口号不能冲突
  第三处添加入下内容
  server。1localhost:2881:3881server。2localhost:2882:3882server。3localhost:2883:3883
  配置参数说明
  server。AB:C:D
  A是一个数字,表示这个是第几号服务器;
  集群模式下配置一个文件myid,这个文件在dataDir目录下,这个文件里面有一个数据就是A的值,Zookeeper启动时读取此文件,拿到里面的数据与zoo。cfg里面的配置信息比较从而判断到底是哪个server。
  B是这个服务器的地址;
  C是这个服务器Follower与集群中的Leader服务器交换信息的端口;
  D是万一集群中的Leader服务器挂了,需要一个端口来重新进行选举,选出一个新的Leader,而这个端口就是用来执行选举时服务器相互通信的端口。
  修改后的三个文件内容ThenumberofmillisecondsofeachticktickTime2000ThenumberofticksthattheinitialsynchronizationphasecantakeinitLimit10ThenumberofticksthatcanpassbetweensendingarequestandgettinganacknowledgementsyncLimit5thedirectorywherethesnapshotisstored。donotusetmpforstorage,tmphereisjustexamplesakes。dataDirD:softrepositoryzookeeperapachezookeeper3。6。3bin1zkDatatheportatwhichtheclientswillconnectclientPort2181themaximumnumberofclientconnections。increasethisifyouneedtohandlemoreclientsmaxClientCnxns60Besuretoreadthemaintenancesectionoftheadministratorguidebeforeturningonautopurge。http:zookeeper。apache。orgdoccurrentzookeeperAdmin。htmlscmaintenanceThenumberofsnapshotstoretainindataDirautopurge。snapRetainCount3PurgetaskintervalinhoursSetto0todisableautopurgefeatureautopurge。purgeInterval1MetricsProvidershttps:prometheus。ioMetricsExportermetricsProvider。classNameorg。apache。zookeeper。metrics。prometheus。PrometheusMetricsProvidermetricsProvider。httpPort7000metricsProvider。exportJvmInfotrueserver。1localhost:2881:3881server。2localhost:2882:3882server。3localhost:2883:3883启动zookeeper集群
  在cmd中进入每一份的zookeeper文件夹中,执行binzkServer。cmd
  配置kafka
  在D盘根目录复制解压后的kafka三份修改configserver。properties
  broker。id0
  log。dirstmpkafkalogs1
  zookeeper。connectlocalhost:2181,localhost:2182,localhost:2183kafka
  port9091
  端口号三份分别为909190929093LicensedtotheApacheSoftwareFoundation(ASF)underoneormorecontributorlicenseagreements。SeetheNOTICEfiledistributedwiththisworkforadditionalinformationregardingcopyrightownership。TheASFlicensesthisfiletoYouundertheApacheLicense,Version2。0(theLicense);youmaynotusethisfileexceptincompliancewiththeLicense。YoumayobtainacopyoftheLicenseathttp:www。apache。orglicensesLICENSE2。0Unlessrequiredbyapplicablelaworagreedtoinwriting,softwaredistributedundertheLicenseisdistributedonanASISBASIS,WITHOUTWARRANTIESORCONDITIONSOFANYKIND,eitherexpressorimplied。SeetheLicenseforthespecificlanguagegoverningpermissionsandlimitationsundertheLicense。seekafka。server。KafkaConfigforadditionaldetailsanddefaultsServerBasicsTheidofthebroker。Thismustbesettoauniqueintegerforeachbroker。broker。id1SocketServerSettingsTheaddressthesocketserverlistenson。Itwillgetthevaluereturnedfromjava。net。InetAddress。getCanonicalHostName()ifnotconfigured。FORMAT:listenerslistenername:hostname:portEXAMPLE:listenersPLAINTEXT:your。host。name:9092listenersPLAINTEXT::9092Hostnameandportthebrokerwilladvertisetoproducersandconsumers。Ifnotset,itusesthevalueforlistenersifconfigured。Otherwise,itwillusethevaluereturnedfromjava。net。InetAddress。getCanonicalHostName()。advertised。listenersPLAINTEXT:your。host。name:9092Mapslistenernamestosecurityprotocols,thedefaultisforthemtobethesame。Seetheconfigdocumentationformoredetailslistener。security。protocol。mapPLAINTEXT:PLAINTEXT,SSL:SSL,SASLPLAINTEXT:SASLPLAINTEXT,SASLSSL:SASLSSLThenumberofthreadsthattheserverusesforreceivingrequestsfromthenetworkandsendingresponsestothenetworknum。network。threads3Thenumberofthreadsthattheserverusesforprocessingrequests,whichmayincludediskIOnum。io。threads8Thesendbuffer(SOSNDBUF)usedbythesocketserversocket。send。buffer。bytes102400Thereceivebuffer(SORCVBUF)usedbythesocketserversocket。receive。buffer。bytes102400Themaximumsizeofarequestthatthesocketserverwillaccept(protectionagainstOOM)socket。request。max。bytes104857600LogBasicsAcommaseparatedlistofdirectoriesunderwhichtostorelogfileslog。dirstmpkafkalogs1Thedefaultnumberoflogpartitionspertopic。Morepartitionsallowgreaterparallelismforconsumption,butthiswillalsoresultinmorefilesacrossthebrokers。num。partitions1Thenumberofthreadsperdatadirectorytobeusedforlogrecoveryatstartupandflushingatshutdown。ThisvalueisrecommendedtobeincreasedforinstallationswithdatadirslocatedinRAIDarray。num。recovery。threads。per。data。dir1InternalTopicSettingsThereplicationfactorforthegroupmetadatainternaltopicsconsumeroffsetsandtransactionstateForanythingotherthandevelopmenttesting,avaluegreaterthan1isrecommendedtoensureavailabilitysuchas3。offsets。topic。replication。factor1transaction。state。log。replication。factor1transaction。state。log。min。isr1LogFlushPolicyMessagesareimmediatelywrittentothefilesystembutbydefaultweonlyfsync()tosynctheOScachelazily。Thefollowingconfigurationscontroltheflushofdatatodisk。Thereareafewimportanttradeoffshere:1。Durability:Unflusheddatamaybelostifyouarenotusingreplication。2。Latency:Verylargeflushintervalsmayleadtolatencyspikeswhentheflushdoesoccurastherewillbealotofdatatoflush。3。Throughput:Theflushisgenerallythemostexpensiveoperation,andasmallflushintervalmayleadtoexcessiveseeks。ThesettingsbelowallowonetoconfiguretheflushpolicytoflushdataafteraperiodoftimeoreveryNmessages(orboth)。Thiscanbedonegloballyandoverriddenonapertopicbasis。Thenumberofmessagestoacceptbeforeforcingaflushofdatatodisklog。flush。interval。messages10000Themaximumamountoftimeamessagecansitinalogbeforeweforceaflushlog。flush。interval。ms1000LogRetentionPolicyThefollowingconfigurationscontrolthedisposaloflogsegments。Thepolicycanbesettodeletesegmentsafteraperiodoftime,orafteragivensizehasaccumulated。Asegmentwillbedeletedwhenevereitherofthesecriteriaaremet。Deletionalwayshappensfromtheendofthelog。Theminimumageofalogfiletobeeligiblefordeletionduetoagelog。retention。hours168Asizebasedretentionpolicyforlogs。Segmentsareprunedfromthelogunlesstheremainingsegmentsdropbelowlog。retention。bytes。Functionsindependentlyoflog。retention。hours。log。retention。bytes1073741824Themaximumsizeofalogsegmentfile。Whenthissizeisreachedanewlogsegmentwillbecreated。log。segment。bytes1073741824Theintervalatwhichlogsegmentsarecheckedtoseeiftheycanbedeletedaccordingtotheretentionpolicieslog。retention。check。interval。ms300000ZookeeperZookeeperconnectionstring(seezookeeperdocsfordetails)。Thisisacommaseparatedhost:portpairs,eachcorrespondingtoazkserver。e。g。127。0。0。1:3000,127。0。0。1:3001,127。0。0。1:3002。Youcanalsoappendanoptionalchrootstringtotheurlstospecifytherootdirectoryforallkafkaznodes。zookeeper。connectlocalhost:2181,localhost:2182,localhost:2183kafkaTimeoutinmsforconnectingtozookeeperzookeeper。connection。timeout。ms18000GroupCoordinatorSettingsThefollowingconfigurationspecifiesthetime,inmilliseconds,thattheGroupCoordinatorwilldelaytheinitialconsumerrebalance。Therebalancewillbefurtherdelayedbythevalueofgroup。initial。rebalance。delay。msasnewmembersjointhegroup,uptoamaximumofmax。poll。interval。ms。Thedefaultvalueforthisis3seconds。Weoverridethisto0hereasitmakesforabetteroutoftheboxexperiencefordevelopmentandtesting。However,inproductionenvironmentsthedefaultvalueof3secondsismoresuitableasthiswillhelptoavoidunnecessary,andpotentiallyexpensive,rebalancesduringapplicationstartup。group。initial。rebalance。delay。ms0port9091启动kafkabinwindowskafkaserverstart。batconfigserver。propertiestopic查看topicbinwindowskafkatopics。batbootstrapserverlocalhost:9091list创建topicbinwindowskafkatopics。batbootstrapserverlocalhost:9091createpartitions1replicationfactor1topichellotest查看topic的详情binwindowskafkatopics。batbootstrapserverlocalhost:9091describetopichellotest修改分区数
  注意:分区数只能增加,不能减少binwindowskafkatopics。batbootstrapserverlocalhost:9091altertopichellotestpartitions3删除topicbinwindowskafkatopics。batbootstrapserverlocalhost:9091deletetopichello集群压力测试
  用Kafka自带的脚本,对Kafka进行压测。
  生产者压测脚本:kafkaproducerperftest。sh
  消费者压测脚本:kafkaconsumerperftest。shKafkaProducer压力测试创建一个hellotesttopic,设置为3个分区3个副本binwindowskafkatopics。batbootstrapserverlocalhost:9091createreplicationfactor3partitions3topichellotest测试生产者binwindowskafkaproducerperftest。battopichellotestrecordsize1024numrecords1000000throughput1producerpropsbootstrap。serverslocalhost:9091,localhost:9092,localhost:9093batch。size16384linger。ms0
  recordsize是一条信息有多大,单位是字节,本次测试设置为1k。
  numrecords是总共发送多少条信息,本次测试设置为100万条。
  throughput是每秒多少条信息,设成1,表示不限流,尽可能快的生产数据,可测出生产者最大吞吐量。
  producerprops后面可以配置生产者相关参数,batch。size配置为16k调整batch。size大小
  batch。size默认值是16k将batch。size设置为32kbinwindowskafkaproducerperftest。battopichellotestrecordsize1024numrecords1000000throughput10000producerpropsbootstrap。serverslocalhost:9091,localhost:9092,localhost:9093batch。size32768linger。ms0
  batch。size默认值是16k。将batch。size设置为4k。binwindowskafkaproducerperftest。battopichellotestrecordsize1024numrecords1000000throughput10000producerpropsbootstrap。serverslocalhost:9091,localhost:9092,localhost:9093batch。size4096linger。ms0调整linger。ms
  linger。ms默认是0ms。将linger。ms设置为50ms。binwindowskafkaproducerperftest。battopichellotestrecordsize1024numrecords1000000throughput10000producerpropsbootstrap。serverslocalhost:9091,localhost:9092,localhost:9093batch。size4096linger。ms50压缩方式
  调整压缩方式默认的压缩方式是none。将compression。type设置为snappy。binwindowskafkaproducerperftest。battopichellotestrecordsize1024numrecords1000000throughput10000producerpropsbootstrap。serverslocalhost:9091,localhost:9092,localhost:9093batch。size4096linger。ms50compression。typesnappy
  默认的压缩方式是none。将compression。typee设置为zstd。binwindowskafkaproducerperftest。battopichellotestrecordsize1024numrecords1000000throughput10000producerpropsbootstrap。serverslocalhost:9091,localhost:9092,localhost:9093batch。size4096linger。ms50compression。typezstd
  默认的压缩方式是none。将compression。type设置为gzip。binwindowskafkaproducerperftest。battopichellotestrecordsize1024numrecords1000000throughput10000producerpropsbootstrap。serverslocalhost:9091,localhost:9092,localhost:9093batch。size4096linger。ms50compression。typegzip
  默认的压缩方式是none。将compression。type设置为lz4binwindowskafkaproducerperftest。battopichellotestrecordsize1024numrecords1000000throughput10000producerpropsbootstrap。serverslocalhost:9091,localhost:9092,localhost:9093batch。size4096linger。ms50compression。typelz4调整缓存大小buffer。memory
  调整缓存大小默认生产者端缓存大小32m。将buffer。memory设置为64m。binwindowskafkaproducerperftest。battopichellotestrecordsize1024numrecords1000000throughput1producerpropsbootstrap。serverslocalhost:9091,localhost:9092,localhost:9093batch。size4096linger。ms50buffer。memory67108864测试Consumer性能默认情况的吞吐量binwindowskafkaconsumerperftest。batbootstrapserverlocalhost:9091,localhost:9092,localhost:9093topichellotestmessages10000000consumer。configconfigconsumer。propertiestimeout10000
  bootstrapserver指定Kafka集群地址
  topic指定topic的名称
  messages总共要消费的消息个数
  调整max。poll。records
  一次拉取条数为2000
  修改configconsumer。properties文件中的一次拉取条数为2000max。poll。records2000
  一次拉取条数为20000
  修改configconsumer。properties文件中的一次拉取条数为20000max。poll。records20000
  一次拉取条数为200000
  修改configconsumer。properties文件中的一次拉取条数为200000max。poll。records200000
  可以看到每秒的消息数量已经不会提升了
  一次拉取条数为100000
  修改configconsumer。properties文件中的一次拉取条数为100000max。poll。records100000
  fetch。max。bytes
  修改optmodulekafkaconfigconsumer。properties文件中的拉取一批数据大小100mfetch。max。bytes104857600

贾静雯穿深V裙秀身材,戴38克拉宝石脖子太重,回应女儿晒性感近日,演员贾静雯和杨祐宁出席了某奢侈品牌的高级珠宝展览活动,两人搞笑互动和穿着打扮引起了网友们的热议。当日贾静雯穿着一袭紫色薄纱深V长裙明艳动人,皮肤白皙紧致身材匀称,完……广汽集团埃安新能源车销量增长投资收益增加等,第三季度归母净利广汽集团10月27日发布2022年第三季度报告,前三季度实现营业收入799。76亿元,同比增长45。1;归属于上市公司股东的净利润80。62亿元,同比增长52。59。其中,第三……俗语男不带天,女不带仙,天和仙指什么意思?为何不能带?如今给孩子取名是让父母最头疼的事情,毕竟名字会伴随孩子的一生,父母们总是担心自己不谨慎取了不好的名字,给孩子造成不良影响。其实古人们早就为我们总结好了取名字的一些俗语,其中男不……逛超市时,女生碰到这4款宝藏美食别手软,便宜解馋,很良心逛超市时,女生碰到这4款宝藏美食别手软,便宜解馋,很良心常言道民以食为天,但对小编来说就是我以吃为生!不管是美食,还是新奇口味的零食,小编都来者不拒,只要美味就都是……IEA绿色经济重塑能化就业市场近日,国际能源署(IEA)发布《世界能源就业报告》。该报告称,目前全球能源领域的就业人数已超过6500万,约占全球总劳动力的2,清洁能源及其相关行业正在引领这一增长。IE……中国抛售3359亿美债,美媒美联储停止接盘,美国人持续囤积中美东时间7月28日公布的最新数据显示,美国二季度实际GDP年化季环比初值0。9,前值1。6。美国经济连续两个月萎缩,已经开始进入技术性衰退时间。而在这一过程中,美国经济实际上还……金融收益到底有多高?中金回应90后券商交易员月入超8万90后券商交易员月入超8万?中金回应美媒:佩洛西台湾行程被列为待定超两小时中美元首通话释放哪些信息金粉社区金融不是吧不是吧,这是被红眼了吗,8万也值得?不过这媳妇确……18款值得买手机推荐,总有一款适合你10001500IQOOZ5骁龙778、重193g、6。67英寸120HzLCD居中挖孔屏、后摄主摄6400万、1300万广角、200万微距、前置1600万、Ori……瓜分恒大2022年双11甩卖最狠的居然是恒大,前脚刚被华尔街灵魂暴击,血亏了55亿;后脚呢,要卖掉自己的总部大楼,一场瓜分恒大的危机已经出现了。11月12日,恒大把它深圳湾超级总……鲁能与申花的比赛还没开打,就接连收到坏消息,或因此被申花双杀日前,中国足协对泰山队门神王大雷开出了罚单。王大雷被足协停赛4场,让很多山东球迷都觉得不服。王大雷在本轮代表泰山队出战与津门虎的比赛中,出现了不冷静的行为。当时,鲁能中场核心孙……南京溧水永阳凉篷下村古村落焕发新光彩为了留住客人,我们不断丰富村里的娱乐活动,让游客从‘一日游’到‘多日留’。凉篷下花海寒舍酒店管理有限公司总经理黄开林介绍,从试营业至今,他们围绕文旅康养策划组织了一系列活动,用……这个榜单,为中国互联网正了名中国互联网给质疑者狠狠上了一课。中国互联网创业者素以模式创新见长,比如共享经济、O2O、社区团购、下沉市场电商等,其中佼佼者如美团、拼多多等,已经成为中国互联网版图的重量……
叛徒张本智和全家叛逃日本,扬言吊打中国乒乓球队,后来怎么样文九月编辑九月2022年7月29日,国际乒联公布了本月23日将要举办WTT支线赛的运动员名单。日本乒乓球协会也公布了,在这次的比赛中,将要上场的运动员和教练的……别再披头散发了!热不死你!这5款发型才够美够清凉Halo,姐妹们好呀!不知道大家会不会和我一样,一到夏天就热得背夹流汗,很想把长发咔嚓掉。但因为我是大圆脸不敢轻易尝试短发,所以夏天只好把头发扎起来才不会被热……如果看不惯一个人,请记住这四种回应方式01hr任何一份感情,都是双向奔赴的。你看不惯的人,大概率会看不惯你。投射效应说明,很多人习惯把自己的特点,归于别人身上。用自己的认知去衡量别人,甚至强加于别人。这……科技鬼才李一男从华为太子爷沦为阶下囚,一把好牌被他打烂为了让华为发展得更好,吸引更多的人才,任正非拿出高薪面向全球,招募天才少年,在高薪的诱惑下,不少人加入。华为不缺优秀人才,但被任正非看好又爬上总裁之位的却不多,这么多年以来也只……法国希思黎520礼遇季法式奢宠为TA心选5月过半,520即将如约而至。在这浓情蜜意的夏日里,在这大声表白的节日里,情感似乎也呼之欲出,热烈无比。也许不经意就在眉梢、嘴角透露出浓浓的爱意;也许只想给对方最贴心的肌肤守护……足球报海港有意引进广州队两名归化国脚,包含艾克森直播吧2月24日讯《足球报》消息,上海海港有意引进包括艾克森在内的广州队两名归化国脚球员,以及另一名正值当打之间的广州队国脚。不仅如此,上海海港还将引进徐新,加强中后场的……碘化镍二维材料中的多铁状态铁电与铁磁同时存在近日,麻省理工学院的物理学家在一种像单层原子一样薄的材料中发现了奇异的多铁性状态。他们的观察结果首次证实了多铁性可以存在于完美的二维材料中。这些发现为开发更小、更快、更高效的数……50句关于春天的文案春暖花开我负责分享文字,你负责热爱生活!文字的力量第115期01。祝我们好在春天。02。春一暖,花就开了。03。春空烟迷,四山霞飞,谁也夺不去的春天,来临了!……按摩穴位可以有效的保养身体,推荐这5个穴位,没事揉一揉按摩穴位可以有效保养身体并延年益寿是很多人都听说过的养生小妙招。不过众所周知,人体全身各处分布着的穴位是非常多的,那么想要最大限度的实现延缓衰老和延年益寿效果,到底应当针……长城脚下年味儿浓延庆最美冬奥城冬季旅游文化节喜迎四方宾朋1月25日,延庆八达岭镇首届冬季旅游文化节精彩继续,石佛寺、石峡、岔道三个村锣鼓喧天,为八方来客呈上长城脚下村民们的节庆盛宴。石佛寺村石佛寺村舞龙队的19名队员,在……郭艾伦就是这么容易被害干就玩了家里人都认可你决赛MVP评选规则,在这节骨眼上公布,还公布排名,付豪第一艾伦第二。啥意思你们不懂吗?之前就说过了,艾伦需要的是表扬是肯定。官方到底是想中国篮……容言,容事,容人生活中,一个容字,看似简单,实则寓意深远。海纳百川,有容乃大。容,体现一个人的胸襟气度,一个人的格局度量。生活不是战场,无需一较高下。做自己的事,莫管他人之言论。不论是赞赏支持……
友情链接:易事利快生活快传网聚热点七猫云快好知快百科中准网快好找文好找中准网快软网