Compare commits
No commits in common. "master" and "2fdc02686ae01402afbe03d23992fbca8cdd3e75" have entirely different histories.
master
...
2fdc02686a
|
@ -4,15 +4,17 @@ Vagrant.configure("2") do |config|
|
|||
|
||||
# Get the VagrantFile directory
|
||||
vagrant_root = File.dirname(__FILE__)
|
||||
|
||||
|
||||
# Trigger the Vagrant pre-up script before uping the first VM only
|
||||
|
||||
config.trigger.before :up, :vm => ["node-admin"], :append_to_path => ["#{vagrant_root}/scripts"] do
|
||||
run "pre-up.sh"
|
||||
end
|
||||
|
||||
# Shell provisionner for all VMs
|
||||
config.vm.provision "ceph-preflight", type: "shell", path: "scripts/provision.sh"
|
||||
|
||||
# All VMs are based on the same box
|
||||
config.vm.box = "generic/ubuntu1804"
|
||||
config.vm.box = "bento/ubuntu-16.04"
|
||||
|
||||
# Use nfs for shared folder
|
||||
config.vm.synced_folder ".", "/vagrant",
|
||||
|
@ -34,17 +36,12 @@ Vagrant.configure("2") do |config|
|
|||
libvirt.volume_cache = "writeback"
|
||||
libvirt.graphics_type = "spice"
|
||||
libvirt.video_type = "qxl"
|
||||
libvirt.storage_pool_name="cephlab"
|
||||
# libvirt.snapshot_pool_name="cephlab"
|
||||
end
|
||||
|
||||
# admin VM
|
||||
config.vm.define "node-admin", primary: true do |admin|
|
||||
admin.vm.hostname = "node-admin"
|
||||
admin.vm.provision "ceph-install", type: "shell", keep_color: true, path: "scripts/provision-admin.sh"
|
||||
admin.trigger.before :up do |trigger|
|
||||
trigger.run = {path: "scripts/pre-up.sh"}
|
||||
end
|
||||
end
|
||||
|
||||
# osd1 VM with private cluster network
|
||||
|
@ -61,15 +58,15 @@ Vagrant.configure("2") do |config|
|
|||
:libvirt__network_name => "cluster-network"
|
||||
osd1.vm.provider :libvirt do |libvirt|
|
||||
libvirt.storage :file,
|
||||
:size => "10G",
|
||||
:size => "20G",
|
||||
:type => "raw",
|
||||
:cache => "writeback"
|
||||
libvirt.storage :file,
|
||||
:size => "10G",
|
||||
:size => "40G",
|
||||
:type => "raw",
|
||||
:cache => "writeback"
|
||||
libvirt.storage :file,
|
||||
:size => "10G",
|
||||
:size => "40G",
|
||||
:type => "raw",
|
||||
:cache => "writeback"
|
||||
end
|
||||
|
@ -85,41 +82,17 @@ Vagrant.configure("2") do |config|
|
|||
:libvirt__network_name => "cluster-network"
|
||||
osd2.vm.provider :libvirt do |libvirt|
|
||||
libvirt.storage :file,
|
||||
:size => "10G",
|
||||
:size => "20G",
|
||||
:type => "raw",
|
||||
:cache => "writeback"
|
||||
libvirt.storage :file,
|
||||
:size => "10G",
|
||||
:size => "40G",
|
||||
:type => "raw",
|
||||
:cache => "writeback"
|
||||
libvirt.storage :file,
|
||||
:size => "10G",
|
||||
:size => "40G",
|
||||
:type => "raw",
|
||||
:cache => "writeback"
|
||||
end
|
||||
end
|
||||
|
||||
# osd3 VM with private cluster network
|
||||
# 3 additional disks: 1 for journals and 2 for osd
|
||||
config.vm.define "node-osd3" do |osd3|
|
||||
osd3.vm.hostname = "node-osd3"
|
||||
osd3.vm.network :private_network,
|
||||
:type => "dhcp",
|
||||
:libvirt__network_name => "cluster-network"
|
||||
osd3.vm.provider :libvirt do |libvirt|
|
||||
libvirt.storage :file,
|
||||
:size => "10G",
|
||||
:type => "raw",
|
||||
:cache => "writeback"
|
||||
libvirt.storage :file,
|
||||
:size => "10G",
|
||||
:type => "raw",
|
||||
:cache => "writeback"
|
||||
libvirt.storage :file,
|
||||
:size => "10G",
|
||||
:type => "raw",
|
||||
:cache => "writeback"
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -49,8 +49,6 @@ ceph-deploy new $ADMIN_NODE
|
|||
# Initialize cluster configuration
|
||||
$OUTPUT_LOG "Initialize cluster configuration"
|
||||
cat << CLUSTERCONFIG | tee -a ceph.conf
|
||||
[global]
|
||||
mon_inital_members = ceph-admin
|
||||
public network = $PUBLIC_NETWORK
|
||||
cluster network = $CLUSTER_NETWORK
|
||||
|
||||
|
@ -71,7 +69,7 @@ done
|
|||
|
||||
# Deploy ceph on all nodes
|
||||
$OUTPUT_LOG "Deploy ceph on all nodes"
|
||||
ceph-deploy install --release octopus $NODES
|
||||
ceph-deploy install --release luminous $NODES
|
||||
|
||||
# Create initial monitor
|
||||
$OUTPUT_LOG "Create initial monitor"
|
||||
|
@ -102,9 +100,8 @@ for NODE in $OSD_NODES; do
|
|||
ssh $NODE sudo cp /home/$CEPH_ADMIN_USER/ceph.bootstrap-osd.keyring /var/lib/ceph/bootstrap-osd/ceph.keyring
|
||||
ssh $NODE sudo chown ceph:ceph /var/lib/ceph/bootstrap-osd/ceph.keyring
|
||||
$OUTPUT_LOG "Create OSDs on $NODE"
|
||||
ssh $NODE sudo ceph-volume lvm create --bluestore --data /dev/vdb
|
||||
ssh $NODE sudo ceph-volume lvm create --bluestore --data /dev/vdc
|
||||
ssh $NODE sudo ceph-volume lvm create --bluestore --data /dev/vdd
|
||||
ssh $NODE sudo ceph-volume lvm create --filestore --data /dev/vdb --journal /dev/vda1
|
||||
ssh $NODE sudo ceph-volume lvm create --filestore --data /dev/vdc --journal /dev/vda2
|
||||
done;
|
||||
|
||||
# wait 10 seconds and get cluster status
|
||||
|
|
|
@ -38,7 +38,7 @@ CEPH_ADMIN_USER="ceph-admin"
|
|||
|
||||
# Nodes
|
||||
ADMIN_NODE="node-admin"
|
||||
OSD_NODES="node-osd1 node-osd2 node-osd3"
|
||||
OSD_NODES="node-osd1 node-osd2"
|
||||
NODES="$ADMIN_NODE $OSD_NODES"
|
||||
|
||||
# Networks
|
||||
|
|
|
@ -41,10 +41,10 @@ export DEBIAN_FRONTEND=noninteractive
|
|||
# Make sure we have the french locale
|
||||
locale-gen fr_FR.UTF-8
|
||||
|
||||
# Install ceph repository (Octopus version)
|
||||
$OUTPUT_LOG "Install ceph repository (Octopus version)"
|
||||
# Install ceph repository (luminous version)
|
||||
$OUTPUT_LOG "Install ceph repository (luminous version)"
|
||||
wget -q -O- 'https://download.ceph.com/keys/release.asc' | apt-key add -
|
||||
echo deb https://download.ceph.com/debian-octopus/ $(lsb_release -sc) main | tee /etc/apt/sources.list.d/ceph.list
|
||||
echo deb https://download.ceph.com/debian-luminous/ $(lsb_release -sc) main | tee /etc/apt/sources.list.d/ceph.list
|
||||
apt-get update
|
||||
|
||||
# Install chrony for time synchronization, gdisk for GPT partitioning,
|
||||
|
@ -91,7 +91,6 @@ echo >> /etc/hosts
|
|||
# Signal that IP is ready
|
||||
$OUTPUT_LOG "Signal that IP is ready"
|
||||
echo -e "$IP_ADDRESS\t$GUEST_NAME" | tee "$GUEST_VAGRANT_SIGNAL_DIR/$GUEST_NAME-IP"
|
||||
echo -e "$IP_ADDRESS\t$GUEST_NAME" >>/etc/hosts
|
||||
|
||||
# Wait for all nodes IP and update /etc/hosts
|
||||
$OUTPUT_LOG "Wait for all nodes IP and update /etc/hosts"
|
||||
|
|
Loading…
Reference in New Issue