参考文档
http://ambari.apache.org/
http://www.cnblogs.com/mephisto/p/4835386.html
注意几个地方:
1. 通过本地存储来安装是非常必要的
2. 需要关闭linux的transparent_hugepage,firewall,selinux
查看transparent_hugepage 状态
cat /sys/kernel/mm/transparent_hugepage/enabled
如果是always madvise [never] 说明关闭。如果是always 说明打开了
3. 主机名最好是 aba.testdomain.cn这种方式
4. 安装ambari的过程中,在注册好主机后,需要仔细查看警告。所有条件需要满足检测。
5. 使用官方的wordcount 程序来进行测试
先查找示例程序所在的jar文件
find / -name hadoop-mapreduce-examples
然后运行示例程序
hadoop jar /usr/hdp/2.3.0.0-2557/hadoop-mapreduce/hadoop-mapreduce-examples-2.7.1.2.3.0.0-2557.jar wordcount /tmp/input/word_test.txt /tmp/output/1007_01
或者通过yarn来运行:
yarn jar /usr/hdp/2.3.0.0-2557/hadoop-mapreduce/hadoop-mapreduce-examples-2.7.1.2.3.0.0-2557.jar wordcount /tmp/input/word_test.txt /tmp/output/1007_01
如果出现如下错误
Permission denied: user=root, access=WRITE, inode=”/user/root/.staging”:hdfs:hdfs:drwxr-xr-x
通过下面2个语句来增加root的home目录
[root@hd001 input]# hadoop fs -mkdir /user/root
[root@hd001 input]# hadoop fs -chown root:root /user/root
6.查看job的运行信息
http://192.168.1.151:19888/jobhistory
192.168.1.151 是指History Server
7. App Timeline Server 无法启动
进入App Timeline Server所在的服务器hd002.testcluster查看log
vim /var/log/hadoop-yarn/yarn/yarn-yarn-timelineserver-hd002.testcluster.log
发现错误 :
Class org.apache.hadoop.yarn.server.timeline.EntityGroupFSTimelineStore not found
解决方案:
https://docs.hortonworks.com/HDPDocuments/Ambari-2.2.0.0/bk_ambari_troubleshooting/content/_resolving_general_problems.html
Update the YARN configuration to use the LevelDB store:
* In Ambari Web, browse to Services > YARN > Configs.
* Filter for the yarn.timeline-service.store-class property and set to org.apache.hadoop.yarn.server.timeline.LeveldbTimelineStore value.
* Save the configuration change and restart YARN.
8.配置Ambari Metrics为分布式模式
默认安装时Ambari Metrics为embedded模式,这样收集的所有数据是存放在Collector节点的本地的,大量的Metrics数据会挤占大量的本地存储空间,改为分布式模式后Metrics数据会放置到HDFS上,所以通常这是安装Ambari后必备一个操作。具体的操作可以参考:
http://blog.youkuaiyun.com/bluishglc/article/details/48155265