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:
- Download and install https://my.vmware.com/web/vmware/free#desktop_end_user_computing/vmware_player/5_0] on your Windows/Linux PC (Use VMFusion on Mac)
- Start VMplayer and choose Import Virtual Machine from the File menu. Select the downloaded file.
- Select 'Options' and increase Virtual Memory to at least 2GB if your machine is powerful enough
- Select 'Play Virtual Machine'
- Log in on the console using the username vm and password musicbrainz
- Get the IP address of your virtual machine. Note this down from "inet addr" with this command:
ifconfig | grep eth0 -A 1NOTE: if eth0 is not configured correctly, perhaps you've encountered this problem.
- The MusicBrainz server starts automatically. Now you can reach the MusicBrainz server by pointing your browser to port 5000 of the IP address in step 5.
- e.g If your IP address from step 6 was: 10.1.1.104, then point your browser to http://10.1.1.104:5000
This VM comes "replication ready". To enable replication, and have the database catch up with the latest replication packets, do this:
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. Drop pre-filled database using command
and check the INSTALL.md file for how to import new data.
To turn on background replication, run:
to turn it off:
We recommend leaving replication off for the time being, until you've built search indexes for the VM.
Building search indexes
The VM comes with support to build search indexes. In order to build the indexes, log in to the account and then:
Depending on your machine, this may take quite a long time. We recommend that you leave this running overnight. After the indexes are complete, you should be able to carry out indexed searches in your VM.
Accessing the database
To access the main postgres database, you can do this:
sudo su - musicbrainz cd musicbrainz-server/admin ./psql 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);
then from the command line execute:
admin/psql READWRITE < admin/sql/CreateFKConstraints.sql admin/psql READWRITE < admin/sql/CreateFunctions.sql
TODO: The server will probably run out of disk space during this process. We need to add instructions on how to move the DB to a new partition.
Setup MusicBrainz Server from source code
This can potentially be a very laborious and time consuming method of getting a functioning MusicBrainz server. Using the virtual machine is recommended.
Get a copy of musicbrainz-server from git:
git clone --recursive https://github.com/metabrainz/musicbrainz-server.git musicbrainz-server cd musicbrainz-server
And follow the instructions in the INSTALL file.
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!
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).
- Git knowledge which will enable you to check out the source code.
As a developer the following knowledge/skills are beneficial:
- Apache, Perl, mod_perl, PostgreSQL and a number of perl modules.
- How to compile and install packages from source on a Linux box.
- How to patch existing packages, although we can help you out if you have questions about that.
Note: The server has never been ported to Windows, and we suspect that it would be a fair amount of work to make that happen.