MB virtual server connection to Tableau

Hi!

I have downloaded and installed the virtual image of MusicBrainz server on VirtualBox without much problem, but now I’m trying to connect Tableau to this database to visualize this data, and that’s not working.

The connection on Tableau is a standard connection to a PostgreSQL database (it gives you the option of that particular db so drivers should no be an issue), and I have use this tutorial to open connections on the virtual machine: http://www.cyberciti.biz/tips/postgres-allow-remote-access-tcp-connection.html.

But no connection, do anyone has been able to do this or something similar?

Thanks in advance!

You probably have a firewall enabled in the vmware image blocking postgresql.
ufw allow 5432/tcp ufw disable

Also check your networking settings in virtualbox,
You either need to use bridge networking or nat and enable port forwarding to allow you to connect to the machine.

The Postgres port is likely not accessible from the host OS. You’ll need to tell VirtualBox to forward port 5432 from the host OS to port 5432 on the guest OS in the network settings.

1 Like

There is no firewall running in the guest VM.

Thanks for all the help! great community.

After trying a couple of things, I think the problem is with Tableau. I can connect from the host to the db in the vm through pgadmin with no problem, but with Tableau PostgreSQL connector I still get an error:
Download and install the drivers, and then connect.

Detailed Error Message:

[iODBC][Driver Manager]dlopen({}, 6): image not found
[iODBC][Driver Manager]Specified driver could not be loaded
Unable to connect to the server "localhost". Check that the server is running and that you have access privileges to the requested database.

Thanks to all!

2 Likes

It finally worked… and it was related to the drivers… had to download the driver from here:
https://www.tableau.com/support/drivers#mac-postgres
And it worked! Weird that I didn’t have them right? they’re suppose to come by default with Tableau (??)

1 Like

Dear Cgaray,

I am trying to connect tableau to musicbrainz and I would appreciate any help you might be able to provide.

I have managed to get my VM machine running by following the instructions here:

https://musicbrainz.org/doc/MusicBrainz_Server/Setup

I was able to access the server on localhost:5000

But I am stuck what is the code I need to enter into VirtualBox to start the DB?

How do I connect Tableau to it after I have started it?

Any chance that you could give me some pointers. Maybe a step by step on the code I need to do and what to fill into the tableau fields to connect.

Server:
Port:
Database:
Authentication:
User:
Password:
Etc

I would really appreciate your help with this.

Thank you.

To get to the database you need to get through a few layers.
The database is running inside a docker container and is configured to allow the server to talk with it but does not expose the database to the host.
To expose this I believe you need to run:
bin/turn-port db on

At this point you have port 5432 exposed from docker to the vm but you also need to expose the vm to your host.
If your vm is configured to use nat (I believe this is the default) you need to get virtualbox to map port 5432 from the vm to port 5432 (or a port you choose) to the machine you are running the vm.

I don’t use the virtual box vm so i’m not not sure about the username and password but I assume it is the following:
User: musicbrainz
Password: musicbrainz
port: 5432
host: localhost
jdbc connection string: jdbc:postgresql://localhost/musicbrainz?user=musicbrainz &password=musicbrainz

3 Likes

Is this what you meant?

I am still getting this error from tableau

Unable to connect to the server. Check that the server is running and that you have access privileges to the requested database.
could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host “localhost” (::1) and accepting TCP/IP connections on port 5432? could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host “localhost” (127.0.0.1) and accepting TCP/IP connections on port 5432?
Unable to connect to the PostgreSQL server “localhost”. Check that the server is running and that you have access privileges to the requested database.

Any ideas ?

Your virtualbox settings look correct.

Can you try running the following to restart the database docker container.
docker-compose -f ~/musicbrainz/musicbrainz-docker/docker-compose.yml up -d db

1 Like

I finally got it to work. Did restart the database docker. But I also had the Database name incorrect. It worked with the following:

server: localhost
port: 5432 (also works with 15432, depending on how you setup your port forwarding… see screenshot above)

Database: musicbrainz

user: musicbrainz
password: musicbrainz

Hope this helps other people. Thanks a lot for your help @dns_server

1 Like

I assume it should bei localhost (with a lowercase “L” between a and h)?

1 Like

Thanks. I edited the reply.

1 Like