MusicBrainz Server virtual machine

Running an NGS virtual machine requires some Linux knowledge, but it is vastly simpler than installing NGS from scratch. The pre-built virtual image can be imported into either VirtualBox or VMware. If you are using Amazon EC2 you can not use this virtual image and will instead have to follow the steps outlined in the source code INSTALL.md. To use the virtual machine instance, follow these steps:

Once Virtual Box has imported the appliance, select the imported virtual machine from the list of virtual machines and click on Start.

Once the instance has started up, log in on the console using the username musicbrainz and password musicbrainz. This account has sudo privileges -- if you would like to set a root password, you can do that via sudo.

Get the IP address of your virtual machine. Note this down from "inet addr" with this command:

ifconfig | grep eth0 -A 1

NOTE: if eth0 is not configured correctly, perhaps you've encountered this problem.

Optional: The console for Virtual Box is very slow. It may be faster to SSH into the virtual box with a good terminal program.

To start the NGS server, enter

~/run_server.sh

Now you can reach the MusicBrainz server by pointing your browser to port 5000 of the IP address in step 6.

If the server looks like it started correctly and you cannot connect in your browser, try pinging it from your host operating system command line

ping <inet addr>

If you cannot ping it, you may have a VirtualBox network configuration problem. Try the instructions here to switch your VM to using a bridged connection rather than NAT. Restart the virtual machine and find the new IP address in step 6 again. Start the MusicBrainz server again.

Troubleshooting

If you update the code base in an early version of the virtual server, you may encounter an error that complains about DEVELOPMENT_SERVER not being defined, please add this line to your lib/DBDefs.pm file:

sub DEVELOPMENT_SERVER { 1 }

And then start the server.

Running Replication

This VM comes "replication ready". To enable replication, and have the database catch up with the latest replication packets, do this:

~/run_replication.sh

This will load all of the changes to the database since the VM update.

NOTE: Loading replication changes might take a long time. If the VM is more than a couple of weeks old, it might be better for you to import a fresh data set. Check the INSTALL.md file for how to import new data.

Automating Replication

To automate this, add this script to a cron job that fires off 10 minutes after each hour. e.g.

Accessing the database

To access the main postgres database, you can do this:

cd ~/musicbrainz-server/admin
./psql READWRITE

to access the RAWDATA database (that also contains edits), use RAWDATA, instead of READWRITE. If you would like to access the DB from outside the virtual box, take a look at how to change postgres connection settings.

Turning the VM into development box

If you would like to use the VM to do development instead of using it as a simple database slave, you'll need to edit lib/DBDefs.pm and set REPLICATION_TYPE to RT_STANDALONE and run admin/psql READWRITE and execute the following queries:

DELETE FROM annotation WHERE editor > (SELECT max(id) FROM editor);
DELETE FROM release_annotation WHERE NOT EXISTS (SELECT 1 FROM annotation WHERE annotation.id = release_annotation.annotation);

Support

The setup process may look daunting, but please don't let this discourage you; the INSTALL is thorough and contains a lot of information, and we are willing to provide assistance. If you have questions about installing, join us in the #musicbrainz-devel IRC channel or post a question on the developers mailing list and we will attempt to help you out.

We recommend that you dive in and give it a try - who knows how far you'll get and what you might learn along the way!

Requirements

In order to set up a running MusicBrainz server with the full database you will need:

A linux box, preferably Ubuntu.

8GB of free disk space, (if you are a developer and only want the server code and database structure 2GB is more than enough).