使用ambari搭建Hadoop平台
1.操作系统 CentoOS Server with GUI(有GUI,有浏览器*ambari基于浏览器*推荐latest stable version)
2.分区 默认 + /hadoop
3.网络设置:内网IP,外网IP,自动网络连接
4.hostname设置:
/etc/sysconfig/network: NETWORKING=yes
HOSTNAME=master/slave
/etc/hosts:192.168.200.10 master10
192.168.200.11 slave11
192.168.200.12 slave12
/etc/hostname:master10/slave11
logout----------->重新登录root
5.检查软件:which yum 等
6.检查jdk,卸载openjdk,安装oracle jdk 1.8+
yum remove *-openjdk-*
下载oracle jdk 1.8.0_77+<用了_101:jdk-8u101-linux-x64.tar.gz>
/etc/profile 环境变量
7.数据库会自动安装,所以未提前安装
8.ulimit -Sn
ulimit -Hn
如果<10000 ulimit -n 10000+
9.ssh配置:
master下:ssh-keygen
cat id_rsa.pub >> authorized_keys
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
slave下建立~/.ssh文件夹
scp </.ssh下的id_rsa.pub和authorized_keys【如果slave想无密码访问master,则id_rsa也要拷贝】> root@<slave>:~/.ssh/
slave下: chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
10.时间同步
1. NTP时钟同步方式说明
NTP在linux下有两种时钟同步方式,分别为直接同步和平滑同步:
直接同步
使用ntpdate命令进行同步,直接进行时间变更。如果服务器上存在一个12点运行的任务,当前服务器时间是13点,但标准时间时11点,使用此命令可能会造成任务重复执行。因此使用ntpdate同步可能会引发风 险,因此该命令也多用于配置时钟同步服务时第一次同步时间时使用。
平滑同步
使用ntpd进行时钟同步,可以保证一个时间不经历两次,它每次同步时间的偏移量不会太陡,是慢慢来的,这正因为这样,ntpd平滑同步可能耗费的时间比较长。
标准时钟同步服务
http://www.pool.ntp.org/zone/cn网站包含全球的标准时间同步服务,也包括对中国时间的同步,对应的URL为cn.pool.ntp.org,在其中也描述了ntp配置文件中的建议写法:
server 1.cn.pool.ntp.org
server 3.asia.pool.ntp.org
server 2.asia.pool.ntp.org
2. 环境情况
准备四台电脑,分别为:
IP 用途
192.168.11.212 ntpd服务器,用于与外部公共ntpd同步标准时间
172.16.248.129 ntpd客户端,用于与ntpd同步时间
172.16.248.130 ntpd客户端,用于与ntpd同步时间
172,16,248.131 ntpd客户端,用于与ntpd同步时间
3. 检查服务是否安装
使用rpm检查ntp包是否安装
[root@localhost kevin]# rpm -q ntp
ntp-4.2.6p5-19.el7.CentOS.3.x86_64
如果已经安装则略过此步,否则使用yum进行安装,并设置系统开机自动启动并启动服务
[root@localhost kevin]# yum -y install ntp
[root@localhost kevin]# systemctl enable ntpd
[root@localhost kevin]# systemctl start ntpd
4. 设置ntp服务器: 192.168.11.212
配置前先使用命令:ntpdate -u cn.pool.ntp.org,同步服务器
修改/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 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 ::1
# Hosts on local network are less restricted.
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
restrict 172.16.248.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 0.centos.pool.ntp.org iburst
server 2.cn.pool.ntp.org
server 1.asia.pool.ntp.org
server 2.asia.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
# 允许上层时间服务器主动修改本机时间
restrict 2.cn.pool.ntp.org nomodify notrap noquery
restrict 1.asia.pool.ntp.org nomodify notrap noquery
restrict 2.asia.pool.ntp.org nomodify notrap noquery
server 127.0.0.1 # local clock
fudge 127.0.0.1 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
# Disable the monitoring facility to prevent amplification attacks using ntpdc
# monlist command when default restrict does not include the noquery flag. See
# CVE-2013-5211 for more details.
# Note: Monitoring will not be disabled with the limited restriction flag.
disable monitor
修改完成后重启ntpd服务systemctl restart ntpd
使用ntpq -p 查看网络中的NTP服务器,同时显示客户端和每个服务器的关系
使用ntpstat 命令查看时间同步状态,这个一般需要5-10分钟后才能成功连接和同步。所以,服务器启动后需要稍等下:
刚启动的时候,一般是:
# ntpstat
unsynchronised
time server re-starting
polling server every 64 s
连接并同步后:
# ntpstat
synchronised to NTP server (202.112.10.36) at stratum 3
time correct to within 275 ms
polling server every 256 s
5. 设置ntp客户端: 172.16.248.129|130|131
配置前先使用命令:ntpdate -u cn.pool.ntp.org,同步服务器
安装ntp服务并设置为自动启动,和前面的设置方式相同。然后编辑/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 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 ::1
# Hosts on local network are less restricted.
#restrict 192.168.1.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 0.centos.pool.ntp.org iburst
server 172.16.248.1
restrict 172.16.248.1 nomodify notrap noquery
server 127.0.0.1
fudge 127.0.0.1 stratum 10
#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
# 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
# Disable the monitoring facility to prevent amplification attacks using ntpdc
# monlist command when default restrict does not include the noquery flag. See
# CVE-2013-5211 for more details.
# Note: Monitoring will not be disabled with the limited restriction flag.
disable monitor
重启ntpd服务
#systemctl restart ntpd
启动后,查看同步情况
# ntpq -p
# ntpstat
*******注意这些坑*********
*******注意这些坑*********
*******注意这些坑*********
1.同步不了,可能是因为时间差距太大,而且这个能忍受的差距可能要比想象的小得多,所以才需要ntpdate;
2.配置不需要改动,有错误提示(127.0.0.1)也不影响,问题一般出在网络上;
3.多重启几次;
11.DNS配置
1.hostname配置前面已完成
2.防火墙(iptables) systemctl disable firewalld
service stop firewalld.service
systemctl status firewalld
chkconfig --list
3.selinux
setenforce 0
/etc/selinux/config<<selinux=disabled //****************重启后输入setenforce、getenforce才会出现“selinux is disabled" 的提示
sestatus -v //检查是否关闭成功
4.echo umask 0022 >> /etc/profile //*******用于配置新建文件和文件夹的默认权限(755)
12.配置yum仓库
1.yum install httpd
安装: httpd及依赖apr apr-util http-tools mailcap
systemctl start httpd
报错:kill:cannot find process "",程序似乎在kill一个不存在的进程,可能跟默认配置有关,未研究,重启解决
mkdir -p /var/www/html
2.下载tar文件:ambari、hdp2.5及对应的repo文件和gpgkey文件
3.解压到apache http server根目录ambari:/var/www/html hdp/hdputil:/var/www/html/hdp,并从网页验证是否安装成功:http://master10/AMBARI-2.4.1.0/centos7 http://master10/...
4.修改repo文件并移动到/etc/yum.repo.d/
5.yum repolist
13.ambari server安装
yum install ambari-server <前面配置完成后此时是从本地库安装> ambari-server /dependencies:postgresql/postgresql-libs/postgresql-server
ambari-server setup /用于安装配置ambari server的数据库、JDK、进程用户。=============》》1.选择用户:直接回车,使用默认root;2.选择jdk:3custom-->$JAVA_HOME;4.默认postgreSQL用户名和密码:【ambari/bigdata】
14.ambari Server 使用
ambari-server start
ambari-server status
ambari-server stop
***********与以往不同,此次并未在三台主机上分别安装ambari-agent************
15.安装HDP
1.选择服务时:tez和slider与yarn有关,依赖安装;smartsense作为日志很重要,被推荐安装;
2.分配masters
3.分配clients
4.hive,smartsense和ambari metrics的密码设为windey,用户名分别为hive admin admin
16.安装vncserver
使用ambari搭建Hadoop平台的更多相关文章
- 大数据Hadoop学习之搭建hadoop平台(2.2)
关于大数据,一看就懂,一懂就懵. 一.概述 本文介绍如何搭建hadoop分布式集群环境,前面文章已经介绍了如何搭建hadoop单机环境和伪分布式环境,如需要,请参看:大数据Hadoop学习之搭建had ...
- 基于ambari搭建hadoop生态圈大数据组件
Ambari介绍1Apache Ambari是一种基于Web的工具,支持Apache Hadoop集群的供应.管理和监控.Ambari已支持大多数Hadoop组件,包括HDFS.MapReduce.H ...
- 大数据Hadoop学习之搭建Hadoop平台(2.1)
关于大数据,一看就懂,一懂就懵. 一.简介 Hadoop的平台搭建,设置为三种搭建方式,第一种是"单节点安装",这种安装方式最为简单,但是并没有展示出Hadoop的技术优势,适合 ...
- Windows 10 搭建Hadoop平台
一.环境配置 JDK:1.8. Hadoop下载地址(我选择的是2.7.6版本):https://mirrors.tuna.tsinghua.edu.cn/apache/hadoop/common/ ...
- ubuntu下搭建hadoop平台
终于把单击模式跟伪分布式模式搭建起来了,记录于此. 1.SSH无密码验证配置 因为伪分布模式下DataNode和NameNode均是本身,所以必须配置SSH localhost的无密码验证. 第一步, ...
- 搭建Hadoop平台(新手入门)
刚刚大学毕业,接触大数据有一年的时间了,把自己的一些学习笔记分享给大家,希望同热爱大数据的伙伴们一起学习,成长! 资料准备: Hadoop-2.7.1下载:http://pan.baidu.com/s ...
- Ambari搭建hadoop错误记录
1.ResourceManager启动失败 错误如下 2019-03-24 19:57:00,607 - Error while executing command 'start': Tracebac ...
- hadoop平台搭建
前言 这是小的第一次搭建hadoop平台,写下这篇博客有以下几个目的(ps:本博只记录在linux系统下搭建hadoop的步骤,如果需要了解在其他平台上搭建hadoop的步骤,还请移步): 1.希望大 ...
- Ambari——大数据平台的搭建利器之进阶篇
前言 本文适合已经初步了解 Ambari 的读者.对 Ambari 的基础知识,以及 Ambari 的安装步骤还不清楚的读者,可以先阅读基础篇文章<Ambari——大数据平台的搭建利器>. ...
随机推荐
- ubuntu: qemu+gdb 调试linux kernel 学习笔记
声明: 本笔记内容并非本人原创,90%来自网络资料的整合.同时,由于自己是刚刚接触qemu & gdbserver remote debug,本文也就算不得教程,仅供有缘人参考而已. ---- ...
- Hex-Rays Decompiler Tips and tricks Volatile memory
https://www.hex-rays.com/products/decompiler/manual/tricks.shtml First of all, read the troubleshoot ...
- Google JavaScript 语言规范
变量 ▶ 声明变量必须加上 var 关键字. 常量 ▶ 常量的形式如: NAMES_LIKE_THIS, 即使用大写字符, 并用下划线分隔. 你也可用 @const 标记来指明它是一个常量. 但请 ...
- android 根据SD卡中图片路径读取并显示SD中的图片——源代码
package com.guo; import java.io.File; import android.app.Activity; import android.graphics.Bitmap; i ...
- linux tar.gz zip 解压缩 压缩命令
http://apps.hi.baidu.com/share/detail/37384818 download ADT link http://dl.google.com/android/ADT-0. ...
- BZOJ 3930: [CQOI2015]选数 递推
3930: [CQOI2015]选数 Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://www.lydsy.com/JudgeOnline/pro ...
- C#操作XML的完整例子——XmlDocument篇
这是一个用c#控制台程序下, 用XmlDocument 进行XML操作的的例子,包含了查询.增加.修改.删除.保存的基本操作.较完整的描述了一个XML的整个操作流程.适合刚入门.net XML操作的 ...
- C语言阶乘和求闰年
#include<stdio.h> void main(){ int i,a,s=1; scanf("%d",&a); for(i=1;i<=a;i++) ...
- js实现按回车自行提交
<script type="text/javascript"> document.onkeydown = function (e) { var theEvent = w ...
- BackTrack5 (BT5)无线password破解教程之WPA/WPA2-PSK型无线password破解
昨天公布了BackTrack5 (BT5)无线weppassword破解教程之minidwep-gtk破解法一文,对BT5下破解wep无线password的简单方法做了介绍,今天奶牛为朋友们介绍下怎样 ...