The b0ardside

prosolar mechanics

Musicbrainz NGS install

Posted: May 5, 2011 | Author: Sideb0ard | Filed under: metadata, music, pain, sql | Leave a comment »

yow. must admit, I had to overcome a couple of obstacles during the installation and setup of a Musicbrainz Next Generation Schema replicated DB.

I’m not sure this will prove to be a particularly useful post, but I’ll post it up here as a record of my own, in case I need to do it again.

The NGS requires PostgreSQL 9 and a bunch of perl modules be installed.

Initially I started with a PSQL9.1 beta binary provided by EnterpriseDB, however later ran into problems with missing  user contributed modules for Cube, a “Multidimensional-cube datatype”. After much faffing about I just removed the binary install, then grabbed the sources and compiled PSQL9 from source. Mostly quite simple except for one issue,

undefined reference to `optreset’

Fixed via installing libreadline6-dev (I’m running Ubuntu 11.04 on x86_64). Also had to make clean, before it would then compile and install.

After it’s installed, you’ll need to do all the standard post-install steps – create system user, init DB, start server etc. (Follow the INSTALL file in the source dir, under the ‘Getting Started’ section).

In order to install the contrib/cube modules, from the postgres9 source dir:

cd contrib/
make
cd cube
sudo make install
cp sql/cube.sql /usr/local/pgsql/share/contrib/ <- required for musicbrainz install later..

Once you have the postgres server up and running, su to the postgres user you’ve created and create a user to own the musicbrainz DB you’ll be creating. Depending on your security requirements you might want to alter this next line, i set options to allow the musicbrainz user to create DBs, but not be a superuser or create other roles, with this line:

createuser -d -S -R musicbrainz -P

Next create a system user to own and run the musicbrainz-server software. I simply named the account ‘musicbrainz’ too.

For the actual NGS Server setup, you can find the provided Setup instructions here, most of what I type in the next section will be a repeat of them:

Launch CPAN shell:

cpan>
Install local::lib
install App:cpanminus

Exit cpan then install some more modules via apt:
apt-get install libossp-uuid-perl
apt-get install libtest-www-mechanize-perl
apt-get install libicu-dev

Then grab the musicbrainz-server from git (you might need to install git first)
git clone git://git.musicbrainz.org/musicbrainz-server.git musicbrainz-server
cd musicbrainz-server
cpanm .

Barfs at Module-signature – you have to install a specific version:

cpanm http://search.cpan.org/CPAN/authors/id/F/FL/FLORA/Module-Signature-0.66.tar.gz
Rerun: cpanm .

I had to manually install Test::WWW::Selenium::Catalyst via CPAN as it was launching Firefox to do *something* but just hanging there. Also manually installed Cache::Memcached::Fast as it was failing due to the Musicbrainz DB not being installed yet. duh!

Next, download the NGS SQL tables we’ll be importing:
wget ftp://ftp.musicbrainz.org/pub/musicbrainz/data/ngs/20110427/mbdump.tar.bz2
wget ftp://ftp.musicbrainz.org/pub/musicbrainz/data/ngs/20110427/mbdump-editor.tar.bz2
wget ftp://ftp.musicbrainz.org/pub/musicbrainz/data/ngs/20110427/mbdump-derived.tar.bz2

cp lib/DBDefs.pm.default lib/DBDefs.pm
vi lib/DBDefs.pmlib/DBDefs.pm

Change sub REPLICATION_TYPE { RT_SLAVE } // (WAS RT_STANDALONE)
Change sub DB_STAGING_SERVER { 0 } // (WAS 1)

Amend the login details to the musicbrainz DB user you created.

Install postgresql-unaccent (under the musicbrainz-server directory – just make and make install)
Do the same for postgresql-musicbrainz-collate

Finally with all supporting modules installed, su to the musicbrainz system user. Ensure you can login to the postgres9 DB, using the same details you have entered in the DBDefs.pm file. Then, from the musicbrainz-server directory:

./admin/InitDb.pl –createdb –import <DIR-WHERE-YOU-DOWNLOADED-DUMPFILES>/mbdump*.tar.bz2 –echo

If all is successful, in about 30mins you should have a working MusicbrainzDB up and running. If you encounter any error messages, and need to re-run InitDb, you’ll first need to login to postgres and drop the two DBs it has installed - musicbrainz_db and musicbrainz_db_raw, but hopefully I think i’ve covered all the errors I ran into..

 


Contact

thorsten@theb0ardside.com
twitter
GitHub
Last.fm
Goodreads

Other sites:
Drawing B0ard
Highpoint Lowlife

Feeds

  • Entries RSS
  • Comments RSS

Recent Posts

  • Test-Driven Chef
  • Netflix OSS
  • jedberg talk at Airbnb
  • PostgreSQL on AWS
  • Grizzled

Archives

  • May 2013
  • April 2013
  • February 2013
  • January 2013
  • December 2012
  • November 2012
  • October 2012
  • September 2012
  • August 2012
  • July 2012
  • June 2012
  • May 2012
  • April 2012
  • March 2012
  • February 2012
  • January 2012
  • December 2011
  • November 2011
  • October 2011
  • September 2011
  • August 2011
  • July 2011
  • June 2011
  • May 2011

Categories

  • abstraction
  • apple
  • aws
  • big data
  • chef
  • cloud
  • comic
  • communications
  • configuration management
  • cryptography
  • cybernetics
  • database
  • debian
  • devops
  • distribution
  • drawing
  • engineering
  • future
  • hacking
  • hadoop
  • hardware
  • history
  • howto
  • http
  • ideas
  • infographic
  • information
  • internet
  • java
  • javascript
  • language
  • logging
  • math
  • metadata
  • military
  • music
  • networking
  • openstack
  • pain
  • people
  • performance
  • perl
  • personal
  • physic or surgery
  • postgresql
  • programming
  • puppet
  • real-time
  • resiliency
  • sci-fi
  • science
  • scsi
  • security
  • simulator
  • skate
  • speculation
  • spoof
  • sql
  • storage
  • TCP/IP
  • twitter
  • Uncategorized
  • unix
  • vagrant
  • video
  • virtualization
  • visualization
  • vmware
  • web
  • xen
Proudly powered by WordPress Theme: Clean Home by Mid Mo Design.