`

超详细hadoop集群服务器安装配置教程

阅读更多

 

虚拟机以及Linux系统安装在之前的两篇分享中已经详细的介绍了方法,并且每一步的都配图了。如果有朋友还是看不懂,那我也爱莫能助了。本篇主要就hadoop服务器操作系统配置进行详细说明,hadoop安装会在下一篇文章中详细的介绍。

hadoop安装包用的是大快DKHadoop发行版,个人觉得DKHadoop的安装过程是比较简单,关于dkhadoop的安装在下一次的分享中再详细介绍吧。下面进入到本篇的主题——服务器操作系统配置教程



 

 一、安装包准备

1、虚拟机分布式安装(三台及以上虚拟机)

若是个人电脑Windows系统或Linux系统,虚拟机上虚拟的三台服务器,则将安装包拷贝到服务器上,进行安装操作即可。

2、物理集群(三台及以上实体服务器)

  1. 外网下载模式

  2. 本地文件模式

    将安装包文件直接拷贝到实体服务器root目录下,进行安装操作即可。

    3、上传模式

    当服务器在机房,且无显示和输入设备的情况下,应用该模式。

    现将文件,安装在本地计算机上(默认为笔记本电脑,在机房现场),并将计算机与服务器连接,将安装包install、DKHInstall上传到服务器root目录下。

 

二、服务器操作系统配置教程

准备工作完成之后,就要进行服务器配置操作,首先必须三台服务器之间要互相ping通。所谓ping通,就是两台设备之间网络是通的。从一端发送一个数据包,另一端就能够收到,就代表两台设备是能够ping通了。

1、修改权限

目的:使install、DKHInstall两个安装包有可执行的权限。权限不足无法执行一些操作。install里面是脚本和所有组件,DKHInstall里面是安装界面。

步骤:在准备工作中拷贝安装包 install、DKHInstall到主节点目录后,修改文件权限。首先进入root目录,安装目录 install、DKHInstall的权限改为:文件所有者可读可写可执行,与文件所有者属于一个用户组的其他用户可读可执行,其他用户组可读可执行。

命令:

cd /root/

unzip DKHPlantform.zip

chmod -R 755 DKHPlantform

 

2、 搭建Hadoop集群设置SSH免密登录

目的:Hadoop运行过程中需要管理远端Hadoop守护进程,在Hadoop启动以后,NameNode是通过SSH(Secure Shell)来启动和停止各个DataNode上的各种守护进程的。这就必须在节点之间执行指令的时候是不需要输入密码的形式,所以我们需要配置SSH运用无密码公钥认证的形式,这样NameNode使用SSH无密码登录并启动DataName进程,同样原理,DataNode上也能使用SSH无密码登录到NameNode。

步骤:

1修改本机hosts文件,写入对应关系

为了区分局域网内的每台主机,都会给主机配一个主机名,每台主机之间又是通过IP进行通信,但IP地址不方便记忆,所以配置主机名和IP映射能够实现主机之间的快速方便的访问。

命令:

vi /etc/hosts

通过按键盘上的insert或是I键进入编辑模式,编辑完成后按一下Esc键然后按一下按Shift+: 键,输入wq,后回车就可以保存。输入q!后回车则是放弃保存并退出.

进入编辑模式后,按照规则写入主机与ip的对应关系(主机名称dk41是自己命名的,如下图)例:

   192.168.1.41    dk41

192.168.1.42    dk42

192.168.1.43    dk43

 



 

编辑完后,保存退出。把对应关系拷到其他两台或多台机器上。

命令:

scp  -r  /etc/hosts  192.168.1.42:/etc

scp  -r  /etc/hosts  192.168.1.43:/etc

2执行集群之间免密前的准备工作   

执行sshpass.sh的脚本的时候会去读sshhosts和sshslaves这两个文件,替换sshpass.sh中的master和slave文件。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    

修改文件sshhosts,输入全部机器的主机名,每行一个主机名(如下图)

命令:

vi /root/DKHPlantform/autossh/sshhosts

通过按键盘上的insert或是I键进入编辑模式,编辑完成后按一下Esc键然后按一下按Shift+:键,输入wq,后回车就可以保存。输入q!后回车则是放弃保存并退出



 

修改文件sshslaves,写入除主机名之外的所有机器名(如下图)

命令:

vi /root/DKHPlantform/autossh/sshslaves

通过按键盘上的insert或是I键进入编辑模式,编辑完成后按一下Esc键然后按一下按Shift+:键,输入wq,后回车就可以保存。输入q!后回车则是放弃保存并退出.

 



 

 

3执行集群免密工作

命令:

cd /root/DKHPlantform/autossh

./autossh 主节点主机名 集群密码

例: ./autossh dk41 123456

4关闭防火墙

防止访问服务器时某些服务被拦截,需关闭防火墙。

命令:

cd /root/DKHPlantform/autossh

./offIptables.sh

 



 

 

3、 安装双机热备份的MySQL

目的:存放Hive的元数据

步骤:

1)从主节点分发mySQL安装目录到第二节点

命令:

scp -r /root/DKHPlantform/mysqlInst/ 192.168.1.42:/root/

2)主节点执行:

命令:                                                                                                                                 

cd /root/DKHPlantform/mysqlInst/

./mysql.sh 1

从节点执行:

命令:

cd /root/mysqlInst/

./mysql.sh 2

 

3)执行成功之后执行热备份(两台机器上都要执行,两个ip互换,41上写42,42上写41,密码是MySQL的密码为:123456。平台内已经设定好,请勿修改):

命令:

source /etc/profile

./sync.sh 192.168.1.xxx(另一台mysql地址)

4、 创建数据库

目的:MySQL是一种关联数据库管理系统,关联数据库将数据保存在不同的表中,增加了速度并提高了灵活性。

步骤:

1导入MySQL数据表,只在主节点执行:

命令:

mysql -uroot -p123456 < { 此处为sql文件,主目录下文件: dkh.sql}

如:mysql -uroot -p123456 </root/DKHPlantform/dkh.sql

2执行完后查看一下两台mysql的数据表是否存在,从主节点中查看执行:

命令:

mySQL  -uroot  -p123456
show databases;

use dkh;

show tables;

 



 

 

5、启动安装

目的:服务器配置操作完成之后,启动DKH。

步骤:执行以下命令。

命令:

cd /root/DKHPlantform/dkh-tomcat*/bin/

./startup.sh

6、本地时间服务器搭建步骤

没联网或者装系统时时间未同步,需要搭建本地时间服务器。

1)搭建内网的ntp服务器

修改/etc/ntp.conf

命令:

Vim /etc/ntp.conf

通过按键盘上的insert或是I键进入编辑模式,编辑完成后按一下Esc键然后按一下按Shift+:键,输入wq后回车就可以保存。输入q!后回车则是放弃保存并退出.

修改下列三行:

#server 0.centos.pool.ntp.org  

#server 1.centos.pool.ntp.org  

#server 2.centos.pool.ntp.org  

 在文件最后添加下列两行:

server  127.127.1.0   

fudge   127.127.1.0 stratum 10

2)启动ntp服务

service ntpd start

3)开机自动启动

chkconfig ntpd on

4)客户端同步时间

命令:

Vim /etc/ntp.conf

通过按键盘上的insert或是I键进入编辑模式,编辑完成后按一下Esc键然后按一下按Shift+:键,输入wq,后回车就可以保存。输入q!后回车则是放弃保存并退出.

在文件最后添加一行:

*/15 * * * * root ntpdate 192.168.27.35;hwclock -w 

 

  • 大小: 143.4 KB
  • 大小: 17.5 KB
  • 大小: 14.5 KB
  • 大小: 15.8 KB
  • 大小: 21.4 KB
  • 大小: 10.8 KB
分享到:
评论

相关推荐

    hadoop集群eclipse安装配置共30页.pdf.z

    这个压缩文件“hadoop集群eclipse安装配置共30页.pdf.zip”显然包含了关于如何在Eclipse环境中配置Hadoop集群的详细教程。Hadoop是一个开源框架,主要用于处理和存储大量数据,尤其适合大数据分析。Eclipse是一款...

    Hadoop集群安装和搭建(全面超详细的过程) 文章目录 Hadoop集群安装和搭建(全面超详细的过程) 前言 一、虚拟机的安装

    hadoop集群搭建Hadoop集群安装和搭建(全面超详细的过程) 文章目录 Hadoop集群安装和搭建(全面超详细的过程) 前言 一、虚拟机的安装 二、Linux系统安装 1.环境准备 2.虚拟机安装 三、Centos系统安装 四、静态网络...

    Hadoop集群安装配置教程_Hadoop2.62

    【Hadoop集群安装配置教程_Hadoop2.6.0】是针对在Ubuntu和CentOS操作系统上搭建Hadoop集群的详细指南。本教程适用于Hadoop 2.x系列版本,特别是Hadoop 2.6.0及类似版本如Hadoop 2.7.1、Hadoop 2.4.1。它假设读者已经...

    hadoop集群搭建(超级详细)

    在大数据领域,Hadoop是一个广泛使用的开源框架,用于存储和处理海量数据。本文将详细讲解如何搭建一个...这个超详细的教程覆盖了从零开始到集群搭建完成的全过程,按照步骤执行,可以轻松掌握Hadoop集群搭建技术。

    细细品味Hadoop_Hadoop集群VSFTP安装配置.rar_hadoop

    这个压缩包文件"细细品味Hadoop_Hadoop集群VSFTP安装配置.rar_hadoop"似乎属于一个系列教程,专注于Hadoop集群的构建与管理,特别是结合了VSFTP(Very Secure FTP)的安装配置。VSFTP是一个在Linux系统中常用的、...

    大数据教程之搭建Hadoop集群.zip_大数据环境搭建hadoop

    综上所述,这个压缩包提供了全面的Hadoop集群搭建教程,涵盖了从基础环境准备、服务器配置、Hadoop安装、SSH和FTP服务的设置,到集群管理和维护等多个环节。对于想要学习和实践Hadoop大数据处理的人来说,这是一个...

    Hadoop集群安装指南

    Hadoop集群安装指南是一份详细的安装和配置教程,它适合于新手学习以及经验丰富的技术人员参考使用。该指南涵盖了安装VMWare Workstation 10、配置Ubuntu Kylin操作系统、安装和配置Hadoop集群等多个方面的内容。...

    Hadoop集群搭建详细简明教程.pdf

    为了提高数据处理能力,通常会采用Hadoop集群的方式进行部署,通过多台服务器协同工作来实现高性能计算。 #### 二、准备工作 **1. Linux操作系统安装** - **工具准备**:本教程使用VMware Workstation 8.0.0作为...

    阿里云大数据Hadoop集群搭建全网最新教程

    ### 阿里云大数据Hadoop集群搭建全网最新教程 #### 一、Hadoop运行环境搭建 在构建Hadoop集群之前,首先需要确保Linux环境已经准备好,并且能够支持Hadoop的正常运行。 ##### 1.1 配置免密登录 在分布式计算环境...

    最新Hadoop集群安装教程.rar

    这个“最新Hadoop集群安装教程”可能包含了从零开始构建一个高效、可靠的Hadoop集群的详细步骤。下面,我们将深入探讨Hadoop的基本概念,集群搭建的关键环节,以及可能涉及到的相关技术。 Hadoop是由Apache基金会...

    Hadoop安装教程_单机/伪分布式配置_Hadoop2.7.1/Ubuntu 16.04

    Hadoop安装教程_单机/伪分布式配置_Hadoop2.7.1/Ubuntu 16.04 本教程主要讲述了在 Ubuntu 16.04 环境下安装 Hadoop 2.7.1 的步骤,包括单机模式、伪分布式模式和分布式模式三种安装方式。以下是本教程的知识点总结...

    Hadoop部署和配置Kerberos安全认证

    通过本文介绍的方法,可以在Hadoop集群上成功部署并配置Kerberos安全认证。Kerberos的引入显著提高了Hadoop集群的安全性,特别是在多租户环境中。此外,通过Cloudera Manager进行管理大大简化了配置过程,降低了出错...

    最新Hadoop集群安装教程.pdf

    以上步骤提供了安装和配置Hadoop集群的基本指南。然而,实际操作中可能需要根据网络环境、硬件资源和特定需求进行调整。确保在整个过程中备份重要配置文件,以便在出现问题时恢复或排查。同时,了解Hadoop的工作原理...

    基于centos的大数据hadoop集群搭建说明文档

    【描述】:本教程专为初学者设计,详细阐述了如何手动搭建Hadoop集群,步骤详尽,易于理解。 【标签】:Hadoop集群搭建 【正文】: Hadoop是一个开源的分布式计算框架,它允许在普通硬件上处理大量数据。基于...

    Hadoop安装与配置详细教程(Linux)

    【Hadoop安装与配置详细教程(Linux)】 Hadoop是一个开源的分布式计算框架,广泛应用于大数据处理。在Linux环境下安装和配置Hadoop是一项基础但重要的任务,尤其对于那些需要处理大规模数据的组织。本文将详细介绍...

Global site tag (gtag.js) - Google Analytics