CREATE HPC access to Cloud database¶
Attention
This approach is only suitable for processing non-sensitive data. The security of the database relies on a single password authentication step from any other CREATE user. For processing sensitive data please contact us about the CREATE Trusted Research Environment.
In this section we talk about how to setup a simple MariaDB (MySQL fork) database that can be accessed from the CREATE HPC cluster. This is intended to be a basic "Hello, World!" type example for building such integrations between HPC and Cloud sub-systems of CREATE.This is not a MySQL setup, administration or API interaction guide, further readings on those topics should be sought in line with your design goals.
- Follow the Instance Creation doc to create a new VM.
- On the VM
sudo apt update && sudo apt install -y mariadb-server
sudo systemctl start mariadb.service
sudo mysql_secure_installation
- enter for none
- n for set root password
- Y for everything else
- Setup your database, for example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
- Back in the OpenStack UI:
- 'Edit Security Groups' for your VM
- Click the + next to 'er_mysql_from_hpc'
- On your VM instance:
sudo vim /etc/mysql/mariadb.conf.d/50-server.cnf
- Change the variable
bind-address = 0.0.0.0
- On CREATE HPC:
module load py-mysql-connector-python
- You can then use python code within your submissions to interact with your database, e.g.:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|