参考的博客
https://blog.csdn.net/hrainning/article/details/100689858
https://blog.csdn.net/qq_33202508/article/details/88261467
一.搭建前的准备
- 下载相关的软件jdk,hadoop
jdk-8u212-linux-x64.tar.gz:
链接:https://pan.baidu.com/s/1ymwv3szGCsQHmsPCq1ZSjA 密码:qhcn
hadoop-2.6.0-cdh5.9.0.tar.gz安装包:
http://archive.cloudera.com/cdh5/cdh/5/hadoop-2.6.0-cdh5.9.0.tar.gz - linux系统
二.配置jdk环境,关闭防火墙(如已配置,请跳过)
1.安装jdk
#tar -zxf jdk-8u212-linux-x64.tar.gz -C ../modules/(放到自己jdk解压的目录下)
2.配置jdk环境变量
#vim /etc/profile
#JAVA_HOME
export JAVA_HOME=/opt/modules/jdk1.8.0_212
export PATH=$PATH:$JAVA_HOME/bin
3.使配置生效
#source /etc/profile
4.卸载openJDK(不推荐使用自带的jdk)
#rpm -qa | grep jdk
删除所有openJdk
#rpm -e --nodeps java-1.8.0-openjdk-headless-1.8.0.232.b09-0.el7_7.x86_64
5.查看防火墙是否关闭,CentOS 7以上没有了iptables文件,centos7 默认防火墙是firewalld,关闭防火墙有两种方式:
第一种方式:
查看防火墙状态:systemctl status firewalld.service
关闭防火墙:systemctl stop firewalld.service
设置关闭开机自启动防火墙:systemctl disable firewalld.service
第二种方式:
若是centos7以上需安装iptables
安装iptables-services:yum install iptables-services
启动iptables-services:systemctl enable iptables
centos7以下直接运行以下命令:
关闭防火墙:service iptables stop
查看防火墙状态:service iptables status
设置关闭开机自启动防火墙:chkconfig iptables off
关闭安全子系统
# vi /etc/sysconfig/selinux</