hadoop配置

在hadoop下新建tmp、hdfs/data、hdfs/name文件夹

 

core-site.xml

<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://192.168.2.39:9000</value>
</property>

<property>
<name>hadoop.tmp.dir</name>
<value>file:/root/software/hadoop/tmp</value>
</property>

<property>
<name>io.file.buffer.size</name>
<value>131702</value>
</property>
</configuration>

hadoop-env.sh

export JAVA_HOME=/root/software/jdk1.8

mapred-site.xml

 

<configuration>
<property>
<name>mapred.job.tracker</name>
<value>192.168.2.39:9001</value>
</property>
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
<property>
<name>yarn.nodemanager.auxservices.mapreduce.shuffle.class</name>
<value>org.apache.hadoop.mapred.ShuffleHandler</value>
</property>
<property>
<name>yarn.resourcemanager.address</name>
<value>127.0.0.1:8032</value>
</property>
<property>
<name>yarn.resourcemanager.scheduler.address</name>
<value>127.0.0.1:8030</value>
</property>
<property>
<name>yarn.resourcemanager.resource-tracker.address</name>
<value>127.0.0.1:8031</value>
</property>
<property>
<name>yarn.resourcemanager.admin.address</name>
<value>127.0.0.1:8033</value>
</property>
<property>
<name>yarn.resourcemanager.webapp.address</name>
<value>127.0.0.1:8088</value>
</property>
<property>
<name>yarn.nodemanager.resource.memory-mb</name>
<value>768</value>
</property>

</configuration>

 

hdfs-core.xml

<configuration>
<property>
<name>dfs.namenode.name.dir</name>
<value>file:/root/software/hadoop/hdfs/name</value>
</property>
<property>
<name>dfs.datanode.data.dir</name>
<value>file:/root/software/hadoop/hdfs/data</value>
</property>
<property>
<name>dfs.replication</name>
<value>2</value>
</property>
<property>
<name>dfs.namenode.secondary.http-address</name>
<value>127.0.0.1:9001</value>
</property>
<property>
<name>dfs.webhdfs.enabled</name>
<value>true</value>
</property>
<property>
<name>dfs.permissions</name>
<value>false</value></property>
</configuration>

 

 

首先格式化所有节点

bin/hadoop -format namenode

 

启动hadoop

sbin/hadoop start-all.sh

验证namenode 是否启动可以使用

jps查看namenode

停止hadoop

sbin/hadoop stop-all.sh

 

转载于:https://www.cnblogs.com/YasinXiao/p/6113716.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值