Hadoop集群部署总结(两个节点部署)

关于两个节点的集群部署,可以先参考,单个节点的伪集群部署的总结( https://blog.csdn.net/advent_java/article/details/105773087
 
一、关于core-site.xml文件
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at
 
 
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License. See accompanying LICENSE file.
-->
 
<!-- Put site-specific property overrides in this file. -->
 
<configuration>
    <property>
        <name>fs.defaultFS</name>
        <value> hdfs://masternode:9000</value>
    </property>
</configuration>
以上是取自单个节点的伪分布式系统的配置信息
首先要处理的是hadoop.tmp.dir,它是Hadoop文件系统依赖的基础配置,默认是放在/tmp/{$user}下的。但是放在/tmp下是不安全的,在系统重启后可能会被删除,所以需要把这个配置另外指向一个位置
新增一个配置项
<property>
    <name>hadoop.tmp.dir</name>
    <value>/root/software/hadoop-2.5.1</value>
</propery>
 
二、关于hdfs-site.xml文件
这里主要是配置关于secondary NameNode的信息
在/etc/hadoop/下生成masters和slaves文件
在masters中写入masternode
在slaves中定性 主masternode和slavenode
  
三、文件复制
在分布的环境中,master和slave节点上的文件需要保持一致,这样就需要把master节点中的文件复制到slave节点中
把master上的 Hadoop整个文件夹复制到slave节点中
使用命令如下:
    scp -r /root/software/hadoop-2.5.1 root@slave://root/software
把master上的.bash_profile复制到salve的root目录
使用命令如下:    
    scp .bash_profile root@slavenode:~
把master上的hosts文件复制到salve的/etc目录下
使用命令如下:
     scp /etc/hosts root@slavenode:/etc
 
四、格式化HDFS
使用命令如下:
    hdfs namenode -format
五、启动HDFS集群
使用命令如下
    start-dfs.sh    
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值