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

  1. [root@nn .ssh]# cat /etc/hosts
  2. 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
  3. ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
  4. 172.28.3.40 nn nn.hadoop.plat
  5. 172.28.3.41 dn1 dn0.hadoop.plat
  6. 172.28.3.42 dn2 dn1.hadoop.plat
  7. 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 root@dn1  ssh-copy-id root@dn2 ssh-copy-id root@dn13

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

  1. [root@nn .ssh]# ifconfig
  2. eth0 Link encap:Ethernet HWaddr 00:1A:4A:C6:6B:A0
  3. inet addr:172.28.3.40 Bcast:172.28.7.255 Mask:255.255.248.0
  4. inet6 addr: fe80::21a:4aff:fec6:6ba0/64 Scope:Link
  5. UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
  6. RX packets:1064845 errors:0 dropped:0 overruns:0 frame:0
  7. TX packets:557212 errors:0 dropped:0 overruns:0 carrier:0
  8. collisions:0 txqueuelen:1000
  9. RX bytes:1578655986 (1.4 GiB) TX bytes:647178854 (617.1 MiB)
  10.  
  11. lo Link encap:Local Loopback
  12. inet addr:127.0.0.1 Mask:255.0.0.0
  13. inet6 addr: ::1/128 Scope:Host
  14. UP LOOPBACK RUNNING MTU:16436 Metric:1
  15. RX packets:103276 errors:0 dropped:0 overruns:0 frame:0
  16. TX packets:103276 errors:0 dropped:0 overruns:0 carrier:0
  17. collisions:0 txqueuelen:0
  18. RX bytes:58108687 (55.4 MiB) TX bytes:58108687 (55.4 MiB)
  19.  
  20. [root@nn .ssh]# cat /etc/hosts
  21. 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
  22. ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
  23. 172.28.3.40 nn nn.hadoop.plat
  24. 172.28.3.41 dn1 dn0.hadoop.plat
  25. 172.28.3.42 dn2 dn1.hadoop.plat
  26. 172.28.3.43 dn3 dn2.hadoop.plat
  27. [root@nn .ssh]# ssh dn1
  28. SIOCADDRT: File exists

3. 关闭iptables

chkconfig iptables off

/etc/init.d/iptables stop

4. 关闭seLinux

查看selinux状态:

[root@localhost ~]# /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:

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

6. 安装java,配置JAVA_HOME

  1. mkdir /usr/java
  2. cd /usr/java
  3. rz -be
  4. /usr/java/jdk1.7.0_75
  5. ln -s /usr/java/jdk1.7.0_75 /usr/java/default
  6.  
  7. vim /etc/profile
  8.  
  9. route add default gw 172.28.0.1
  10. export JAVA_HOME=/usr/java/default
  11. export PATH=$JAVA_HOME/bin:$PATH

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

7. 每台机器上安装ntpd

  1. rpm -aq | grep ntpd
  2. yum install ntpd
  3. chkconfig ntpd on
  4. service ntpd start

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

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

  1. rpm -qa | grep ssh
  2. yum install openssh-server
  3. service sshd restart
  4. chkconfig sshd on

确保openssl最新:

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

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

  1. # CentOS-Base.repo
  2. #
  3. # The mirror system uses the connecting IP address of the client and the
  4. # update status of each mirror to pick mirrors that are updated to and
  5. # geographically close to the client. You should use this for CentOS updates
  6. # unless you are manually picking other mirrors.
  7. #
  8. # If the mirrorlist= does not work for you, as a fall back you can try the
  9. # remarked out baseurl= line instead.
  10. #
  11. #
  12.  
  13. [base]
  14. name=CentOS-$releasever - Base - 163.com
  15. baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/
  16. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
  17. gpgcheck=1
  18. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
  19.  
  20. #released updates
  21. [updates]
  22. name=CentOS-$releasever - Updates - 163.com
  23. baseurl=http://mirrors.163.com/centos/$releasever/updates/$basearch/
  24. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
  25. gpgcheck=1
  26. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
  27.  
  28. #additional packages that may be useful
  29. [extras]
  30. name=CentOS-$releasever - Extras - 163.com
  31. baseurl=http://mirrors.163.com/centos/$releasever/extras/$basearch/
  32. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
  33. gpgcheck=1
  34. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
  35.  
  36. #additional packages that extend functionality of existing packages
  37. [centosplus]
  38. name=CentOS-$releasever - Plus - 163.com
  39. baseurl=http://mirrors.163.com/centos/$releasever/centosplus/$basearch/
  40. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
  41. gpgcheck=1
  42. enabled=0
  43. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
  44.  
  45. #contrib - packages by Centos Users
  46. [contrib]
  47. name=CentOS-$releasever - Contrib - 163.com
  48. baseurl=http://mirrors.163.com/centos/$releasever/contrib/$basearch/
  49. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
  50. gpgcheck=1
  51. enabled=0
  52. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

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

  1. [root@hdp159 yum.repos.d]# cat ambari.repo
  2. [Updates-ambari-2.0.1]
  3. name=ambari-2.0.1 - Updates
  4. baseurl=http://172.28.4.159/ambari-test/centos6
  5. gpgcheck=1
  6. gpgkey=http://172.28.4.159/ambari-test/centos6/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
  7. enabled=1
  8. priority=1
  9. [root@hdp159 yum.repos.d]#

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

  1. yum clean all
  2. yum repolist

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

  1. yum install --nogpgcheck ambari-server

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

  1. ambari-server setup -j /usr/java/default
  2. 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. 发现一个警告消息,在每一台机器上执行如下命令,消除警告:

  1. [root@dn3 yum.repos.d]# python /usr/lib/python2.6/site-packages/ambari_agent/HostCleanup.py --silent --skip=users
  2. INFO:HostCleanup:
  3. Killing pid's: ['']
  4.  
  5. INFO:HostCleanup:Deleting packages: ['']
  6.  
  7. INFO:HostCleanup:
  8. Deleting directories: ['']
  9. INFO:HostCleanup:Path doesn't exists:
  10. INFO:HostCleanup:
  11. Deleting additional directories: ['']
  12. INFO:HostCleanup:
  13. Deleting repo files: []
  14. INFO:HostCleanup:
  15. Erasing alternatives:{'symlink_list': [''], 'target_list': ['']}
  16.  
  17. INFO:HostCleanup:Path doesn't exists:
  18. INFO:HostCleanup:Clean-up completed. The output is at /var/lib/ambari-agent/data/hostcleanup.result

16. 分配slaves和clients:

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

查看总结信息:

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

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

  1. Hadoop记录-安装ambari hdp集群

    #!/bin/sh #配置用户sudo权限(参考/etc/sudoers文件,在/etc/sudoers.d/新建一个用户配置文件,注意要注销) #需要在/etc/sudoers末尾追加:sfapp ...

  2. Ambari HDP集群搭建文档

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

  3. Ambari HDP集群搭建全攻略

    世界上最快的捷径,就是脚踏实地,本文已收录[架构技术专栏]关注这个喜欢分享的地方. 最近因为工作上需要重新用Ambari搭了一套Hadoop集群,就把搭建的过程记录了下来,也希望给有同样需求的小伙伴们 ...

  4. 基于Ambari Server部署HDP集群实战案例

    基于Ambari Server部署HDP集群实战案例 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.部署Ambari Server端 博主推荐阅读: https://www.c ...

  5. 1、zookeeper集群安装

    前提准备3台centos7.0虚拟机 c7003:192.168.70.103 c7004:192.168.70.104 c7005:192.168.70.105 并在三台虚拟机上配置hosts为 1 ...

  6. 2 Hadoop集群安装部署准备

    2 Hadoop集群安装部署准备 集群安装前需要考虑的几点硬件选型--CPU.内存.磁盘.网卡等--什么配置?需要多少? 网络规划--1 GB? 10 GB?--网络拓扑? 操作系统选型及基础环境-- ...

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

    目录: 一.什么是kafka? 二.kafka的官方网站在哪里? 三.在哪里下载?需要哪些组件的支持? 四.如何安装? 五.FAQ 六.扩展阅读   一.什么是kafka? kafka是LinkedI ...

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

    博文作者:迦壹 博客地址:http://idoall.org/home.php?mod=space&uid=1&do=blog&id=547 转载声明:可以转载, 但必须以超链 ...

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

    转自:http://blog.fens.me/hadoop-zookeeper-intro/ 前言 ZooKeeper是Hadoop家族的一款高性能的分布式协作的产品.在单机中,系统协作大都是进程级的 ...

随机推荐

  1. hibernate和struts实现分页

    仓促把功能进行实现一下  类与类之间也没有进行MVC式分开  重要的是逻辑 记录一下 希望其中的些许代码逻辑对你有用 TUserDaoImpl---dao层的实现 package com.pers.h ...

  2. js 实现继承的6种方式(逐渐优化)

    <!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8&quo ...

  3. Struts2学习笔记一:工作流程与核心文件

    转载请注明原文地址:http://www.cnblogs.com/ygj0930/p/6807539.html  1:客户端发出请求到web服务器 2:请求经过一系列filter,最终到达Struts ...

  4. at java.lang.AbstractStringBuilder.toString

    04-18 14:40:12.615 1210-1210/com.tongyan.lanzhou.rv I/dalvikvm: "main" prio=5 tid=1 RUNNAB ...

  5. CentOS 6.4 安装 rabbitmq(3.6.15)

    安装废了一番周折,中间需要装一个socat,网上各种过时的地址. 无奈去socat官网,结果提供编译安装,编译安装完yum install rabbitmq的时候仍然提示缺少需要的依赖,烦,好在折腾两 ...

  6. 主成分分析PCA

    PCA(Principal Component Analysis)不仅仅是对高维数据进行降维,更重要的是经过降维去除了噪声,发现了数据中的模式. PCA把原先的n个特征用数目更少的m个特征取代,新特征 ...

  7. Git 经常使用命令合集

    ====== Git 经常使用命令合集 ====== === 1.Git 文档 ===     Git 中文文档观看地址:http://git.oschina.net/progit/      === ...

  8. 【DeepLearning】Exercise:Learning color features with Sparse Autoencoders

    Exercise:Learning color features with Sparse Autoencoders 习题链接:Exercise:Learning color features with ...

  9. php 执行命令函数

    /** Method to execute a command in the terminal Uses : 1. system 2. passthru 3. exec 4. shell_exec * ...

  10. 使用Beetle简单构建高性能Socket tcp应用

    beetle是基于c#编写的高性能Socket tcp组件,它基于SocketAsyncEventArgs的实现并提供了发送队列和接收队列的支持,可以根据情况灵活地设置1-N个发送队列和接收队列.除了 ...