1. 安装虚拟机, 安装centos, 配置用户, 配置sudo
2. 在一台虚拟机里安装hadoop + spark, 关闭防火墙
> 查看防火墙状态, 并关闭
# centos7 # 查看防火墙状态 firewall-cmd --state # 关闭防火墙 systemctl stop firewalld.service # centos6 # 查看防火墙状态 service iptables status # 关闭防火墙 chkconfig iptables off
3. 复制虚拟机
> 我这里复制了3台, 集群里一共有4台机器
4. 修改主机名和IP, 配置host, 配置免密登录, 关闭防火墙
> 修改主机名
vi /etc/hostname
# 我这里依次写入了 hadoop00, hadoop01, hadoop02, hadoo03
> 修改IP
sudo vi /etc/sysconfig/network-scripts/ifcfg-eth0 # 以下是写入的内容 DEVICE="eth0" IPV6INIT="yes" BOOTPROTO="static" ONBOOT="yes" TYPE="Ethernet" NETMASK="255.255.255.0" GATEWAY="10.211.55.1" IPADDR="10.211.55.3" # 每台机器配一个IP, 分别是
# 10.211.55.3 # 10.211.55.4 # 10.211.55.5 # 10.211.55.6
参考 https://blog.csdn.net/qq285016127/article/details/80501418