Create a persistent database service on Grid'5000 (outdated)
Sep 1, 2015
Tagged with Grid5000 - Tutorial - Ceph - KVM
Introduction
Usually on Grid’5000, in order to deploy our own system we use Kadeploy.
The lifetime of the system is very short, the duration of the OAR job.
To keep system modifications, you need to update the deployed Kadeploy environment before the end of OAR job.
This is sufficient in most simple cases, but for systems hosting a lot of datas usable through multiple experiments, it’s not practical.
In this tutorial we will create a persistent system hosting a database, hosted on a node as a virtual machine with KVM.
This virtual machine will be stored on the Ceph distributed object store available at Rennes.
Manage your Ceph object store
Generate your Ceph Key and create an RBD pool
On Grid’5000 Ceph UI, click on Generate Ceph key (if no key appears) and create a Ceph pool name username_rbd.
Note : A replication size of 3 is required for a safe storage.
Create the virtual machine stored on a Rados Block Device
Deploy a Debian 8 environment
From host frontend.rennes.grid5000.fr :
Install and configure Ceph
Create a shell script deploy_ceph_client.sh on the frontend to install KVM, Ceph and configure Ceph access on the deployed node :
Note: This script will install ceph and qemu-kvm, and generate file /etc/ceph/ceph.conf and /etc/ceph/ceph.client.username.keyring.
From host frontend.rennes.grid5000.fr :
Create a Rados Block Device based on Debian 7 (Wheezy)
From host frontend.rennes.grid5000.fr :
From host parapide-9 :
Start the virtual machine
Configure Virtual Machine and MySQL
Set hostname
Here apt-get update command will fail because the system cannot resolve host proxy. SLIRP
does not send by default DNS search field. Add FQDN in /etc/hostname file will quickly solve the problem.
Log in as root/grid5000, and :
Connect through SSH
Shutdown the virtual machine and restart with port forwarding :
From host frontend.rennes.grid5000.fr :
Install and configure MySQL
Edit /etc/mysql/my.cnf, comment line bind-address = 127.0.0.1 and restart MySQL service :
Restart VM with MySQL port forwarding
Test
From host frontend.rennes.grid5000.fr :
Conclusion
Now you can use a persistent database during multiple experiments.
Network performances are not optimal in this KVM configuration, but it’s very simple to use.
Currently we need to deploy a node with Kadeploy to start the VM, but in a near future,
when production environment will be based on Debian 8 (Jessie), a simple oarsub ./start_mysql_vm.sh and the boot time of the virtual machine (few seconds) will be required.