Azure Setup

Setting up MonetDB in Azure

When creating your MonetDB instance, make sure that it has at least the following items as its Inbound rules (the image has been configured to do this automatically. You can verify this in the "Networking" settings of your VM):

a. Service: SSH, Port: 22, Protocol TCP, Source "My IP", Destination: Any, Action: Allow

Connecting to the VM using SSH

To connect to your Azure instance via SSH, type in your terminal:

ssh -i <.pem ssh key> <azureuser>@<Public IP address>

NOTE: the first time you log in, you MUST add the current user to the monetdb group using the following command:

sudo usermod -a -G monetdb $USER

To take effect you MUST exit from the current session and log in again.

Create and start a database

MonetDB uses a concept called dbfarm, which is a directory that can contain multiple databases.

The MonetDB daemon program monetdbd manages one dbfarm at the same time. To communicate with monetdbd, one can use its client program monetdb. For more information regarding monetdbd and monetdb, and server setup visit the Server Setup and Configuration page.

When your MonetDB instance is first started, monetdbd is already running in the background serving a dbfarm at the default location /var/monetdb5/dbfarm. So, you can immediately create and start your first database with the following commands:

monetdb create <database name>
monetdb start <database name>

By default, such a newly created database is started in the "maintenance" mode so that the DB admin can configure the database (e.g. change admin password and create user accounts). While in this mode, the database is only accessible by the MonetDB superuser monetdb on the local machine.

To login to the database, you can use mclient, which is a client program of MonetDB and is available by default on your MonetDB instance:

mclient -u monetdb -d <database name>
password:<monetdb>

By default, the password for the MonetDB superuser monetdb is also monetdb. So, it is strongly recommended to immediately change this default password, which can be done in the mclient console using the SQL command:

ALTER USER SET PASSWORD '<new password>' USING OLD PASSWORD 'monetdb';

Once the database is set up, the DB admin can release the database so that other users can connect to this database:

monetdb release <database name>

To lock a database (again) for maintenance:

monetdb lock <database name>
monetdb stop <database name>
monetdb start <database name>

Release and lock can be done on a running database. It takes effect on new client connections. Therefore, in the commands above, we lock and restart the database to ensure no other users are still connected to the database.

A comprehensive guide can be found at Tutorial page.