Vagrant up: 使用一条命令安装 Ceph
shan

一个简单的脚本,用于引导一个 Ceph 集群并开始使用它。该脚本严重依赖于
最终的机器将包含
- 1 个监控器
- 3 个 OSD
- 1 个 MDS
- 1 个 RADOS Gateway
让我们开始吧!
只需执行以下脚本
```bash
#!/bin/bash
git clone https://github.com/ceph/ceph-ansible.git
cat > Vagrantfile << EOF VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.box = "trusty" config.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-i386-vagrant-disk1.box" config.vm.define :cephaio do |cephaio|
cephaio.vm.network :private_network, ip: "192.168.0.2"
cephaio.vm.host_name = "cephaio"
(0..2).each do |d|
cephaio.vm.provider :virtualbox do |vb|
vb.customize [ "createhd", "--filename", "disk-#{d}", "--size", "1000" ]
vb.customize [ "storageattach", :id, "--storagectl", "SATA Controller", "--port", 3+d, "--device", 0, "--type", "hdd", "--medium", "disk-#{d}.vdi" ]
vb.customize [ "modifyvm", :id, "--memory", "512" ]
end
end
config.vm.provision "ansible" do |ansible|
ansible.playbook = "ceph-ansible/site.yml"
ansible.groups = {
"mons" => ["cephaio"],
"osds" => ["cephaio"],
"mdss" => ["cephaio"],
"rgws" => ["cephaio"]
}
ansible.extra_vars = {
fsid: "4a158d27-f750-41d5-9e7f-26ce4c9d2d45",
monitor_secret: "AQAWqilTCDh7CBAAawXt6kyTgLFCxSvJhTEmuw=="
}
end
end end EOF vagrant up ```
希望你喜欢这个 :)