I just set up the VirtualBox MB server and have a few questions

Hi guys, I am 100% new to these virtual machine computers, so I had to do quite a bit of learning until I reach the point where things are working.

Now I have two questions, which I hope the experts enlighten me by answering.

1-) Why is it necessary for us to create this virtual machine inside our computer to set up a MB server mirror on our computer? Couldn’t it be accomplished much simpler with an ordinary program/software, instead of having to resort to this complicated virtual machine concept? What are the advantages of having this virtual machine emulating an Ubuntu OS in our computers and running “parallel” to them? Note this is not a critique, it’s just a question, I know nothing about this.

2-) Once we set up our MB server mirror we can run queries on it using PostgreSql (really glad I know SQL well, from working with Oracle, SSMS and even SAS, otherwise I wouldn’t get past this step). The question is, why can’t I run psql pointing to the actual MB server instead of the one I just set up? What is the advantage of running a Sql query on the “local” server I set up instead of the actual remote MB server?

1 Like

The advantage of a VM is you have the applications and everything installed as well as a populated database as a starting point.

You have several options on setting up a database:

  • Run the prebuilt vm
  • Run the docker containers manually
  • Download and install the server software manually on linux without using docker.
  • use mbdata (previously called mbslave) and create your own replica database.

Allowing anyone around the world to run queries against a database is a bad idea.
You can bring any database to it’s knees by locking a table and not giving it up.

4 Likes

I was hoping more for an answer that explains it from the very beginning, an answer tailored to someone who is a newbie at virtual machines and such.

How can you explain that to a layperson? Why can’t I run Sql queries pointing to the actual Db, instead I have to have a supersized 22GB file on my hard drive, which becomes an input into this VirtualBox thing, and from there you use it like it actually weren’t on your computer, but remote on the internet? It’s actually on my computer, we’re just making believe that I’m accessing remote data on a remote server.

You are sitting on a computer.
A virtual machine is a program pretending to be a computer and has it’s own network settings.
Inside that there is something called docker that is something similar to a virtual machine and has it’s own network settings.
So one of those docker containers is where your postgres database is.

So to talk to the database we need to get through these 2 layers of networking.

On the virtualbox side there are a few options:

  • Bridged - Pretend to be a real pc on your network.
    This can be good but you need to reconfigure the network of the vm to get this to work and you are likely to have problems.
  • NAT - how your home network is set up, the vm can go out but you cannot go in but you can map ports.
    This is the easiest and least likely to cause a problem, you just need to map port 5432 to 5432 in the vm.

You then need to start the vm and enable database access from docker.
This maps port 5432 from the vm to 5432 to the docker container.

Point your client to port 5432 on localhost and it should go from host > vm> docker and connect to the database.

4 Likes

Thanks, now I just need to know how to write queries that make sense. I just figured out how to run pgAdmin, if you have some queries of your own that pull artist, title, year, genre, etc., please let me know.

There are so many tables, it’s insane.

One of the reasons to set up your own local copy is the rate limiting that prevents too many queries on a very short time against the official MB server.

Another reason is the possibility to expand such a local database with whatever data you like (which you can’t enter to the official site), like a link to your local saved music tracks.

2 Likes

@jrsousa2: a simpler way to get MusicBrainz data would be to query the web service, see: https://musicbrainz.org/doc/Development/XML_Web_Service/Version_2

1 Like