René Baron
René Baron

Reputation: 123

How can we access Bluemix hosted "Compose for MongoDB" service from "outside"?

Situation:
Have created today a new Compose for MongoDB Service instance in Bluemix
Need:
I have to access this MongoDB DIRECTLY with tools (eg. Mongo Managemant Studio Pro, mongo.exe, etc.) for bulkloading, testing, ad-hoc data fix, etc.
Problem:
I have not found any docs, samples nor a CLEAR statement that
a) gives me some confirmation that THIS is possible
b) gives me COMPLETE information (not just some technical fragments that might have worked year ago) how to do it.
Maybe I am looking to the wrong places or do not know the right people. However I am stuck on this, and before quitting Bluemix MongoDB maybe somebody has a copy/past solution or handson step by step manual. Any help welcome. Thanks!

Upvotes: 1

Views: 661

Answers (2)

Bashar Altakrouri
Bashar Altakrouri

Reputation: 10595

Connecting to MongoDB service in Bluemix from an application is possible. For this answer I have used the application "Robo3T" and here are the steps:

  1. Access your MongoDB Service on you Bluemix account. Usually under "Cloud Foundry Services"
  2. Open section "Manage", from "Connection Settings" copy from "HTTPS" the connection address and port. In this example "sl-eu-lon-2-portal.5.dblayer.com" and "20651" enter image description here
  3. In Robo3T create a new connection with the connection address from previous step enter image description here
  4. In tab Authentication configure database name, username and password enter image description here. The credentials are found as in step 1 enter image description here
  5. From "Connection Settings" copy the SSL Certificate into a text file and save locally. enter image description here
  6. In Robo3T Add the certificate to the connection in the "SSL" tab enter image description here
  7. Test the connection and save the settings

Upvotes: 1

René Baron
René Baron

Reputation: 123

Answer

YES, Bluemix hosted Compose for MongoDB instances can be connected from the mongo Shell and some updated DB Managment tools. However, you have to make sure, that in case you are running the newest DB versions, that your tools (shell and DB management GUIs) comply with the newest DB features such as encryption etc.

Origin of the Problem My problem was due to older and therefore incompatible versions of the mongo shell and DB-managment tools running against the newest MongoDB versions with their specialities on encription and multiple servers to be handled in the URI. At least two DB managment tools are not compatible with the newest DB version and will take their time to get fixed. The problem is, that both will not tell you about this. They just do not not connect. No logs on either side. Period. So my advise here: look for tool providers who express dedicated compliance with the specific version of your DB.

Advise to the Bluemix Team

It might not take much time to provide some sample connection strings for the most common tools like the mongo shell, MongoBooster, etc. to take the hassle and guesswork out of interpreting the Environment variables and figuring out what is needed for specific connection strings and what is not. For instance MongoDB Atlas hosting provides for every cluster readymade connection strings for many tools you can just copy/past and done! Connecting to Atlas took me 5 Minutes. For Bluemix I have lost hours! Not because it is complex, but because the documentation and the generated Info is somehow incomplete and messy - at least for the ones who do not connection strings for their living!

Upvotes: 1

Related Questions