Difference between revisions of "NGS Server Setup"

From MusicBrainz Wiki
Line 41: Line 41:
 
# Install app::cpanminus as you see fit (either using regular CPAN, installing to the local::lib directories, or using your package manager)
 
# Install app::cpanminus as you see fit (either using regular CPAN, installing to the local::lib directories, or using your package manager)
 
# Get a copy of musicbrainz-server from git: git clone git://git.musicbrainz.org/musicbrainz-server.git musicbrainz-server
 
# Get a copy of musicbrainz-server from git: git clone git://git.musicbrainz.org/musicbrainz-server.git musicbrainz-server
 +
# <code>cp lib/DBDefs.pm.default lib/DBDefs.pm</code>
 +
# Edit lib/DBDefs.pm to set proper values for MB_SERVER_ROOT, WEB_SERVER, DEVELOPMENT_SERVER, and REPLICATION_TYPE. (DEVELOPMENT_SERVER should probably be changed to be set to 1)
 
# Make sure the proper environment variables for local::lib are set (PERL5LIB, PERL_MM_OPT, MODULEBUILDRC, and PATH)
 
# Make sure the proper environment variables for local::lib are set (PERL5LIB, PERL_MM_OPT, MODULEBUILDRC, and PATH)
 
# Install OSSP::uuid separately using the packages at http://www.ossp.org/pkg/lib/uuid/ or using your package manager (Debian/Ubuntu instructions in INSTALL)
 
# Install OSSP::uuid separately using the packages at http://www.ossp.org/pkg/lib/uuid/ or using your package manager (Debian/Ubuntu instructions in INSTALL)
Line 47: Line 49:
 
# <code>cpanm .</code>
 
# <code>cpanm .</code>
 
# As of 2011-04-27, cpanm chokes on Method::Signature 0.67 -- use <code>cpanm http://search.cpan.org/CPAN/authors/id/F/FL/FLORA/Module-Signature-0.66.tar.gz</code> and restart <code>cpanm .</code> if this applies to you
 
# As of 2011-04-27, cpanm chokes on Method::Signature 0.67 -- use <code>cpanm http://search.cpan.org/CPAN/authors/id/F/FL/FLORA/Module-Signature-0.66.tar.gz</code> and restart <code>cpanm .</code> if this applies to you
# finish installation using instructions in INSTALL (the dependencies are installed, or should be)
+
# eventually this will move past installing dependencies, at which time it'll likely fail on you. As long as all the dependencies are installed, you're set to continue.
 +
# follow the instructions in INSTALL on creating the database
 +
# <code>./script/musicbrainz_server.pl -r</code>
 +
 
 +
Note that you won't have a search server after running this, meaning all your searches from the top bar will fail; you can fix this by not using that bar and instead using the Search page, and hitting the "direct search" checkbox. Or you could try to install a search server, but that's beyond the scope of this document.
  
 
[[Category:Products]] [[Category:Server]]
 
[[Category:Products]] [[Category:Server]]

Revision as of 20:04, 6 May 2011

Products > MusicBrainz Server > NGS Server Setup

Next Generation MusicBrainz Server

To set up a Next Generation Schema (NGS) MusicBrainz server, you can choose to download and setup a virtual machine image of NGS or you can install the server into your own Linux instance.

MusicBrainz NGS Virtual Server Image

Running an NGS virtual machine requires some Linux knowledge, but it vastly simpler than installing NGS from scratch. To use the virtual machine instance, follow these steps:

  1. Start downloading the latest virtual machine instance. Beware: This is a large (3.8Gb) download!
  2. Download and install Virtual Box on your machine.
  3. 7Unzip the virtual machine instance. If you don't have a 7unzip program, download one.
  4. (optional) The md5sum for the .ova appliance file is: 7f587a8fd1682eb2b8edae9f3ea0dbb5
  5. Start Virtual Box and choose Import Appliance from the File menu. Select the newly unzipped file that ends in the .ova extension.
  6. Once Virtual Box has imported the appliance, select the imported virtual machine from the list of virtual machines and click on Start.
  7. 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 passwd, you can do that via sudo.
  8. Run ifconfig and look at the inet addr for eth0. This is the IP address of your virtual machine. Note this IP address.
  9. Optional: The console for Virtual Box is very slow. I find it faster to SSH into the virtual box with a good terminal program.
  10. To start the NGS server, enter these commands:
musicbrainz@clear:~$ cd musicbrainz-server/script
musicbrainz@clear:~/musicbrainz-server/script$ ./musicbrainz_server.pl -r

Now you can reach the MusicBrainz server by pointing your browser to port 3000 of the IP address in step 7. If your IP address from step 7 was: 10.1.1.104, then point your browser to http://10.1.1.104:3000

Troubleshooting

If you update the code base in this 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.

Setting up MusicBrainz NGS from source code

(First note: your mileage may vary -- this is one way, that works for some people; it's especially good if your package manager doesn't have all the perl dependencies for musicbrainz-server. However, it's possible it won't work for you at all!)

  1. Install local::lib (See http://search.cpan.org/~apeiron/local-lib-1.008004/lib/local/lib.pm for details on local::lib and one way to install it ("The bootstrapping technique"))
  2. Install app::cpanminus as you see fit (either using regular CPAN, installing to the local::lib directories, or using your package manager)
  3. Get a copy of musicbrainz-server from git: git clone git://git.musicbrainz.org/musicbrainz-server.git musicbrainz-server
  4. cp lib/DBDefs.pm.default lib/DBDefs.pm
  5. Edit lib/DBDefs.pm to set proper values for MB_SERVER_ROOT, WEB_SERVER, DEVELOPMENT_SERVER, and REPLICATION_TYPE. (DEVELOPMENT_SERVER should probably be changed to be set to 1)
  6. Make sure the proper environment variables for local::lib are set (PERL5LIB, PERL_MM_OPT, MODULEBUILDRC, and PATH)
  7. Install OSSP::uuid separately using the packages at http://www.ossp.org/pkg/lib/uuid/ or using your package manager (Debian/Ubuntu instructions in INSTALL)
  8. Install Test::WWW::Mechanize separately, probably from a package manager
  9. cd musicbrainz-server
  10. cpanm .
  11. As of 2011-04-27, cpanm chokes on Method::Signature 0.67 -- use cpanm http://search.cpan.org/CPAN/authors/id/F/FL/FLORA/Module-Signature-0.66.tar.gz and restart cpanm . if this applies to you
  12. eventually this will move past installing dependencies, at which time it'll likely fail on you. As long as all the dependencies are installed, you're set to continue.
  13. follow the instructions in INSTALL on creating the database
  14. ./script/musicbrainz_server.pl -r

Note that you won't have a search server after running this, meaning all your searches from the top bar will fail; you can fix this by not using that bar and instead using the Search page, and hitting the "direct search" checkbox. Or you could try to install a search server, but that's beyond the scope of this document.