前言 根据前几次的经验,这一次,运用脚本的形式安装,可以节约大部分的步骤,把一些前置的配置什么的写到shell脚本里面,随着vagrant up启动命令一起安装 集群环境: IP 内存 CPU核数 master 172.17.8.51 4G 2 node 172.17.8.52 4G 1 node 172.17.8.53 4G 1 1、编写Vagrantfile文件 Vagrantfile内容: # -*- mode: ruby -*-# vi: set ft=ruby :# on win10, you need `vagrant plugin install vagrant-vbguest --plugin-version 0.21` and change synced_folder.type="virtualbox"# reference `https://www.dissmeyer.com/2020/02/11/issue-with-centos-7-vagrant-boxes-on-windows-10/`Vagrant.configure("2") do |config| config.vm.box_check_update = false config.vm.provider 'virtualbox' do |vb| vb.customize [ "guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-set-threshold", 1000 ] end $num_instances = 3 # curl https://discovery.etcd.io/new?size=3 (1..$num_instances).each do |i| con...