配置文件定义了6台vm,并指定了各vm的角色(遵循CDH角色):
vm-cluster-node1: This is the master; besides running the CM master, it should run the namenode, secondary namenode, and jobtracker.
vm-cluster-node2: This is a slave, it should run a datanode and a tasktracker.
vm-cluster-node3: This is a slave, it should run a datanode and a tasktracker.
vm-cluster-node4: This is a slave, it should run a datanode and a tasktracker.
vm-cluster-node5: This is a slave, it should run a datanode and a tasktracker.
vm-cluster-client: This machine plays the role of gateway for the cluster.
配置文件各配置项意义请点击这里。特别指出的是依赖于不同的提供商,virtualbox或者vmwarefusion,定义的内存大小是不同的。大家看下,使用不同提供商定制需要的环境是多么的简单!
上面的vagrant配置文件做了另外一件重要的事情:在master和node1节点自动安装cloudera Manager 。
要创建这个虚拟机集群,只需要到配置文件目录下(比如VagrantHadoop),在shell下运行:
> vagrant up --provider=virtualbox
过一段时间(这个时间随你的机器性能而定),Vagrant运行完毕,意味着所有虚拟机安装配置完毕并且处于运行状态。
到此,你可以通过CM管理UI(http://vm-cluster-node1:7180)配置你的集群。
Have fun!
更多Hadoop相关信息见Hadoop 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=13
