在根目录下
cd etc
cd network-scripts/
vim ifcfg-eth0
DEVICE=eth0
HWADDR=08:00:27:92:9D:6D
TYPE=Ethernet
UUID=67c28e67-41df-4c0d-a399-fce07b3b265d
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=192.168.56.2
NETMASK=255.255.255.0
GATEWAY=192.168.56.1
保存并退出
service network restart重启网络
ifconfig 查看
关闭防火墙 service iptables stop
永久关闭防火墙 chkconfig iptables off
配置ssh公钥 ssh-keygen -t rsa 一路回车
进入cd /root/app/hadoop-2.6.0-cdh5.7.0/etc/hadoop
修改配置文件:
1.hadoop-env.sh
export JAVA_HOME=/root/app/jdk1.8.0_161
export HADOOP_HOME=/root/app/hadoop-2.6.0-cdh5.7.0
2.core-site.xml
<property>
<name>fs.default.name</name>
<value>hdfs://master:8020</value>
</property>
<property>
<name>hadoop.tmp.dir</name>
<value>/opt/hdfs/tmp</value>
</property>
3.hdfs-site.xml
<property>
<name>dfs.replication</name>
<value>3</value>
</property>
<property>
<name>dfs.name.dir</name>
<value>/root/data/name</value>
</property>
<property>
<name>dfs.data.dir</name>
<value>/root/data/data</value>
</property>
4.mapred-site.xml(cp mapred-site.xml.template mapred-site.xml)
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
5.yarn-site.xml
<property>
<name>yarn.resourcemanager.address</name>
<value>master:8080</value>
</property>
<property>
<name>yarn.resourcemanager.resource-tracker.address</name>
<value>master:8082</value>
</property>
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
<property>
<name>yarn.nodemanager.aux-services.mapreduce.shuffle.class</name>
<value>org.apache.hadoop.mapred.ShuffleHandler</value>
</property>
6.slaves
master
格式化 hadoop namenode -format
启动hadoop 进入 cd /root/app/hadoop-2.6.0-cdh5.7.0/sbin 执行./start-all.sh
启动之后查看jps