读书人

[转载]ZooKeeper集群调度管理详细版

发布时间: 2012-07-01 13:15:00 作者: rapoo

[转载]ZooKeeper集群部署管理详细版

## ZooKeeper Logging Configuration#?log4j.rootLogger=INFO, DEBUG, ERROR?# DEBUGlog4j.appender.DEBUG=org.apache.log4j.DailyRollingFileAppenderlog4j.appender.DEBUG.Threshold=DEBUGlog4j.appender.DEBUG.layout=org.apache.log4j.PatternLayoutlog4j.appender.DEBUG.layout.ConversionPattern=%d{ISO8601} - %-5p [%t:%C{1}@%L] - %m%nlog4j.appender.DEBUG.datePattern='.'yyyy-MM-dd'.log'log4j.appender.DEBUG.append=truelog4j.appender.DEBUG.File=/home/user/zk_logs/zk_debug.log?# INFOlog4j.appender.INFO=org.apache.log4j.DailyRollingFileAppenderlog4j.appender.INFO.Threshold=INFOlog4j.appender.INFO.layout=org.apache.log4j.PatternLayoutlog4j.appender.INFO.layout.ConversionPattern=%d{ISO8601} - %-5p [%t:%C{1}@%L] - %m%nlog4j.appender.INFO.datePattern='.'yyyy-MM-dd'.log'log4j.appender.INFO.append=truelog4j.appender.INFO.File=/home/user/zk_logs/zk_error.log?# ERRORlog4j.appender.ERROR=org.apache.log4j.DailyRollingFileAppenderlog4j.appender.ERROR.Threshold=ERRORlog4j.appender.ERROR.layout=org.apache.log4j.PatternLayoutlog4j.appender.ERROR.layout.ConversionPattern=%d{ISO8601} - %-5p [%t:%C{1}@%L] - %m%nlog4j.appender.ERROR.datePattern='.'yyyy-MM-dd'.log'log4j.appender.ERROR.append=truelog4j.appender.ERROR.File=/home/user/zk_logs/zk_error.log
7. Server简单管理命令:现在可以启动ZooKeeper服务器了:# Server启动命令$ [zk_dir]/bin/zkServer.sh start# Server重启$ [zk_dir]/bin/zkServer.sh restart# Server停止$ [zk_dir]/bin/zkServer.sh stop# Server基本状态查看,需要netcat$ [zk_dir]/bin/zkServer.sh status8. ZooKeeper的管理命令:需要使用telnet或者netcat连接到ZooKeeper Server的clientPort端口,命令均为4个字母,命令及功能如下:conf3.3.0新增: 打印server配置文件内容cons3.3.0新增:列出连接到本Server的Client的完整连接及Session信息。包括分组发送/接收信息,session id,操作延时,最后一个操作的执行等crst3.3.0新增: 重置所有连接/sessiondumpLists the outstanding sessions and ephemeral nodes. 只在leader server上有效。envi屏幕打印server的环境变量ruok测试server是否处于无错状态。 如果状态健康则返回”imok”,否则无任何结果。A response of “imok” does not necessarily indicate that the server has joined the quorum, just that the server process is active and bound to the specified client port. Use “stat” for details on state wrt quorum and client connection information.srstReset server statistics.srvr3.3.0新增: Lists full details for the server.statLists brief details for the server and connected clients.wchs3.3.0新增: Lists brief information on watches for the server.wchc3.3.0新增: Lists detailed information on watches for the server, by session. This outputs a list of sessions(connections) with associated watches (paths). Note, depending on the number of watches this operation may be expensive (ie impact server performance), use it carefully.wchp3.3.0新增: Lists detailed information on watches for the server, by path. This outputs a list of paths (znodes) with associated sessions. Note, depending on the number of watches this operation may be expensive (ie impact server performance), use it carefully.??出处:http://blog.odichy.org/2010/07/09/zookeeper%e9%9b%86%e7%be%a4%e9%83%a8%e7%bd%b2%e7%ae%a1%e7%90%86%e8%af%a6%e7%bb%86%e7%89%88.html?

读书人网 >开源软件

热点推荐