使用虚拟机模拟分布式hadoop集群环境
环境准备
安装vagrant、virtualBox,准备centos7的box文件,hadoop、jdk
部署linux集群
Vagrantfile
其中hostmanager需要使用 vagrant plugin install hostmanager
安装
Vagrant.configure("2") do |config|
config.vm.define :master1, primary: true do |master|
master.vm.provider "virtualbox" do |v|
v.customize ["modifyvm", :id, "--name", "hadoop-master1", "--memory", "512"]
end
master.vm.box = "centos/7"
master.vm.hostname = "hadoop-master1"
master.vm.network :private_network, ip: "192.168.10.10"
end
(1..3).each do |i|
config.vm.define "slave#{i}" do |node|
node.vm.box = "centos/7"
node.vm.hostname = "hadoop-slave#{i}"
node.vm.network :private_network, ip: "