热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

AmbariHDP集群搭建文档

一、配置主机和节点机器之间SSH无密登录多台外网服务器配置时,需要在etchosts中把本机的IP地址设置为内网IP地址http:2d67df38.wiz02.com

一、配置主机和节点机器之间SSH无密登录

多台外网服务器配置时,需要在/etc/hosts中把本机的IP地址设置为内网IP地址
http://2d67df38.wiz02.com/share/s/0JpZYU2X7kl626aE730Q_Flq3daBjm08rAnl2oLpli2uMOfo
二、为每台主机关闭iptables,SELinux,启动ntpd服务
三、安装Mysql,JDK
查看linux发行版本
cat /etc/redhat-release
从网站 http://dev.mysql.com/downloads/repo/yum/ 下载对应版本yum资源
安装
yum -y install mysql57-community-release-el7-7.noarch.rpm
安装mysql数据库的服务器版本
yum -y install mysql-community-server
 
启动数据库
service   mysqld start
systemctl start  mysqld.service
 
获取初始密码
#######从mysql进程日志中获取root用户的初始密码:ra%yk7urCBIh
[root@typecodes ~]# grep "password" /var/log/mysqld.log
 修改root用户密码
mysql -u root -p
 ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';
 

这个其实与validate_password_policy的值有关。

validate_password_policy有以下取值:

Policy Tests Performed
0 or LOW Length
1 or MEDIUM Length; numeric, lowercase/uppercase, and special characters
2 or STRONG Length; numeric, lowercase/uppercase, and special characters; dictionary file
 
首先,修改validate_password_policy参数的值
set global validate_password_policy=0;
这样,判断密码的标准就基于密码的长度了。这个由validate_password_length参数来决定。
validate_password_length参数默认为8
set global validate_password_length=4;
 
安装JDK,配置环境变量

export JAVA_HOME=/usr/local/jdk1.8.0

export JRE_HOME=${JAVA_HOME}/jre

export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib

 

export PATH=${JAVA_HOME}/bin:$PATH

使环境变量立即生效
source ~/.bash_profile
四、集群服务器间配置时间同步
http://2d67df38.fromwiz.com/share/s/0JpZYU2X7kl626aE730Q_Flq2OyZYU3BDQcP2rnK4F3zASlT
五、安装Ambari
wget -P /etc/yum.repos.d/ http://public-repo-1.hortonworks.com/ambari/centos6/2.x/updates/2.0.1/ambari.repo
 
wget -P /etc/yum.repos.d/ http://public-repo-1.hortonworks.com/ambari/centos6/2.x/updates/2.2.2.0/ambari.repo
 
yum clean all
 
yum list|grep ambari
yum安装ambari服务端 
yum install ambari-server
 
安装完后进行设置
ambari-server setup
 
 
 到这一步需要安装mysql jar包
yum install mysql-connector-java*
 启动服务
 报错:
 解决方法:
grant all privileges on *.* to ambari@'localhost' identified by 'bigdata';
flush privileges;
 
 重新启动,报错:
创建数据库
create database ambari character set utf8;
 重新启动,报错:
  如果使用自己定义的数据库,必须在启动Ambari服务之前导入Ambari的sql脚本
用Ambari用户(上面设置的用户)登录mysql
mysql -u ambari -p
use ambari
source /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql
 启动成功
 日志无报错
 打开 http://localhost:8080
admin/admin
 登录系统操作后发现还是报错:
 21 Feb 2017 19:15:29,519  WARN [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0] StatementUtils:48 - Statement close FAILED.
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OPTION SQL_SELECT_LIMIT=DEFAULT' at line 1
原因:Ambari默认的 mysql jdbc 驱动不支持 5.6以上版本
解决方法:下载新的 mysql jdbc驱动
ln -s mysql-connector-java-5.1.40-bin.jar mysql-connector-java.jar
ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java.jar
 
配置主机时报错
Permanently added 'node1.hadoop' (ECDSA) to the list of known hosts
解决方法
在 master主机用户根目录的.ssh/ssh_config 文件中新增一行
UserKnownHostsFile ~/.ssh/known_hosts
 
继续报错
 解决方法:
修改主机名
vi /etc/sysconfig/network
 vim /etc/hosts
 hostname master.hadoop
 
或者直接 hostnamectl set-hostname 新主机名
 
 
 注意HOST名字要写全名
node2节点报错:
ERROR: Bootstrap of host node2.hadoop fails because previous action finished with non-zero exit code (255)
ERROR MESSAGE: tcgetattr: Invalid argument
Connection to node2.hadoop closed.

STDOUT: tput: unknown terminal "unknown"
('', None)
('', None)
登录到node2上手动启动agent
wget -nv http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.2.1.0/ambari.repo -O /etc/yum.repos.d/ambari.repo
 
yum repolist
 
yum install ambari-agent
 

vi /etc/ambari-agent/conf/ambari-agent.ini

[server]

hostname=

url_port=8440

secured_url_port=8441

 

ambari-agent start

 

看后台日志,报错

解决方案:
pip install flask -i  http://pypi.douban.com/simple  --trusted-host  pypi.douban.com
 
删除所有ambari* from /usr/lib/python2.6/site-packages,重新安装ambari-agent,杀死ambari进程,重新启动
rm - f / usr / lib / python2 . 6 / site - packages / ambari_commons
rm - rf / usr / lib / python2 . 6 / site - packages / resource_management
rm - rf / usr / lib / python2 . 6 / site - packages / ambari_jinja2
rm - rf / var / lib / ambari - agent /
rm - rf / usr / lib / ambari - agent /
yum remove ambari-agent
yum install ambari-agent
 
后面又报错:
 
 
 
  Error: Cannot retrieve repository metadata (repomd.xml) for repository: HDP-2.3. Please verify its path and try again
 
解决方法1:
(此方法未验证)

Resolved: The problem was related to proxy Authentication. So, I installed and configured CNTLM to access ISA Proxy Server on Centos 6.

Look at the article :

http://wingloon.com/2014/04/11/how-to-install-and-configure-cntlm-to-access-isa-server-on-centos-6-5/

1.Install and configure cntlm

2. configure yum to use through ISA Proxy

  • vi /etc/yum.conf

add a line:

proxy=http://127.0.0.1:3128/

  • vi .bash_profile

add :

export http_proxy=http://localhost:3128/

export https_proxy=${http_proxy}

export ftp_proxy=${http_proxy}

  • logoff root and login again
  • yum clean all
  • yum install XXXX

yum update, yum repolist or yum install now works fine

来源: https://community.hortonworks.com/questions/15506/error-cannot-retrieve-repository-metadata-repomdxm.html

 

解决方法2:
在对应报错服务器上的HDP.repo文件中添加一行   proxy = _none_
 

I have fixed it myself. For those who might face the same issue. This is what I did. Basically HDP.repo should be told to skip proxy server, but if you edit HDP.repo, Ambari wizard will overwrite it. So what is the workaround?. This is how you make HDP.repo skip the proxy. Just add the following lines to the yum.conf file for all the nodes. It worked for me. Hope this helps! :)

[HDP-2.4]

name=HDP-2.4

proxy = _none_

baseurl=http://item-70288/hdp/HDP/centos6/2.x/updates/2.4.0.0

enabled=1

gpgcheck=0

来源: https://community.hortonworks.com/questions/26872/forbidden-403-error-on-hdp-24-installation.html
继续安装,报错:
 解决方法1(本人测试无效,后来用方法2到节点服务器上手工安装):
在SERVER服务器上执行
vim /etc/ambari-server/conf/ambari.properties
 把标红值改大

解决方案: 1.手动安装yarn apt-get update apt-get install hadoop-2-4-.*-yarn

2.修改配置文件 Can be solved by setting the timeout (agent.package.install.task.timeout=1800) in /etc/ambari-server/conf/ambari.properties

注意: 在安装mapreduce,spark等软件包时,也可能出现类似的问题,请将timeout设置到合适的时间。或者根据错误提示,手动安装相应的软件包。

来源: https://jacobustczhi.gitbooks.io/ambari-ubuntu/chapter5.html
解决方法2:
手工安装
报错:there are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.
 
yum update
yum install yum-utils
yum-complete-transaction --cleanup-only
 
报错:
 版本不一致导致,可参考本文最后 ambari升级部分
 
后续安装hadoop各组件一般只会是yum超时错误,可手动到服务器上运行yum命令安装,或者下载相关包,制作本地yum源
 
解决不了报错信息,就手动到节点服务器安装agent
http://docs.hortonworks.com/HDPDocuments/Ambari-2.2.1.0/bk_ambari_reference_guide/content/_install_the_ambari_agents_manually.html
rh7
 
wget -nv http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.2.1.0/ambari.repo -O /etc/yum.repos.d/ambari.repo
 
yum repolist
 
vi /etc/ambari-agent/conf/ambari-agent.ini
将红框处修改为ambari-server主机名
 
ambari-agent start
 
 
ZOOKEEPER安装报错
解决方案:找到zookeeper配置文件,修改服务端配置个数,改为奇数个,
ambari上只需要删除一台节点的zookeeper服务
 
 
PS:在安装某些组件时候,会报配置参数找不到错误
如:
 
可执行如下命令来手动设置参数
/var/lib/ambari-server/resources/scripts/configs.sh -u admin -p admin set 127.0.0.1 bigdata  hive-site hive_server_host "node3.hadoop"
-u ambari系统登录名
-p ambari系统登录密码
bigdata是ambari集群名称
hive_server_host是报错的配置参数名
""内是要设置的配置参数值
 
附:
ambari升级
http://2d67df38.fromwiz.com/share/s/0JpZYU2X7kl626aE730Q_Flq3bDNPQ03b4rH2DzrHN2XmjXh
 

 

 


推荐阅读
  • 使用Vultr云服务器和Namesilo域名搭建个人网站
    本文详细介绍了如何通过Vultr云服务器和Namesilo域名搭建一个功能齐全的个人网站,包括购买、配置服务器以及绑定域名的具体步骤。文章还提供了详细的命令行操作指南,帮助读者顺利完成建站过程。 ... [详细]
  • 本文详细介绍如何使用Samba软件配置CIFS文件共享服务,涵盖安装、配置、权限管理及多用户挂载等关键步骤。通过具体示例和命令行操作,帮助读者快速搭建并优化Samba服务器。 ... [详细]
  • 优化ListView性能
    本文深入探讨了如何通过多种技术手段优化ListView的性能,包括视图复用、ViewHolder模式、分批加载数据、图片优化及内存管理等。这些方法能够显著提升应用的响应速度和用户体验。 ... [详细]
  • Explore a common issue encountered when implementing an OAuth 1.0a API, specifically the inability to encode null objects and how to resolve it. ... [详细]
  • 1:有如下一段程序:packagea.b.c;publicclassTest{privatestaticinti0;publicintgetNext(){return ... [详细]
  • 本文介绍了Java并发库中的阻塞队列(BlockingQueue)及其典型应用场景。通过具体实例,展示了如何利用LinkedBlockingQueue实现线程间高效、安全的数据传递,并结合线程池和原子类优化性能。 ... [详细]
  • 深入理解Cookie与Session会话管理
    本文详细介绍了如何通过HTTP响应和请求处理浏览器的Cookie信息,以及如何创建、设置和管理Cookie。同时探讨了会话跟踪技术中的Session机制,解释其原理及应用场景。 ... [详细]
  • 本文详细介绍了Java编程语言中的核心概念和常见面试问题,包括集合类、数据结构、线程处理、Java虚拟机(JVM)、HTTP协议以及Git操作等方面的内容。通过深入分析每个主题,帮助读者更好地理解Java的关键特性和最佳实践。 ... [详细]
  • 网络攻防实战:从HTTP到HTTPS的演变
    本文通过一系列日记记录了从发现漏洞到逐步加强安全措施的过程,探讨了如何应对网络攻击并最终实现全面的安全防护。 ... [详细]
  • 360SRC安全应急响应:从漏洞提交到修复的全过程
    本文详细介绍了360SRC平台处理一起关键安全事件的过程,涵盖从漏洞提交、验证、排查到最终修复的各个环节。通过这一案例,展示了360在安全应急响应方面的专业能力和严谨态度。 ... [详细]
  • 本文深入探讨了Linux系统中网卡绑定(bonding)的七种工作模式。网卡绑定技术通过将多个物理网卡组合成一个逻辑网卡,实现网络冗余、带宽聚合和负载均衡,在生产环境中广泛应用。文章详细介绍了每种模式的特点、适用场景及配置方法。 ... [详细]
  • 本文详细分析了Hive在启动过程中遇到的权限拒绝错误,并提供了多种解决方案,包括调整文件权限、用户组设置以及环境变量配置等。 ... [详细]
  • 本文详细探讨了HTTP 500内部服务器错误的成因、解决方案及其在Web开发中的影响。通过对具体案例的分析,帮助读者理解并解决此类问题。 ... [详细]
  • MySQL 数据库迁移指南:从本地到远程及磁盘间迁移
    本文详细介绍了如何在不同场景下进行 MySQL 数据库的迁移,包括从一个硬盘迁移到另一个硬盘、从一台计算机迁移到另一台计算机,以及解决迁移过程中可能遇到的问题。 ... [详细]
  • 本文详细记录了在银河麒麟操作系统和龙芯架构上使用 Qt 5.15.2 进行项目打包时遇到的问题及解决方案,特别关注于 linuxdeployqt 工具的应用。 ... [详细]
author-avatar
李瑶626
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有