1 Star 0 Fork 0

Leon/fastdata-cluster

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Vagrantfile 3.75 KB
一键复制 编辑 原始数据 按行查看 历史
Markus Helbig 提交于 2020-05-02 13:48 . version upgrades
ENV["LC_ALL"] = "en_US.UTF-8"
# if sth. gets changed here, also adapt /ansible/inventories/vbox/hosts
KAFKA = 3
CASSANDRA = 3
HADDOP = 3
Vagrant.configure("2") do |config|
required_plugins = %w( vagrant-hostsupdater )
required_plugins.each do |plugin|
system "vagrant plugin install #{plugin}" unless Vagrant.has_plugin? plugin
end
config.vm.box = "markush81/centos8-vbox-guestadditions"
config.vm.box_check_update = true
config.vm.synced_folder "exchange", "/home/vagrant/exchange", create: true
config.vm.synced_folder "ansible", "/home/vagrant/ansible", create: true
config.vm.provision :shell, inline: "ifup eth1", run: "always"
(1..KAFKA).each do |i|
config.vm.define "kafka-#{i}" do |kafka|
kafka.vm.hostname = "kafka-#{i}"
kafka.vm.provider "virtualbox" do |vb|
vb.memory = "1024"
vb.cpus = "1"
end
kafka.vm.network :private_network, ip: "192.168.10.#{1 + i}", auto_config: true
if i == KAFKA
kafka.vm.provision :ansible do |ansible|
ansible.compatibility_mode = "2.0"
ansible.limit = "kafka,cassandra,hadoop-master,hadoop-slave"
ansible.playbook = "ansible/network.yml"
ansible.inventory_path = "ansible/inventories/vbox"
ansible.raw_arguments = [
"-vv"
]
end
kafka.vm.provision :ansible do |ansible|
ansible.compatibility_mode = "2.0"
ansible.limit = "kafka"
ansible.playbook = "ansible/cluster.yml"
ansible.inventory_path = "ansible/inventories/vbox"
ansible.raw_arguments = [
"-vv"
]
end
end
end
end
(1..CASSANDRA).each do |i|
config.vm.define "cassandra-#{i}" do |cassandra|
cassandra.vm.hostname = "cassandra-#{i}"
cassandra.vm.provider "virtualbox" do |vb|
vb.memory = "1024"
vb.cpus = "1"
end
cassandra.vm.network :private_network, ip: "192.168.10.#{KAFKA + 1 + i }", auto_config: true
if i == CASSANDRA
cassandra.vm.provision :ansible do |ansible|
ansible.compatibility_mode = "2.0"
ansible.limit = "kafka,cassandra,hadoop-master,hadoop-slave"
ansible.playbook = "ansible/network.yml"
ansible.inventory_path = "ansible/inventories/vbox"
ansible.raw_arguments = [
"-vv"
]
end
cassandra.vm.provision :ansible do |ansible|
ansible.compatibility_mode = "2.0"
ansible.limit = "cassandra"
ansible.playbook = "ansible/cluster.yml"
ansible.inventory_path = "ansible/inventories/vbox"
ansible.raw_arguments = [
"-vv"
]
end
end
end
end
(HADDOP).downto(1).each do |i|
config.vm.define "hadoop-#{i}" do |hadoop|
hadoop.vm.hostname = "hadoop-#{i}"
hadoop.vm.provider "virtualbox" do |vb|
vb.memory = "4096"
vb.cpus = "2"
end
hadoop.vm.network :private_network, ip: "192.168.10.#{KAFKA + CASSANDRA + 1 + i}", auto_config: true
if i == 1
hadoop.vm.provision :ansible do |ansible|
ansible.compatibility_mode = "2.0"
ansible.limit = "kafka,cassandra,hadoop-master,hadoop-slave"
ansible.playbook = "ansible/network.yml"
ansible.inventory_path = "ansible/inventories/vbox"
ansible.raw_arguments = [
"-vv"
]
end
hadoop.vm.provision :ansible do |ansible|
ansible.compatibility_mode = "2.0"
ansible.limit = "hadoop-master,hadoop-slave"
ansible.playbook = "ansible/cluster.yml"
ansible.inventory_path = "ansible/inventories/vbox"
ansible.raw_arguments = [
"-vv"
]
end
end
end
end
end
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/cheerscpl/fastdata-cluster.git
git@gitee.com:cheerscpl/fastdata-cluster.git
cheerscpl
fastdata-cluster
fastdata-cluster
main

搜索帮助