zookeeper解决了哪些问题

 我来答
匿名用户
2016-07-16
展开全部
今天发现一个问题,zookeeper默认对每个结点的最大数据量有一个上限是1M,如果你要设置的配置数据大于这个上限将无法写法,在网上查了一圈发现有一个解决方案如下,增加-Djute.maxbuffer=10240000参数最终提供一个完整的修改后的zkServer.sh文件如下#!/bin/sh#LicensedtotheApacheSoftwareFoundation(ASF)underoneormore#contributorlicenseagreements.SeetheNOTICEfiledistributedwith#thisworkforadditionalinformationregardingcopyrightownership.#TheASFlicensesthisfiletoYouundertheApacheLicense,Version2.0#(the"License");youmaynotusethisfileexceptincompliancewith#theLicense.YoumayobtainacopyoftheLicenseat##LICENSE-2.0##Unlessrequiredbyapplicablelaworagreedtoinwriting,software#distributedundertheLicenseisdistributedonan"ASIS"BASIS,#WITHOUTWARRANTIESORCONDITIONSOFANYKIND,eitherexpressorimplied.#SeetheLicenseforthespecificlanguagegoverningpermissionsand#limitationsundertheLicense.##Ifthisscriptedisrunoutof/usr/binorsomeothersystembindirectory#itshouldbelinkedtoandnotcopied.Thingslikejavajarfilesarefound#relativetothecanonicalpathofthisscript.##Seethefollowingpageforextensivedetailsonsetting#uptheJVMtoacceptJMXremotemanagement:##bydefaultweallowlocalJMXconnectionsZOO_USER_CFG="-Djute.maxbuffer=10240000"if["x$JMXLOCALONLY"="x"]thenJMXLOCALONLY=falsefiif["x$JMXDISABLE"="x"]thenecho"JMXenabledbydefault">&2#forsomereasonthesetwooptionsarenecessaryonjdk6onUbuntu#accordtothedocstheyarenotnecessary,butotwjconsolecannot#doalocalattachZOOMAIN="-Dcom.sun.management.jmxremote-Dcom.sun.management.jmxremote.local.only=$JMXLOCALONLYorg.apache.zookeeper.server.quorum.QuorumPeerMain"elseecho"JMXdisabledbyuserrequest">&2ZOOMAIN="org.apache.zookeeper.server.quorum.QuorumPeerMain"fi#Onlyfollowsymlinksifreadlinksupportsitifreadlink-f"$0">/dev/null2>&1thenZOOBIN=`readlink-f"$0"`elseZOOBIN="$0"fiZOOBINDIR=`dirname"$ZOOBIN"`."$ZOOBINDIR"/zkEnv.shif["x$SERVER_JVMFLAGS"]thenJVMFLAGS="$SERVER_JVMFLAGS$JVMFLAGS"fiif["x$2"!="x"]thenZOOCFG="$ZOOCFGDIR/$2"fi#ifwegiveamorecomplicatedpathtotheconfig,don'tscrewaroundin$ZOOCFGDIRif["x`dirname$ZOOCFG`"!="x$ZOOCFGDIR"]thenZOOCFG="$2"echo"Usingconfig:$2">&2fiif$cygwinthenZOOCFG=`cygpath-wp"$ZOOCFG"`#cygwinhasa"kill"intheshellitself,getsconfusedKILL=/bin/killelseKILL=killfiecho"Usingconfig:$ZOOCFG">&2if[-z$ZOOPIDFILE]thenZOOPIDFILE=$(grepdataDir"$ZOOCFG"|sed-e's/.*=//')/zookeeper_server.pidfi_ZOO_DAEMON_OUT="$ZOO_LOG_DIR/zookeeper.out"case$1instart)echo-n"Startingzookeeper"if[-f$ZOOPIDFILE];thenifkill-0`cat$ZOOPIDFILE`>/dev/null2>&1;thenecho$commandalreadyrunningasprocess`cat$ZOOPIDFILE`.exit0fifinohup$JAVA"$ZOO_USER_CFG""-Dzookeeper.log.dir=${ZOO_LOG_DIR}""-Dzookeeper.root.logger=${ZOO_LOG4J_PROP}"\-cp"$CLASSPATH"$JVMFLAGS$ZOOMAIN"$ZOOCFG">"$_ZOO_DAEMON_OUT"2>&1"$ZOOPIDFILE"thensleep1echoSTARTEDelseechoFAILEDTOWRITEPIDexit1fielseechoSERVERDIDNOTSTARTexit1fi;;start-foreground)ZOO_CMD="exec$JAVA"if["${ZOO_NOEXEC}"!=""];thenZOO_CMD="$JAVA"fi$ZOO_CMD"$ZOO_USER_CFG""-Dzookeeper.log.dir=${ZOO_LOG_DIR}""-Dzookeeper.root.logger=${ZOO_LOG4J_PROP}"\-cp"$CLASSPATH"$JVMFLAGS$ZOOMAIN"$ZOOCFG";;print-cmd)echo"$JAVA-Dzookeeper.log.dir=\"${ZOO_LOG_DIR}\"-Dzookeeper.root.logger=\"${ZOO_LOG4J_PROP}\"-cp\"$CLASSPATH\"$JVMFLAGS$ZOOMAIN\"$ZOOCFG\">\"$_ZOO_DAEMON_OUT\"2>&1/dev/null\|grepMode`if["x$STAT"="x"]thenecho"Errorcontactingservice.Itisprobablynotrunning."exit1elseecho$STATexit0fi;;*)echo"Usage:$0{start|start-foreground|stop|restart|status|upgrade|print-cmd}">&2esac
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式