Logging into Mongo on Amazon's EC2 (AWS) with MongoVUE - mongodb

This question is specific to MongoVUE, but really I am looking to be able to log in to Mongo on EC2 in any way besides through the SSH tunnel. I can do that and get a server and client up and running, create documents, find things etc. I am new to mongo and ec2 so I will admit there are a lot of variables.
Here is what I've done so far:
I have created a unique database and then added a user to that with the db.addUser('name','password') command.
I am using the public dns that AWS provided which looks like, xxxx.us-west-1.compute.amazonaws.com
I have tried to log in with the plain text password as well as the one mongo displays (hashed).
My ultimate goal is to be able to connect through C#, but MongoVue gives me an easier platform to fiddle around with (I hope).
Any help would be great! Thank you.

I was trying to do the same thing and it actually ended up being pretty easy after following the instructions on Mongovue's Blog
http://www.mongovue.com/2011/08/04/mongovue-connection-to-remote-server-over-ssh/
This allows you to not have to open up the MongoDB port externally also.
Make sure you also convert your EC2 .pem key to a Putty Key via PuttyGen first.

Okay, I solved it for those of you that will find this question and be in the same boat. For some reason I could not change my security group on ec2 to the one I had given access to port 27017. So I added that port exception to the security group that was currently assigned to my instance.
I then had to log in through SSH to get the Mongo server up and running (simply run the mongod command in the bin directory) and then it logged right in. I used the username and password that I had set up earlier through the mongo command line.
I hope this helps someone.

Related

How to create a user of MongoDB created in Google Cloud Platform?

I´ve created a MongoDB instance using the Google Click to Deploy VM and I've added a firewall rule 0.0.0.0/0 and works fine using dataGrip or connecting from outside. But now I want to create an user account for obvious reasons and I don't know how to do it.
I've done it locally installing MongoDB and executing the command db.createUser(... but I don't know how to connect to the mongo db in google cloud and execute the same command in order to create the account.
Thanks and sorry my bad english.
I haven't used the click to deploy like you're describing, but my guess is, if you go here:
https://console.cloud.google.com/compute/instances
The instance that was created for you shows up, and in the row for the instance, look for the column that says Connect, you'll see a button that says SSH. Clicking that will open a window that will connect you to the VM. It should have the MongoDB client installed and you can run commands there as if you had installed it locally and create your user.

Use built-in SSH in Oracle SQL Developer instead of using PuTTY first

I don't have extensive knowledges about Oracle SQL Developer (Version 17.2) and SSH tunnel. I have been using PuTTY (KiTTY is the software I used) to establish SSH tunnel to connect to the database. This is the example of how I set up originally with KiTTY. Also, when I start the session where a command prompt window will pop up, I'll need to enter username and password. Let's assume the Username is username and the Password is password. And for the database, the Username is database_username and the Password is database_password.
SSH Setup:
Tunnel Setup:
I learned that you can use SSH (View > SSH) function directly from Oracle SQL Developer, and I have tried for two days but didn't work. From the information I have attached in the two pics above, will I be able to use the built-in SSH function or do I have to always use PuTTY? This is how I set up currently:
SSH in Oracle SQL Developer Setup:
How should I change the built-in SSH setup in order for me to connect to database through SSH? Will this be possible? If so, can you show me exactly what I need to enter the information into those fields (please use mine so I can follow each step)? I just think this process can be simplified within one program.
I finally found the answer for myself after two days of searching and a coworker's advice. Here is what you do to use built-in SSH function in Oracle SQL Developer that also requires SSH Tunnel. And no more PuTTY is needed for this process.
SSH Setup:
As shown in the pic below, this is what you need to enter. Please note there are two Name's fields. You can make up any name you like to use. Don't forget to perform a Test run to ensure this works. To Test run, go to SSH Hosts window, right click on the SSH connection and select Test.
Now the tricky part is here. You should see there is a Connections window on the upper left corner. Click the green plus icon button to add a New Connection.
Database Connection Setup:
Fill out the info as you can see the pic below for example. The key is to change the Connection Type to SSH, Port Forward should also point to the SSH connection that you setup above, and you should have a Service name provided by your DBA team. Once this is set, you can perform a quick Test run and see if everything is working.
The good thing about this setup is that you don't need to run PuTTY on the side. You can simply click the database name and it will prompt you the password and that is it.
P.S. I heard there is a way to store the password using SSH key but I am not familiar with the process and still trying to figure that out. Maybe post your steps here and I will definitely upvote for you.

Error : No unix socket support on windows connecting mongodb

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

Can not access MongoDb collections on Compose.io with Mongo Client

Since last week I can not access my mongoDb collections on Compose.io using any mongo client. Client log says it is connected to DB but when I want to list collections or view document says "Collection not found!". I till can connect with terminal and do there whatever I need.
Initially I thought it is a problem with my MacOS machine, but then I tried to connect from other computers and using different clients ( Mongo-Express, MongoHub ) still no luck.
Wondering if I'm experiencing this problem alone or other compose.io clients also do ?
Tried to grant readWrite role to my mongo user as advised here (MongoDB - admin user not authorized), this does not help either.
Contacted compose.io support, but they swear that did change anything.
Any advise appreciated.
Thank you.
I was trying to connect to slave node which fails with { [MongoError: not master and slaveOk=false] name: 'MongoError' }
. Connecting with MongoClient to primary node solves the problem.

OpenERP on VPS, and redirection of Postgresql to Local Machine

Please, any help will be appreciated, i have an OpenERP installed with all its components (Postgres, Web server, Server) in a VPS..
And I would like to use this PostgreSQL from my local machine trough pgAdmin3. I am still not able to do so.
I read some answers about this issue, by modifing Configuration Files in Postgresql and some others telling me to use SSH Tunilling trough Putty, but when i go to connect trough PGADMIN3 i can't have a successfuull connection
So , Please if any one could Give me in details What i have to do, to make this happen successfully,
First you need to ask yourself a bunch of questions. The answer to this isn't really that simple which is why it hasn't been answered. These involve risk management questions that happen when you set up your db for access across the internet. You really want to start by reading the administration and authentication sections of the PostgreSQL docs. You may want to do an SSH tunnel or just require SSL.
Personally I would configure PostgreSQL to require SSL if you are going to do that. Set up an entry of type hostssl in the pg_hba.conf for the host that will be connecting to it. Set up firewall rules to allow connections from that host. Ideally set up a client cert but not quite sure how to make OpenERP use that.
Then configure OpenERP. I don't know which version you are running but these docs may get you started.