ZooKeeper监控平台的搭建方法

这篇文章主要介绍“ ZooKeeper监控平台的搭建 方法”,在日常操作中,相信很多人在 ZooKeeper监控平台的搭建 方法问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答” ZooKeeper监控平台的搭建 方法”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!

目前成都创新互联公司已为数千家的企业提供了网站建设、域名、网站空间、网站托管、服务器租用、企业网站设计、定结网站维护等服务,公司将坚持客户导向、应用为本的策略,正道将秉承"和谐、参与、激情"的文化,与客户和合作伙伴齐心协力一起成长,共同发展。

系统环境:

SUSE Linux Enterprise Server 10 SP1 (x86_64)

本次采用阿里开源的taokeeper,相关软件包下载地址如下:

taokeeper.sql

http://down.51cto.com/data/718756

taokeeper-monitor-config.properties

http://down.51cto.com/data/715439

taokeeper-monitor

http://down.51cto.com/data/715431

=========================================================================================

一、JAVA环境部署

1、JDK配置

# tar xvzf jdk-7u25-linux-x64.tar.gz -C /usr/local

# cd /usr/local

# ln -s jdk1.7.0_25 jdk

# vim /etc/profile

export JAVA_HOME=/usr/local/jdk

export CLASS_PATH=$JAVA_HOME/lib:$JAVA_HOME/jre/lib

export PATH=$PATH:$JAVA_HOME/bin

# source /etc/profile

2、Tomcat安装

# tar xvzf apache-tomcat-7.0.39.tar.gz -C /usr/local

# cd /usr/local

# ln -s apache-tomcat-7.0.39 tomcat

=========================================================================================

二、taokeeper部署

# MySQL -uroot < taokeeper.sql

# tar xvzf taokeeper-monitor.tar.gz -C /usr/local/tomcat/webapps

# mysql -uroot -e "grant all privileges on taokeeper.* to mytest@'172.18.35.29' identified by '123456';"

# mysql -uroot -e "flush privileges;"

-----------------------------------------------------------------------------------------------------------------------------------------------

# mkdir -p /usr/local/tomcat/webapps/taokeeper-monitor/{config,ZookeeperStore,logs}

# vim /usr/local/tomcat/webapps/taokeeper-monitor/config/taokeeper-monitor-config.properties

systemInfo.envName=TAOKEEPER

#DBCP

dbcp.driverClassName=com.mysql.jdbc.Driver

dbcp.dbJDBCUrl=jdbc:mysql://172.18.35.29:3306/taokeeper

dbcp.characterEncoding=GBK

dbcp.username=mytest

dbcp.password=123456

dbcp.maxActive=30

dbcp.maxIdle=10

dbcp.maxWait=10000

#SystemConstant

SystemConstent.dataStoreBasePath=/usr/local/tomcat/webapps/taokeeper-monitor/ZookeeperStore

SystemConstant.configOfMsgCenter=

#SSH account of zk server

SystemConstant.portOfSSH=22

SystemConstant.userNameOfSSH=root

SystemConstant.passwordOfSSH=123456

#LOGBACK

LOG_HOME=/usr/local/tomcat/webapps/taokeeper-monitor/logs

LOG_LEVEL=DEBUG

MAX_HISTORY_LOG_FILES=10

# chown -R nobody:nogroup /usr/local/tomcat/webapps/taokeeper-monitor

# chmod -R 750 /usr/local/tomcat/webapps/taokeeper-monitor

-----------------------------------------------------------------------------------------------------------------------------------------------

# vim /usr/local/tomcat/bin/catalina.sh

在236行后添加:

JAVA_OPTS=-DconfigFilePath="/usr/local/tomcat/webapps/taokeeper-monitor/config/taokeeper-monitor-config.properties"

# vim /usr/local/tomcat/conf/server.xml

修改为内网IP,在22行:

修改为80端口和绑定内网IP,在70行:

connectionTimeout="20000"

redirectPort="8443" />

修改绑定内网IP,在91行:

-----------------------------------------------------------------------------------------------------------------------------------------------

# vim /usr/local/tomcat/webapps/taokeeper-monitor/WEB-INF/classes/log4j.properties

替换其中的日志路径为:

/usr/local/tomcat/webapps/taokeeper-monitor/logs/taokeeper-monitor.log

服务启动:

# /usr/local/tomcat/bin/startup.sh

服务关闭:

# /usr/local/tomcat/bin/shutdown.sh

# echo "alias nc='netcat'" >> /etc/bash.bashrc

# sh /etc/bash.bashrc

-----------------------------------------------------------------------------------------------------------------------------------------------

访问以下地址:

http://172.18.35.29/taokeeper-monitor

=========================================================================================

三、安全设置

1、删除tomcat默认目录

rm -rf /usr/local/tomcat/webapps/*

2、删除jspx文件解析

/usr/local/tomcat/conf/web.xml (368行)

*.jspx

3、禁止显示错误信息

/usr/local/tomcat/conf/web.xml

在这一行后面,增加以下内容:

500

/500.jsp

4、非root模式启动

才用jsvc方式启动总失败,暂未解决

=========================================================================================

四、效果展示

ZooKeeper监控平台的搭建 方法

目前还存在的问题:

连接数、Watch数总为0,无法获取,但节点自检是OK的。

到此,关于“ ZooKeeper监控平台的搭建 方法”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注创新互联网站,小编会继续努力为大家带来更多实用的文章!


本文标题:ZooKeeper监控平台的搭建方法
当前URL:http://hbruida.cn/article/jeigoe.html