0)安装模板虚拟机,IP 地址 192.168.10.100、主机名称 hadoop100、内存 2G、硬盘 50G
1)hadoop100 虚拟机配置要求如下(本文 Linux 系统全部以 CentOS-7.5-x86-1804 为例)
(1)使用 yum 安装需要虚拟机可以正常上网,yum 安装前可以先测试下虚拟机联网情况
[root@hadoop100 ~]# ping www.baidu.com
(2)安装 epel-release
[root@hadoop100 ~]# yum install -y epel-release
2)关闭防火墙,关闭防火墙开机自启
[root@hadoop100 ~]# systemctl stop firewalld
[root@hadoop100 ~]#systemctl disable firewalld.service
3)创建 atguigu 用户,并修改 atguigu 用户的密码
[root@hadoop100 ~]# useradd atguigu
[root@hadoop100 ~]# passwd atguigu
4)配置 atguigu 用户具有 root 权限,方便后期加 sudo 执行 root 权限的命令
[root@hadoop100 ~]# vim /etc/sudoers
修改/etc/sudoers 文件,在%wheel 这行下面添加一行,如下所示:
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
## Allows people in group wheel to run all commands
%wheel ALL=(ALL) ALL
atguigu ALL=(ALL) NOPASSWD:ALL
5)在/opt 目录下创建文件夹,并修改所属主和所属组
(1)在/opt 目录下创建 module、software 文件夹
[root@hadoop100 ~]# mkdir /opt/module
[root@hadoop100 ~]# mkdir /opt/software
(2)修改 module、software 文件夹的所有者和所属组均为 atguigu 用户
[root@hadoop100 ~]# chown atguigu:atguigu /opt/module [root@hadoop100# chown atguigu:atguigu /opt/software
(3)查看 module、software 文件夹的所有者和所属组
[root@hadoop100 ~]# cd /opt/ [root@hadoop100 opt]# ll
6)卸载虚拟机自带的 JDK
[root@hadoop100 ~]# rpm -qa | grep -i java | xargs -n1 rpm -e --nodeps
7)重启虚拟机
[root@hadoop100 ~]# reboot