cent os 6.5+ambari+HDP集群安装

1. 搭建一个测试集群,集群有4台机器,配置集群中每一台机器的/etc/hosts文件:

[[email protected] .ssh]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
172.28.3.40  nn  nn.hadoop.plat
172.28.3.41  dn1  dn0.hadoop.plat
172.28.3.42  dn2  dn1.hadoop.plat
172.28.3.43  dn3  dn2.hadoop.plat

2. 配置namenode到datanode ssh免密码登陆:

在nn上执行,ssh-keygen –t rsa

cd ~/.ssh

cat id_rsa.put >> authorized_keys

对集群中每一台data node执行:  ssh-copy-id [email protected]  ssh-copy-id [email protected] ssh-copy-id [email protected]

这样就可以保证,nn节点可以免密码登陆到dn1, dn2, dn3

[[email protected] .ssh]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:1A:4A:C6:6B:A0
          inet addr:172.28.3.40  Bcast:172.28.7.255  Mask:255.255.248.0
          inet6 addr: fe80::21a:4aff:fec6:6ba0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1064845 errors:0 dropped:0 overruns:0 frame:0
          TX packets:557212 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1578655986 (1.4 GiB)  TX bytes:647178854 (617.1 MiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:103276 errors:0 dropped:0 overruns:0 frame:0
          TX packets:103276 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:58108687 (55.4 MiB)  TX bytes:58108687 (55.4 MiB)

[[email protected] .ssh]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
172.28.3.40  nn  nn.hadoop.plat
172.28.3.41  dn1  dn0.hadoop.plat
172.28.3.42  dn2  dn1.hadoop.plat
172.28.3.43  dn3  dn2.hadoop.plat
[[email protected] .ssh]# ssh dn1
SIOCADDRT: File exists

3. 关闭iptables

chkconfig iptables off

/etc/init.d/iptables stop

4. 关闭seLinux

查看selinux状态:

[[email protected] ~]# /usr/sbin/sestatus –v

/usr/sbin/setenforce 0 #使SELinux工作模式变成permissive模式
/usr/sbin/setenforce 1 #使SELinux工作模式变成enforcing模式

这样就可以实时控制SELinux的启用和不启用了。

三个参数介绍介绍

  • enforcing — The SELinux security policy is enforced.

  • permissive — The SELinux system prints warnings but does not enforce policy.
  • disabled — SELinux is fully disabled. SELinux hooks are disengaged from the kernel and the pseudo-file system is unregistered.

永久关闭SELinux

编辑/etc/selinux/config,找到SELINUX 行修改成为:SELINUX=disabled:

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled

# SELINUXTYPE= can take one of these two values:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted

如果重启系统,就会发现SELinux的状态变成disabled

5. 关闭linux内核huge_page:

Add the following lines in /etc/rc.local and reboot the server:
echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled
echo never > /sys/kernel/mm/redhat_transparent_hugepage/defrag

6. 安装java,配置JAVA_HOME

mkdir /usr/java
cd /usr/java
rz -be
/usr/java/jdk1.7.0_75
ln -s /usr/java/jdk1.7.0_75 /usr/java/default

vim /etc/profile

route add default gw 172.28.0.1
export JAVA_HOME=/usr/java/default
export PATH=$JAVA_HOME/bin:$PATH

编辑好/etc/profile,执行source /etc/profile使配置生效,保证每一台机器上的java版本都是一致的,并且JAVA_HOME环境变量是有效的:

7. 每台机器上安装ntpd

rpm -aq | grep ntpd
yum install ntpd
chkconfig ntpd on
service ntpd start

确保每台机器的ntpd服务都处于运行状态:

8. 确保机器上安装了openssh-server,并且升级openssl到最新:

rpm -qa | grep ssh
yum install openssh-server
service sshd restart
chkconfig sshd on

确保openssl最新:

yum install openssl-devel-1.0.1e-42.el6.x86_64

9. yum源确保可以用,本次安装采用了163的yum源,先将/etc/yum.repos.d/中,所有的文件都删掉,然后新建文件CentOS6-Base-163.repo,填入如下内容:

# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever - Base - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#released updates
[updates]
name=CentOS-$releasever - Updates - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/contrib/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

配置ambari的yum源,本配置源是部署在本地局域网中的一台apache服务器上的:

[[email protected] yum.repos.d]# cat ambari.repo
[Updates-ambari-2.0.1]
name=ambari-2.0.1 - Updates
baseurl=http://172.28.4.159/ambari-test/centos6
gpgcheck=1
gpgkey=http://172.28.4.159/ambari-test/centos6/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
[[email protected] yum.repos.d]#

将yum源配置好好了后,执行如下命令:

yum clean all
yum repolist

10. 在nn机器上,安装ambari-servier,执行如下命令,之所以加—nogpgcheck参数,是因为此处安装的是公司修改后的ambari,如果是安装原生的ambari,不用加该选项:

yum install --nogpgcheck ambari-server

11.配置和启动ambari-server, setup –j 配置ambari-server要使用的java环境:

ambari-server setup -j /usr/java/default
ambari-server start

12. 在浏览器中,输入nn:8080进入ambari的登陆页面,用户名和密码都是admin:

13. 配置HDP的redhat6的baseURL,此处使用的是本地局域网中的HDP安装源:

http://172.28.4.159/HDP2.2.6/HDP/centos6/2.x/updates/2.2.6.0/

http://172.28.4.159/HDP2.2.6/HDP-UTILS-1.1.0.20/repos/centos6/

14. 将nn节点下,/root/.ssh/id_rsa文件上传到ambari中,配置好Target Hosts:

15. 发现一个警告消息,在每一台机器上执行如下命令,消除警告:

[[email protected] yum.repos.d]# python /usr/lib/python2.6/site-packages/ambari_agent/HostCleanup.py --silent --skip=users
INFO:HostCleanup:
Killing pid‘s: [‘‘]

INFO:HostCleanup:Deleting packages: [‘‘]

INFO:HostCleanup:
Deleting directories: [‘‘]
INFO:HostCleanup:Path doesn‘t exists:
INFO:HostCleanup:
Deleting additional directories: [‘‘]
INFO:HostCleanup:
Deleting repo files: []
INFO:HostCleanup:
Erasing alternatives:{‘symlink_list‘: [‘‘], ‘target_list‘: [‘‘]}

INFO:HostCleanup:Path doesn‘t exists:
INFO:HostCleanup:Clean-up completed. The output is at /var/lib/ambari-agent/data/hostcleanup.result

16. 分配slaves和clients:

设置好,hive和oozie数据库的用户名和密码:

查看总结信息:

17. 进入安装流程,最后安装成功:

时间: 2024-10-20 04:04:35

cent os 6.5+ambari+HDP集群安装的相关文章

Ambari HDP集群搭建文档_zhoujp

一.配置主机和节点机器之间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.mysq

(转)ZooKeeper伪分布式集群安装及使用

转自:http://blog.fens.me/hadoop-zookeeper-intro/ 前言 ZooKeeper是Hadoop家族的一款高性能的分布式协作的产品.在单机中,系统协作大都是进程级的操作.分布式系统中,服务协作都是跨服务器才能完成的.在ZooKeeper之前,我们对于协作服务大都使用消息中间件,随着分布式系统的普及,用消息中间件完成协作,会有大量的程序开发.ZooKeeper直接面向于分布式系统,可以减少我们自己的开发,帮助我们更好完成分布式系统的数据管理问题. 目录 zook

Mysql上的RAC:Percona XtraDB Cluster负载均衡集群安装部署手册

 Percona XtraDB Cluster安装部署手册 引言 编写目的 编写此文档,供PerconaXtraDB Cluster部署时使用. 预期读者 系统维护人员及实施人员. 编制依据及参考资料 目标 通过阅读该手册,让读者明确PerconaXtraDB Cluster的安装.配置和维护情况,为后续数据库运维工作提供指导. 应用部署方案 环境准备 服务器列表 序号 IP 用途 HOSTNAME 操作系统 1 192.168.0.7 Percona XtraDB Cluster RedHat

mesos 集群安装部署zookeeper(2)

三:集群安装配置 ############################################################## 配置zookeeper集群    (172.16.7.12~13 执行) ############################################################### 1:部署环境介绍: 服务器IP地址主机名安装服务 172.16.7.12ctn-7-12.ptmind.com zookeeper   myid=1 17

ubuntu12.04+kafka2.9.2+zookeeper3.4.5的分布式集群安装和demo(java api)测试

博文作者:迦壹 博客地址:http://idoall.org/home.php?mod=space&uid=1&do=blog&id=547 转载声明:可以转载, 但必须以超链接形式标明文章原始出处和作者信息及版权声明,谢谢合作! --------------------------------------- 目录: 一.什么是kafka? 二.kafka的官方网站在哪里? 三.在哪里下载?需要哪些组件的支持? 四.如何安装? 五.FAQ 六.扩展阅读 一.什么是kafka? ka

kafka2.9.2的分布式集群安装和demo(java api)测试

目录: 一.什么是kafka? 二.kafka的官方网站在哪里? 三.在哪里下载?需要哪些组件的支持? 四.如何安装? 五.FAQ 六.扩展阅读   一.什么是kafka? kafka是LinkedIn开发并开源的一个分布式MQ系统,现在是Apache的一个孵化项目.在它的主页描述kafka为一个高吞吐量的分布式(能将消息分散到不同的节点上)MQ.Kafka仅仅由7000行Scala编写,据了解,Kafka每秒可以生产约25万消息(50 MB),每秒处理55万消息(110 MB). kafka目

ZooKeeper伪分布式集群安装及使用

前言 ZooKeeper是Hadoop家族的一款高性能的分布式协作的产品.在单机中,系统协作大都是进程级的操作.分布式系统中,服务协作都是跨服务器才能完成的.在ZooKeeper之前,我们对于协作服务大都使用消息中间件,随着分布式系统的普及,用消息中间件完成协作,会有大量的程序开发.ZooKeeper直接面向于分布式系统,可以减少我们自己的开发,帮助我们更好完成分布式系统的数据管理问题. 目录 zookeeper介绍 zookeeper单节点安装 zookeeper伪分布式集群安装 zookee

Centos7.4 kafka集群安装与kafka-eagle1.3.9的安装

Centos7.4 kafka集群安装与kafka-eagle1.3.9的安装 集群规划: hostname Zookeeper Kafka kafka-eagle kafka01 √ √ √ kafka02 √ √ kafka03 √ √ 准备工作: 网络配置 vim /etc/sysconfig/network-scripts/ifcfg-ens33 # kafka01 TYPE=Ethernet PROXY_METHOD=none BROWSER_ONLY=no BOOTPROTO=sta

“挖掘机”升级路 一篇(03)--HBase集群安装中的收获

粗略算算,从上周五到这周二,折腾Hadoop已经三天了.这三天我是过得诚惶诚恐,作为一个学徒,老大虽然没有说啥,但是我恨不得立马完成这些基本的部署工作,感觉拖了好久好久.简单的总结一下,第一天折腾Hadoop单机和伪分布式的安装,第二天在折腾Hive的安装,以失败告终,第三天折腾HBase的集群安装,在主节点上安装成功. 也就来具体的谈谈今天的收获,今天的参考资料主要是这么两篇1.分布式实时日志系统(四) 环境搭建之centos 6.4下hbase 1.0.1 分布式集群搭建(我FQ看的,不知道