cat监控平台环境搭建
来源:互联网 发布:韩火火的淘宝店 编辑:程序博客网 时间:2024/06/06 07:10
cat监控平台环境搭建
项目地址:https://github.com/dianping/cat
编译步骤:
这个项目比较另类,把编译需要的jar包,单独放在git分支mvn-repo里了,而且官方文档里给了一个错误的命令提示:
git git@github.com:dianping/cat.git mvn-repo
当你直接把这条命令贴到terminal里执行时,会提示命令无效,正确的姿势如下:
1、先安装jdk 1.7
这点很重要,cat项目的开发时间比较早,当时估计jdk8还没有,在1.8下编译虽然能成功,但是最后运行时会报错。
注:对于已经安装了jdk1.8的mac,可以参考Mac下同时安装多个版本的JDK ,如果弄多版本jdk切换,不要在PATH变量里加$JAVA_HOME/bin,否则alias切换只切换了JAVA_HOME,但是PATH里的值不会变。
2、将分支mvn-repo下的jar包复制到本机maven仓库
git clone https:
//github
.com
/dianping/cat
.git
cd
cat
git checkout mvn-repo
cp
-R * ~/.m2
/repository
git checkout master
mvn clean
install
-DskipTests
然后再编译就可以了,再次提醒:如果安装了多个版本的jdk,编译前先将jdk版本切换到jdk 1.7(包括编译成功后,运行时也要jdk 1.7环境)
部署步骤:
mvn
cat
:
install
安装过程中,会提示输入mysql的连接地址,输入格式严格按 jdbc:mysql://127.0.0.1:3306 这种格式来,后面不要加一些额外参数,然后输入用户名、密码(该用户要有创建database的权限),之后会自动在mysql中创建cat数据库,然后创建一堆表。
cd
cat
-home
mvn jetty:run
如果启动过程无错,就能见到传说中的CAT界面了
windows下的注意事项:
Windows 则是对系统运行盘下的/data/appdatas/cat和/data/applogs/cat有读写权限 //这个地方要特别说明一下,如有cat的源文件在E盘,则相关配置文件就应该放在e:/data/appdatas/cat/下面
其它运行模式:
命令进入cat下的cat-home目录
执行命令 mvn jetty:run ,启动cat服务
成功后,浏览器打开http://localhost:2281/cat 可以看到cat监控的界面
或者在cat目录下输入 mvn eclipse:clean eclipse:eclipse 然后将项目导入到eclipse中,运行cat-home项目里得‘com.dianping.cat.TestServer’来启动CAT。
cat监控平台环境搭建
FAQ:
异常解决:
要按readme的要求,使用jdk1.8以下进行编译生成war。否则,就有下面的错:
[ERROR] [ServletHolder] Servlet initializing failed. org.unidal.lookup.LookupException: Component(org.unidal.web.lifecycle.RequestLifecycle) lookup failure. details: Unable to lookup component 'org.unidal.web.lifecycle.RequestLifecycle', it could not be started.
role: org.unidal.web.lifecycle.RequestLifecycle
roleHint: mvc
maven用的jdk环境和我编译的环境不一样,maven要依赖javahome
http://www.oschina.net/question/1463652_2152237
更改tomcat JDK:
经测试,更改catalina.bat设置也可以
@echo offset JAVA_HOME=C:\Program Files\Java\jdk1.7.0_13set JRE_HOME=C:\Program Files\Java\jre7
1、windows下:
修改 tomcat
/bin/setclasspath
.bat
在
rem Otherwise either JRE or JDK are fine
之前加上
set
JAVA_HOME = C:\.... jdk路径
set
JRE_HOME = C:\....\jre Jre路径
2、linux环境下
修改tomcat
/bin/setclasspath
.sh
在
# First clear out the user classpath
CLASSPATH=
下面添加上
export
JAVA_HOME=
/home/tool/jdk1
.6.0_18 --jdk路径
export
JRE_HOME=
/home/tool/jdk1
.6.0_18
/jre
--jre路径
保存,重新启动tomcat
mvn编译cat的代码进报下面的错:
A required class is missing:com/thoughtworks/xstream/io/HierarchicalStreamDriver
解决办法:
在mvn本地仓库中com\thoughtworks\xstream这个文件夹。重新执行mvn clean install -DskipTests即可
因为没有这个文件夹,相关的jar都会重新下载,然后就下载到了。
http://www.myexception.cn/xml-soap/1898572.html
[INFO] Final Memory: 11M/307M
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'jetty' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories
[local (e:\m2repository), central (http://repo.maven.apache.org/maven2)] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundF
orPrefixException
原因:
settings.xml没有配置插件应此需要
mvn org.mortbay.jetty:maven-jetty-plugin:run
这样来运行。
如果需要使用jetty:run,那么必须在maven的setting.xml下配置
解决办法:
在.m2的settings.xml文件的pluginGroups节点添加关于jetty的信息:
<!-- pluginGroups | This is a list of additional group identifiers that will be searched when resolving plugins by their prefix, i.e. | when invoking a command line like "mvn prefix:goal". Maven will automatically add the group identifiers | "org.apache.maven.plugins" and "org.codehaus.mojo" if these are not already contained in the list. |--> <pluginGroups> <!-- pluginGroup | Specifies a further group identifier to use for plugin lookup. <pluginGroup>com.your.plugins</pluginGroup> --> <pluginGroup>org.mortbay.jetty</pluginGroup> </pluginGroups>
http://www.xuebuyuan.com/1115208.html
- cat监控平台环境搭建
- CAT监控平台之装配篇
- CAT - 监控平台之装配篇
- Linux部署实时应用监控平台CAT
- 点评CAT搭建 分布式监控系统
- 搭建大众点评网CAT监控
- ELK 日志监控平台环境搭建及使用说明
- nagios监控平台搭建
- 邮件监控平台搭建
- DubboKeeper监控平台搭建
- 搭建nagios监控平台
- nagios 监控环境搭建
- nagios监控环境搭建
- cacti监控环境搭建
- jvm监控环境搭建
- 搭建Zabbix监控环境
- 【推荐】大众点评Java开发实时应用监控平台-CAT
- influxdb+grafana搭建业务监控平台前篇-相关环境搭建
- Android微信开发的应用签名
- 欢迎使用CSDN-markdown编辑器
- Log4j级别
- popupWindow弹框
- Https的安全性
- cat监控平台环境搭建
- css3 动画系列(一)
- 2017-04-04 在校训练T3 选美比赛 contest
- SDP协议介绍
- Recyclerview的一些个人理解与使用(二)实现一个简单的列表界面
- 第一章13
- 使用绘图API自定义组件
- zabbix + nexmo = 电话告警
- win10自带输入法突然变成了繁体