centos7
1、修改主机名
[root@localhost ~]# vi /etc/hostname
[root@localhost ~]# hostname
hadoop.com
重新连接后,提示符会修改
[root@hadoop ~]#
2、修改网络映射
[root@hadoop ~]# vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
10.0.0.11 hadoop.com
3、关闭防火墙
firewalld的基本使用
启动: systemctl start firewalld
关闭: systemctl stop firewalld
查看状态: systemctl status firewalld
开机禁用 : systemctl disable firewalld
开机启用 : systemctl enable firewalld
4、创建解压目录
mkdir /usr/java
cd /usr/java
tar -zxvf jdk-8u151-linux-x64.tar.gz -C /usr/java/
5、配置jdk
vi /etc/profile
#java environment
export JAVA_HOME=/usr/java/jdk1.8.0_151
export CLASSPATH=.:${JAVA_HOME}/jre/lib/rt.jar:${JAVA_HOME}/lib/dt.jar:${JAVA_HOME}/lib/tools.jar
export PATH=$PATH:${JAVA_HOME}/bin
在命令行模式下 shift z z可以快速保存退出
source /etc/profile
生效
[zwh@hadoop ~]$ ssh-keygen -t rsa
[zwh@hadoop ~]$ ssh-copy-id zwh@localhost
创建安装目录
[zwh@hadoop ~]$ mkdir bigdata
[zwh@hadoop ~]$ cd bigdata/
[zwh@hadoop bigdata]$ mkdir hadoop
[zwh@hadoop ~]$ tar -zxvf hadoop-3.1.1.tar.gz -C /home/zwh/bigdata/hadoop
[zwh@hadoop ~]$ cd bigdata/
[zwh@hadoop bigdata]$ ll
总用量 0
drwxrwxr-x. 3 zwh zwh 25 1月 6 19:22 hadoop
[zwh@hadoop bigdata]$ mkdir data
[zwh@hadoop bigdata]$ ll
总用量 0
drwxrwxr-x. 2 zwh zwh 6 1月 6 19:27 data
drwxrwxr-x. 3 zwh zwh 25 1月 6 19:22 hadoop
[zwh@hadoop bigdata]$ mkdir log
hadoop-env.sh
# The java implementation to use. By default, this environment
# variable is REQUIRED on ALL platforms except OS X!
# export JAVA_HOME=
export JAVA_HOME=/usr/java/jdk1.8.0_151
core-site.xml
<configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://hadoop.com:9000</value>
</property>
<!-- 配置缓存文件的目录 -->
<property>
<name>hadoop.tmp.dir</name>
<value>/home/zwh/bigdata/data</value>
</property>
</configuration>
hdfs-size.xml
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
</configuration>
mapred-site.xml
<configuration>
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
</configuration>
yarn-site.xml
<configuration>
<!-- Site specific YARN configuration properties -->
<property>
<name>yarn.resourcemanager.hostname</name>
<value>hadoop.com</value>
</property>
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
</configuration>
bin/hdfs namenode -format
sbin/start-dfs.sh
sbin/stop-dfs.sh
sbin/start-yarn.sh
sbin/stop-yarn.sh
hdfs
http://hadoop.com:9870
yarn
http://hadoop.com:8088