I am new to the MongoDB and MongoChef and connecting to the MongoDB server which is not local and is setup on some remote server(for which i do not require any VPN or visual network) using the MongoChef client.
When i pass the IP in the MongoChef's New Connection tab, the "Test Connection" button return all "OK" status as follows:
But in the main window of mongochef it is not showing any collection or database. Here is the screen shot:
I tried connecting to the server from the terminal and it is connecting well. I can do ping and telnet to the server well.
I am not getting where is the problem?
The problem was with the authentication, so i needed to edit the connection and add the authentication parameters viz username, password and database name as specified in the following screenshot
Making the above changes solved the issue for me. But still, i am not sure why was the previous connections giving test OK status.
Related
I'm new to MongoDB, and I have a MongoDB instance on an AWS server. I want to access it using Compass Interface, but I don't want to open 27017 port on the firewall, I want to connect with SSH tunnel option.
So I clicked "Fill in connection fields individually" option on Compass, and then clicked on "More Options" tab and selected SSH Tunnel : Use Identity File option
Entered server address, user and selected the PPK file as in the picture below:
When I click "Connect", Compass freezes for 1-2 seconds and a red line shown on the top as below picture saying:
An error occurred while loading navigation: command hostInfo requires
authentication
On MongoDB, I have a user with name "admin" and it has a password. As far as I understand, Compass successfully connected to the server over SSH, but can't connect to the database because the database password required for it.
I don't see any place on Compass to enter the DB user and password,
how can I make Compass connect to a database?
The Goal
I need to get data from a MongoDB updated every 15 minutes to use to build into a PowerBI report.
The Gear
I am connected from my windows machine via ssh to an RHEL server (server a). This server is running powerbi connector (SQLD) which is connected to my MongoDB that is running on a different server (server b). I'm also running MySQL on server b. My powerBI connector is installed on server b.
Exactly where I'm at
I am using the steps listed here (and all the associated pages) and have tried everything listed short of writing a config file, as the fact that things are working on mongosqld's end makes me think I don't need it... and if I can't get it working manually, having a config file won't exactly help.
https://docs.mongodb.com/bi-connector/current/connect/powerbi/
Using:
mongosqld --mongo-uri="mongodb://10.xxx.xxx.xx" --auth --mongo-username="ThisGuy" --mongo-password="test"
I successfully map the schema and show an active connection in the command window. I can also access my database from compass using an authorization enabled URL.
When I set up an ODBC connector I use the IP of server a, the user and password from my url, and port 3307. Nothing shows up in the dropdown, when I click 'test' I get the following message:
Connection Failed
[MongoDB][ODBC 1.4(w) Driver]Can't connect to MySQL server4 on '10.xxx.xxx.xxx' (10060)
I have also tried 3306, 27017, and 27015. Just to be safe I also added firewall rules for all traffic on these ports. I've tried this many times, including (just for the hell of it, and I'm kind of new to this stuff) the ip of server b, the ip of my machine, the credentials for MySQL, basically any combination of these things that I can think of.
In powerBI, my odbc driver shows up, and when selected in the dropdown, it asks for a username and password. I have tried both mongo credentials and MySQL. Not sure which I should be using?
regardless, I get the following error inside PowerBI:
Details: "ODBC: ERROR [HY000] [MySQL][ODBC 1.4(w) Driver]Can't connect to MySQL server on '10.xxx.xxx.xxx' (10061)
ERROR [HY000] [MySQL][ODBC 1.4(w) Driver]Can't connect to MySQL server on '10.xxx.xxx.xxx' (10061)"
Thoughts
I don't control either server, although I have root access, being new to this tech and company I am wary of screwing anything up that a co-worker will have to fix. I read in a different SO thread that maybe I need to downgrade the version of MySQL that is running on the server and that it could fix the problem, but I don't think that it will actually help and am afraid I might screw up something else on the server if I do this:
The C Authentication plugin was developed against MySQL 5.7.18 Community Edition (64-bit), and tested with MySQL 5.7.18 Community Edition and the latest version of MongoDB Connector for BI. The plugin is not compatible with MySQL Server or Connector/ODBC driver version 8 and later.
https://dba.stackexchange.com/questions/219550/access-denied-when-connecting-to-mongosqld-with-mysql
Maybe the problem is that server B is listening to server a on port 3307, and that there is another unknown port (not mentioned above) that my ODBC driver must be listening to? I'm not sure how to test for this when you get a step away like this.
So that's it. I'm really stuck and would love some help, I am going to try the downgrade tomorrow if nothing else shakes loose and will keep this thread updated.
Thank you for reading
I try to connect with MongoDB Compass via ssh tunnel.
It worked before but now when I do it, it always connects to my local MongoDB instance instead of my remote one. Please have a look at the pictures below which show my settings. pretty sure it was also before like this but somehow now it connect to the wrong DB. When I connect manually via ssh (using exactly those credentials) I can see that the data is different.
What am I missing here?
connection
connection2
Every time I try to connect to MongoDB Atlas cluster, Compass gets stuck in some never-stop-loading bug.
There is no error of any kind, not even in dev-tools.
If I try to connect to localhost, everything works fine.
Atlas connection string is never recognized automatically, if that means something.
I need to paste it manually, and after I click connect, white overlay is shown and that's it.
I disabled firewall, reinstalled mongoDb from my computer, tried to restart service couple of times ...nothing helps.
White overlay after clicking on connect:
ps. I have a cluster created, with mongoDB user and white-listed my IP.
pps. compass version is 1.20.5, windows 10
Sorry I just figured it out.
You need to go to "Connect" in Atlas, go to "Connect Your Application" (NOT "Connect with MongoDB Compass")
Change Node.js version to "2.2.12 or later"
Copy connection string as normal, replace password and paste in Compass
Edit: I've come up with even more details - the underlying problem could be your DNS. Try to replace it with the Google DNS for example (8.8.8.8) to see if it fixes the issue and continue using the up-to-date connection string.
It could be a permissions thing, try running as administrator.
I would recommend:
Uninstalling/Installing the latest MongoDB Compass version
Double checking workstation authorizes MongoDB port outgoing requests (27017 by default, but it shouldn't be needed as you disabled your firewall)
Double checking your IP address is indeed in the IP whitelist (that would be my first guess)
Double checking your user has read permission in the cluster
Double checking the connection string, in MongoDB Atlas click on "Connect", indicate Atlas and copy/paste
For the IP whitelist, just to be sure you can check it by going to MongoDB Atlas https://account.mongodb.com/, click in the left column on Security > Network
Then double check your IP is here (it will be indicated), otherwise click on "Add IP address".
I am using the 4.4.6 version
Following these steps may help you,
Network access : 0.0.0.0/0 (or your personal IP)
Database access : readWriteAnyDatabase
Choose connect to your application
you will get a string like :
mongodb+srv://admin:#sickcluster.a87o5.mongodb.net/myFirstDatabase?retryWrites=true&w=majority
change the admin, Password with brackets<>, and myFirstDatabase values {database name is optional}
now paste this URL in your MongoDb compass and application
I'm using robomongo tool to access mongodb. When I connect into my db then
Show error details
How to fix it?
I had the same issue and was able to fix it by removing the full url (for example: mongodb://myuser:mypassword#mongodb-test.mydomain.com/my_database) in the connection tab and only putting in the mongodb server url: mongodb-test.mydomain.com.
Next, in the Authentication tab, I checked the Perform authentication checkbox, specified the Database, user name, password.
I also added the database in the Advanded tab just in case and I can now connect without error.
Try inserting only e.g: ds12345.mlab.com at address bar instead of full [http:// mongodb://<dbuser>:<dbpassword>#...] and create user to authenticate in mlab.com and then try connect to it. Something like this:
And then:
Whilst this answer is only partly related to the problem, I want to describe the solution in here.
I had this problem when trying to connect via Robo3T to a cluster of MongoDBs hosted on Atlas. They offer a connection string with the protocol in front (e.g. mongodb+srv://<USER>:<PASSWORD>#database-mongodb.net/admin). This was a combination of two problems:
Robo3T does not like the protocol mongodb+srv:// in the URI. You should use only the second part (after the #). Like: database-mongodb.net.
Robo3T does not like shards. At least I could not get to connect with it via that connection string. Fro what I understand, you need that protocol to connect to a shard. Since you can't use that kind of URI, you will need to connect directly to the primary shard. To do that, you need to build a new connection string with the URI of the primary shard. Like this: database-shard-00-00-vemhh.mongodb.net and provide the port to Robo3T. Also, you need to connect via SSL, if you're using MongoDB Atlas (a self-signed certificate configured directly in Robo3T worked for me).
Remove only [http://] worked for me
Get the newer version of the Robo3T client...it can import it automatically from +srv link
I was facing the same problem, but I can solve it by installing Robo 3T 1.3 and import connection details from MongoDB SRV connection string. See this:
Steps to connect remote DB from Robo 3T 1.3
Remember to replace the user in the connection string and the pass at Authentication Tab
The connection string in the picture is dummy by the way