1 下载 wget http://mirror.bit.edu.cn/apache/incubator/chukwa/chukwa-0.5.0/chukwa-incubating-0.5.0.tar.gz
2 解压 tar -zxvf chukwa-incubating-0.5.0.tar.gz
3设置环境变量
export CHUKWA_HOME=/home/hadoop/chukwa-incubating-0.5.0
export CHUKWA_CONF_DIR=/home/hadoop/chukwa-incubating-0.5.0/confexport PATH=$PATH:$CHUKWA_HOME/bin
4 copy文件
cp /home/hadoop/chukwa-incubating-0.5.0/etc/chukwa/hadoop-metrics.properties /home/hadoop/hadoop-1.1.0/conf
cp /home/hadoop/chukwa-incubating-0.5.0/share/chukwa/chukwa-0.5.0-client.jar /home/hadoop/hadoop-1.1.0/share/hadoop/lib
cp /home/hadoop/chukwa-incubating-0.5.0/share/chukwa/lib/json-simple-1.1.jar /home/hadoop/hadoop-1.1.0/share/hadoop/lib
cp chukwa-0.5.0.jar $HADOOP_HOME/lib
cp /home/hadoop/chukwa-incubating-0.5.0/share/chukwa/chukwa-0.5.0-client.jar /home/hadoop/hadoop-1.1.0/lib
修改 HADOOP_CONF_DIR/log4j.properties, 用 SocketAppender: 替换 DRFA appender 如下:
log4j.appender.DRFA=org.apache.log4j.net.SocketAppender
log4j.appender.DRFA.RemoteHost=localhost
log4j.appender.DRFA.Port=9096
log4j.appender.DRFA.layout=org.apache.log4j.PatternLayout
log4j.appender.DRFA.layout.ConversionPattern=%d{ISO8601} %p %c: %m%n
保存文件
修改
/home/hadoop/chukwa-incubating-0.5.0/etc/chukwa/chuwka-env.sh
export HADOOP_HOME=/home/hadoop/hadoop-1.1.0
export JAVA_HOME=/home/hadoop/jdk1.6.0_13
export HADOOP_CONF_DIR=/home/hadoop/hadoop-1.1.0/conf
export HBASE_HOME=/home/hadoop/hbase-0.94.2
export HBASE_CONF_DIR=/home/hadoop/hbase-0.94.2/conf
修改CHUKWA_HOME/etc/chukwa/collectors
可以启动一个或者多个collector
格式:
http://ip:port
或者ip (默认端口8080)
CHUKWA_HOME/etc/chukwa/agents
每个hadoop节点需要启动一个agent
格式:
http://ip:port
或者ip (默认端口9093)
PS:chukwa collector默认在8080端口监听。
agent默认在9093端口监听
重启你的 Hadoop Cluster.
6保证 hbase安装
hbase shell < $CHUKWA_HOME/etc/chukwa/hbase.schema
7保证 pig 安装
配置
export PIG_CLASSPATH=$HADOOP_CONF_DIR:$HBASE_CONF_DIR
export HBASE_CONF_DIR=/home/hadoop/hbase-0.94.2/conf
export HBASE_HOME=/home/hadoop/hbase-0.94.2
export PIG_INSATLL=/home/hadoop/pig-0.10.0
export PATH=$PATH:$PIG_INSATLL/bin
export PIG_HADOOP_VERSION=100
export PIG_CLASSPATH=$HADOOP_HOME/conf/
export PIG_PATH=/home/hadoop/pig-0.10.0
执行脚本
jar cf $CHUKWA_HOME/hbase-env.jar $HBASE_CONF_DIR
pig -Dpig.additional.jars=${HBASE_HOME}/hbase-0.94.2.jar:${HBASE_HOME}/lib/zookeeper-3.4.3.jar:${PIG_PATH}/pig-0.10.0.jar:${CHUKWA_HOME}/hbase-env.jar /home/hadoop/chukwa-incubating-0.5.0/share/chukwa/script/pig/ClusterSummary.pig
8 运行 collector
bin/chukwa collector
运行agent
bin/chukwa agent
或者在单点启动所有节点
sbin/start-agents.shsbin/start-collectors.sh
9 验证是否成功
telnet 9096 ()
bin/chukwa hicc
登陆admin/admin
错误检查:日志在 /tmp/chukwa/log下
常见问题:
1 版本不一致问题,无法写入hbase
HBaseWriter - java.lang.IllegalArgumentException: Not a host:port pair:
解决方案:
chukwa hbase版本不对
把hbase-*.jar 替换 到chukwa /share/chukwa/lib和hicc.war里面的WEB-INF/lib下。
2 WidgetBean - java.lang.NullPointerException
解决方案:hdfs://...:9000/chukwa/hicc/widgets 下有disabled删除即可
3
org.apache.jasper.compiler.PageInfo<init> 方法找不到
jasper-compiler-5.5.23.jar
jasper-runtime-5.5.12.jar
用上述版本替换到hicc.war中即可