Install mongodb bi connector linux

Docs HomeMongoDB Connector for BI

Note

The MongoDB Connector for BI and associated utilities are compatible with all currently supported MongoDB server versions.

To set up MongoDB Connector for BI with a business intelligence tool such as Tableau, follow the steps on this page.

  • OpenSSL installed on your host.

To verify OpenSSL is installed on your system, run the following command:

dpkg -l | grep -i openssl

If OpenSSL is not installed, use your package manager to install it.

If your MongoDB instance uses authentication, your BI Connector instance must also use authentication. The user that connects to MongoDB via the mongosqld program must have permission to read from all the namespaces you wish to sample data from.

For more details about MongoDB user permissions in BI Connector, see User Permissions for Cached Sampling.

  1. Extract the .tar archive you downloaded.

    tar -xvzf mongodb-bi-linux-{arch}-{platform}-{version}.tgz

  2. Install the programs within the bin/ directory into a directory listed in your system PATH.

    sudo install -m755 bin/mongo* /usr/local/bin/

    If a prior version exists, overwrite the binaries.

New in version 2.9.

To help you get started, a sample mongosqld configuration file named example-mongosqld-config.yml is included with the installation package. To learn how to start BI Connector with a configuration file, refer to the mongosqld documentation section on the Configuration File.

You are now ready to launch the BI Connector. The following guide contains detailed information on BI Connector configuration, schema generation, and launch options:

  • Launch BI Connector

Docs HomeMongoDB Connector for BI

Note

The MongoDB Connector for BI and associated utilities are compatible with all currently supported MongoDB server versions.

The MongoDB Connector for BI can be installed on premises or hosted in MongoDB Atlas. Follow the guide for your platform below to install the BI Connector, or see Enable BI Connector in Atlas.

Install BI Connector on WindowsInstructions for installing the BI Connector on Windows systems.Install BI Connector on macOSInstructions for installing the BI Connector on macOS systems.Install BI Connector on Red Hat Enterprise-based LinuxInstructions for installing the BI Connector on RHEL-based systems.Install BI Connector on Debian-based LinuxInstructions for installing the BI Connector on debian-based systems.

To update your BI Connector, use the installation guides above to install the latest version of BI Connector for your platform, replacing your existing installation.

As part of an innovation project, I had to develop an analytics dashboard for a data storage in MongoDb. I found an interesting component to achieve my goal and this is Mongo BI Connector.

According to documentation there is no release for Ubuntu 18.04 😢, so we are gonna try to install another version compiled for Ubuntu 16.04. First of all we need to create a folder in which we are going to store Mongo BI Connector binaries, let’s start:

root@mongo-master:~/bin# mkdir ~/bin&&cd ~/bin

Then we are going to download Mongo BI Connector binaries

root@mongo-master:~/bin# wget https://info-mongodb-com.s3.amazonaws.com/mongodb-bi/v2/mongodb-bi-linux-x86_64-ubuntu1604-v2.12.0.tgz

And then we are going to unpack this file:

root@mongo-master:~/bin# tar -xvzf mongodb-bi-linux-x86_64-ubuntu1604-v2.12.0.tgz

We need to install Mongo BI Connector in a folder that must be in $PATH environment, so we are going to check which folder is available:

root@mongo-master:~/bin# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

As we can see, /user/local/bin is a valid path, so let’s use this location to install the connector:

root@mongo-master:~/bin# cd mongodb-bi-linux-x86_64-ubuntu1604-v2.12.0/
root@mongo-master:~/bin/mongodb-bi-linux-x86_64-ubuntu1604-v2.12.0# install -m755 bin/mongo* /usr/local/bin/

Let’s test if connector was successfully installed by running mongosqld command, the output must be:

root@mongo-master:~/bin/mongodb-bi-linux-x86_64-ubuntu1604-v2.12.0# mongosqld
2019-10-16T15:56:42.723-0600 I CONTROL [initandlisten] mongosqld starting: version=v2.12.0 pid=15246 host=mongo-master
2019-10-16T15:56:42.723-0600 I CONTROL [initandlisten] git version: 60455768a9057952689b6a02b344aeac55a72091
2019-10-16T15:56:42.723-0600 I CONTROL [initandlisten] OpenSSL version OpenSSL 1.0.2n 7 Dec 2017 (built with OpenSSL 1.0.2g 1 Mar 2016)
2019-10-16T15:56:42.723-0600 I CONTROL [initandlisten] options: {}
2019-10-16T15:56:42.723-0600 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for mongosqld.
2019-10-16T15:56:42.723-0600 I CONTROL [initandlisten]
2019-10-16T15:56:42.727-0600 I NETWORK [initandlisten] waiting for connections at 127.0.0.1:3307
2019-10-16T15:56:42.727-0600 I NETWORK [initandlisten] waiting for connections at /tmp/mysql.sock

TIP AND TRICKS 🚀🤔

Connection refused

If you got a message like this:

2019-10-16T15:57:12.728-0600 E NETWORK    [initandlisten] unable to load MongoDB information: failed to create admin session for loading server cluster information: unable to execute command: server selection error: server selection timeout
current topology: Type: Unknown
Servers:
Addr: localhost:27017, Type: Unknown, State: Connected, Average RTT: 0, Last error: connection() : dial tcp 127.0.0.1:27017: connect: connection refused

Don’t worry, it is because you have a binding IP that is not 127.0.0.1 and we can solve this by using a configuration file like this:

systemLog:
path: '/logs/mongosqld.log'
mongodb:
net:
uri: "mongo.example.com:27017"

Here we need to specify a path for system logs and our binding IP but, how do we know which IP is mongo using? If you follow default Mongo Db instructions there must be a file named /etc/mongod.conf and here we can get Mongo binding IP, running the following command:

root@mongo-master:~/bin/mongodb-bi-linux-x86_64-ubuntu1604-v2.12.0# cat /etc/mongod.conf#... CONFIGURATION INFO....# network interfaces
net:
port: 27017
bindIp: 192.136.9.125
#... MORE CONFIGURATION INFO....

And then we are going to create our Mongo BI Connector configuration file (be careful where you are going to create this file):

root@mongo-master:~/bin/mongodb-bi-linux-x86_64-ubuntu1604-v2.12.0# mkdir ~/conf&&cd ~/conf
root@mongo-master:~/conf# touch mongosqld.conf

And then let’s use nano or your preferred editor to add our configuration content:

#-------- ~/conf/mongosqld.conf ---------systemLog:
path: '/logs/mongosqld.log'
mongodb:
net:
uri: "192.136.9.125:27017"

🛑 WARNING: path for systemLog must exists, if not create it by executing mkdir /logs

Now let’s test our installation by passing config parameter to mongosqld :

mongosqld --config=~/conf/mongosqld.conf

To verify if everything is running successfully, let’s check our logs:

root@mongo-arbiter:~/conf# cat /logs/mongosqld.log
log output directed to /logs/mongosqld.log
2019-10-16T17:04:47.166-0600 I CONTROL [initandlisten] mongosqld starting: version=v2.12.0 pid=20261 host=mongo-arbiter
2019-10-16T17:04:47.166-0600 I CONTROL [initandlisten] git version: 60455768a9057952689b6a02b344aeac55a72091
2019-10-16T17:04:47.166-0600 I CONTROL [initandlisten] OpenSSL version OpenSSL 1.0.2n 7 Dec 2017 (built with OpenSSL 1.0.2g 1 Mar 2016)
2019-10-16T17:04:47.166-0600 I CONTROL [initandlisten] options: {config: "/root/conf/mongosqld.conf", systemLog: {path: "/logs/mongosqld.log"}, mongodb: {net: {uri: "192.136.9.125:27017", auth: {source: "admin"}}}}
2019-10-16T17:04:47.166-0600 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for mongosqld.
2019-10-16T17:04:47.166-0600 I CONTROL [initandlisten]
2019-10-16T17:04:47.168-0600 I NETWORK [initandlisten] waiting for connections at 127.0.0.1:3307
2019-10-16T17:04:47.168-0600 I NETWORK [initandlisten] waiting for connections at /tmp/mysql.sock
2019-10-16T17:04:47.172-0600 I SCHEMA [sampler] sampling MongoDB for schema...
2019-10-16T17:04:57.892-0600 I SCHEMA [sampler] mapped schema for 83 namespaces:
....

Installing as a service 🐱‍👤

If you want to install Mongo BI Connector as a service just run the following commands (💡 if you do not have a configuration file, just ignore config parameter)

root@mongo-arbiter:~/conf# mongosqld install --config ~/conf/mongosqld.conf

And finally to start the service and running at startup let’s execute:

root@mongo-arbiter:~/conf# systemctl start mongosql.serviceroot@mongo-arbiter:~/conf# systemctl enable mongosql.service

Connecting to a replica set

You could use a configuration file like this:

systemLog:
path: '/logs/mongosqld.log'
mongodb:
net:
uri: "mongodb://192.136.9.125:27017,192.136.9.126:27017/?replicaSet=MEDIUM_COM"

🤠 Final notes

I don’t speak English natively, sorry for any mistakes. Suggestions are welcome!

How do you install a bi connector?

Install the BI Connector.
Run the downloaded . msi file..
Follow the wizard instructions to install the files. The binaries install into a bin directory inside the installation directory. If a prior version exists, you might need to configure your system services to launch the new installation..

How do I run a MongoDB BI connector?

Quick Start Guide for Windows.
Start a local MongoDB mongod process..
Start a local BI Connector mongosqld process..
Install the ODBC driver and create a data source name (DSN).
Connect with a BI tool of your choice..

Is the connector for BI available for MongoDB community?

Yes the BI Connector is part of the Enterprise version, however as a community user you can use the BI Connector as an evaluation. Details are in the LICENSE file when you install the BI Connector. Alternatively you can use the BI Connector through MongoDB Atlas.

How does tableau connect to MongoDB?

Start Tableau and under Connect, select MongoDB BI Connector. For a complete list of data connections, select More under To a Server..
Enter the name of the server..
If MongoDB authentication is enabled, enter your user name with associated database name, and password..