Compare commits

...

3 Commits

Author SHA1 Message Date
Cory Hawkless 7c2f8b188e Working v1 2021-03-23 20:35:29 +10:30
Cory Hawkless afeb2bac22 v2 2021-03-23 10:43:06 +10:30
Cory Hawkless 15000a349a First stage of conversion to Ubuntu 18.04 and Ceph Octopus 2021-03-23 09:05:06 +10:30
5 changed files with 4347 additions and 18 deletions

47
Vagrantfile vendored
View File

@ -6,15 +6,13 @@ Vagrant.configure("2") do |config|
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 = "bento/ubuntu-16.04"
config.vm.box = "generic/ubuntu1804"
# Use nfs for shared folder
config.vm.synced_folder ".", "/vagrant",
@ -36,12 +34,17 @@ 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
@ -58,15 +61,15 @@ Vagrant.configure("2") do |config|
:libvirt__network_name => "cluster-network"
osd1.vm.provider :libvirt do |libvirt|
libvirt.storage :file,
:size => "20G",
:size => "10G",
:type => "raw",
:cache => "writeback"
libvirt.storage :file,
:size => "40G",
:size => "10G",
:type => "raw",
:cache => "writeback"
libvirt.storage :file,
:size => "40G",
:size => "10G",
:type => "raw",
:cache => "writeback"
end
@ -82,17 +85,41 @@ Vagrant.configure("2") do |config|
:libvirt__network_name => "cluster-network"
osd2.vm.provider :libvirt do |libvirt|
libvirt.storage :file,
:size => "20G",
:size => "10G",
:type => "raw",
:cache => "writeback"
libvirt.storage :file,
:size => "40G",
:size => "10G",
:type => "raw",
:cache => "writeback"
libvirt.storage :file,
:size => "40G",
:size => "10G",
: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

4298
log.log Normal file

File diff suppressed because it is too large Load Diff

View File

@ -49,6 +49,8 @@ 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
@ -69,7 +71,7 @@ done
# Deploy ceph on all nodes
$OUTPUT_LOG "Deploy ceph on all nodes"
ceph-deploy install --release luminous $NODES
ceph-deploy install --release octopus $NODES
# Create initial monitor
$OUTPUT_LOG "Create initial monitor"
@ -100,8 +102,9 @@ 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 --filestore --data /dev/vdb --journal /dev/vda1
ssh $NODE sudo ceph-volume lvm create --filestore --data /dev/vdc --journal /dev/vda2
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
done;
# wait 10 seconds and get cluster status

View File

@ -38,7 +38,7 @@ CEPH_ADMIN_USER="ceph-admin"
# Nodes
ADMIN_NODE="node-admin"
OSD_NODES="node-osd1 node-osd2"
OSD_NODES="node-osd1 node-osd2 node-osd3"
NODES="$ADMIN_NODE $OSD_NODES"
# Networks

View File

@ -41,10 +41,10 @@ export DEBIAN_FRONTEND=noninteractive
# Make sure we have the french locale
locale-gen fr_FR.UTF-8
# Install ceph repository (luminous version)
$OUTPUT_LOG "Install ceph repository (luminous version)"
# Install ceph repository (Octopus version)
$OUTPUT_LOG "Install ceph repository (Octopus version)"
wget -q -O- 'https://download.ceph.com/keys/release.asc' | apt-key add -
echo deb https://download.ceph.com/debian-luminous/ $(lsb_release -sc) main | tee /etc/apt/sources.list.d/ceph.list
echo deb https://download.ceph.com/debian-octopus/ $(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,6 +91,7 @@ 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"