How to run mongodb bi connector as a kubernetes pod

1/28/2019

I am able to run mongosqld locally and connect Tableau Desktop to my mongo database. The mongo database is running as pod in Amazon EKS. However when I create a pod for the mongodb bi connector and run the mongosqld command inside the pod, I am not able to connect Tableau Desktop to my mongo database pods. I do have a LoadBalancer for the mongodb bi connector and I am able to ping the loadbalancer. I am new to K8 and I am not sure how to troubleshoot this.

This is the command I used:

mongosqld --mongo-uri "mongodb://internal-somerandommongouri.us-west-2.elb.amazonaws.com:27017/?connect=direct" --mongo-username username --mongo-password password --auth --addr 0.0.0.0:3307

Below is my load balancer yaml config

apiVersion: v1
kind: Service
metadata: 
  annotations: 
    service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0
  name: mongodb-bi-connector
  namespace: default
  labels:
    name: mongodb-bi-connector
spec: 
  ports: 
    - 
      port: 3307
      targetPort: 3307
  selector: 
    role: mongodb-bi-connector
  type: LoadBalancer

Here is the error message from Tableau Desktop:

An error occurred while communicating with MongoDB BI Connector.

The connection to the data source might have been lost. [MySQL][ODBC 5.3(w) Driver]Lost connection to MySQL server at 'reading initial communication packet', system error: 0 Unable to connect to the MongoDB BI Connector server "internal-somerandommongouri.us-west-2.elb.amazonaws.com". Check that the server is running and that you have access privileges to the requested database.

-- Barsha
kubernetes
mongodb

0 Answers