设为首页 收藏本站
查看: 1099|回复: 0

[经验分享] Hitune对hadoop性能分析

[复制链接]

尚未签到

发表于 2015-7-14 08:36:29 | 显示全部楼层 |阅读模式
  本文档前提在hadoop已成功安装,hadoop安装见http://www.iyunv.com/hequn/articles/3438301.html

一、安装ntp
  1.各个节点进行源安装,[iyunv@Master Hadoop]#yum install ntp,我这个系统安装好后就安装好了。
  2.对Master节点/etc/ntp.conf进行配置



# For more information about this file, see the man pages
# ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).
driftfile /var/lib/ntp/drift
# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
# Permit all access over the loopback interface.  This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 127.0.0.1
restrict -6 ::1
# Hosts on local network are less restricted.
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
restrict 192.168.178.0 mask 255.255.255.0 nomodify notrap
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server 210.72.145.44
server 0.centos.pool.ntp.org
server 1.centos.pool.ntp.org
server 2.centos.pool.ntp.org
#broadcast 192.168.1.255 autokey        # broadcast server
#broadcastclient                        # broadcast client
#broadcast 224.0.1.1 autokey            # multicast server
#multicastclient 224.0.1.1              # multicast client
#manycastserver 239.255.254.254         # manycast server
#manycastclient 239.255.254.254 autokey # manycast client
# Undisciplined Local Clock. This is a fake driver intended for backup
# and when no outside source of synchronized time is available.
#这个是说如果外地时间同步失败,则用本地同步,这个必须要填上,防止断网的时候影响时间同步
server  127.127.1.0     # local clock
fudge   127.127.1.0 stratum 10
# Enable public key cryptography.
#crypto
includefile /etc/ntp/crypto/pw
# Key file containing the keys and key identifiers used when operating
# with symmetric key cryptography.
keys /etc/ntp/keys
# Specify the key identifiers which are trusted.
#trustedkey 4 8 42
# Specify the key identifier to use with the ntpdc utility.
#requestkey 8
# Specify the key identifier to use with the ntpq utility.
#controlkey 8
# Enable writing of statistics records.
#statistics clockstats cryptostats loopstats peerstats

  3.Master节点上,运行ntp, [iyunv@Master Hadoop]#service ntpd start/stop/restart
  4.Master节点上查看ntp服务器有无和上层连通[iyunv@Master Hadoop]#ntpstat  一开始会unsynchronised,同步上可能需要花5分钟的时间,变为synchronised。
  5.Slave节点上进行同步,[iyunv@Salve1 conf]# ntpdate 192.168.178.92
  6.第5步只是单次同步,如果要每分钟slave自动与master进行同步,需要修改每个slave节点上的/etc/crontab文件,在末尾加上一行:
  * * * * * root ntpdate 192.168.1.5 && hwclock -w

二、在集群的每个节点上安装sysstat
  下载sysstat (version 9.0.x)。

三、安装chukwa
  1.下载chukwa0.4.0到Master节点上,并解压。先不要把chukwa分发到其他机子上,等配置好了再用scp命令分发到其他机子上。
  安装文档(1)http://blog.iyunv.com/jostey/article/details/7068322 安装步骤主要参考此文档,下面对安装步骤的细节和遇到的一些问题重点说明下。
  安装如遇到“can not find hadoop-*-core.jar exists in /usr/hadoop”问题,把原先/usr/hadoop下的hadoop-core-1.1.2.jar改成hadoop-1.1.2-core.jar,并通过scp命令传给每个slave节点。
  agents测试,启动agents:[hadoop@Master bin]$ /usr/chukwa-0.4.0/bin/start-all.sh此时应该会在各个节点上通过jps可以看到有一个进程叫做ChukwaAgent.也可以在win7下telnet
DSC0000.jpg
  以下显示表示agent运行正常
DSC0001.jpg
  启动如遇到““Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/configuration/Configuration”的异常,说明缺少了commons组件,把 HADOOP_HOME/lib下的commons-configuration-1.6.jar拷贝到$CHUKWA_HOME/lib下。
  2.关闭agents。假如关闭不了ChukwaAgent进程可以修改$CHUKWA_HOME/bin/chukwa文件,找到关键字kill 然后将后面的数值改成kill -9。刚改完貌似不能起效,要把一个个agent 手动kill后,重新启动agent,再关闭就可以生效了。
  3.安装mysql. 从mysql官网上下载mysql,http://dev.mysql.com/downloads/mysql/5.1.html#downloads这个网上可以下载到mysql-5.6.3-m6-linux2.6-x86_64.tar.gz
  安装的时候要特别注意,确保之前通过yum或者apt-get安装的被卸载,而且删除残存的文件,如/etc/my.cnf文件和/etc/mysql目录。我这里出现“[mysql]ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) ”这个错误就是没删除/etc/my.cnf文件
  4.启动hicc后,登陆要用户名和密码,都是admin admin。登陆可能遇到"Error in loading dashboard"。我按照http://chukwa.apache.org/docs/r0.4.0/admin.html#Installing+Chukwa 这里面Set Up HICC的方法,CHUKWA_HOME/opt下加了apache-tomcat,并把CHUKWA_HOME/webapps/hicc.war拷到apache-tomcat-6.0.18/webapps下。注意我这里是CHUKWA_HOME/webapps/hicc.war,不是CHUKWA_HOME/hicc.war。这样进入hicc就没有"Error in loading dashboard"错误了.
  5.进入hicc后“no data avalilable”。这个错误貌似是数据没有收集成功,或者是没有成功导入。
  6.出现“java.lang.ClassNotFoundException: org.codehaus.jackson.map.JsonMappingException”异常。将hadoop lib下的 =jackson-core-asl.jar 和 jackson-mapper-asl.jar拷贝到chukwa lib下
  
  6.关闭的过程 ./stop-data-processors.sh  ->  ./stop-agents.sh  ->  stop-all.sh
  7.最后,下次开启的顺序:启动hadoop  ->  启动collector  ->  启动agents  ->  start-data-processors  ->  安全模式启动mysql  ->  dbAdmin.sh(启动进程将数据从hdfs上放到mysql中) ->  开启hicc

  
  hicc貌似会显示不出mysql里的内容,老是no data avaliable.据说是bug...以后有时间再试试hbase的方法....
  to be continued
  

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-86420-1-1.html 上篇帖子: Hadoop初体验——问题总结 下篇帖子: hadoop的调试
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表