Unable to access MongoDB installed on a GCE VM from client desktop Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Come Celebrate our 10 Year Anniversary!mongoDB won't connect remotelyiptables blocking local connection to mongodbCommunication errors while trying to replicate mongodbSomething is filtering 27017 port even then firewall is not workingEnabling WiredTiger engine in MongoDB 3Unable to connect to MongoDB running on AWS EC2 instance via SSHerror while connecting to mongo dbCan not connect to MongoDB with Mongo Compass CEMongoDB, Windows Server, SSL Certificate, Compass Connection Not WorkingMongodb doesn't start on reboot
Generate an RGB colour grid
What does "lightly crushed" mean for cardamon pods?
Wu formula for manifolds with boundary
What do you call the main part of a joke?
Is there any way for the UK Prime Minister to make a motion directly dependent on Government confidence?
Withdrew £2800, but only £2000 shows as withdrawn on online banking; what are my obligations?
For a new assistant professor in CS, how to build/manage a publication pipeline
Is it fair for a professor to grade us on the possession of past papers?
What is homebrew?
Fantasy story; one type of magic grows in power with use, but the more powerful they are, they more they are drawn to travel to their source
Significance of Cersei's obsession with elephants?
Dating a Former Employee
How to Make a Beautiful Stacked 3D Plot
Can melee weapons be used to deliver Contact Poisons?
Did MS DOS itself ever use blinking text?
When was Kai Tak permanently closed to cargo service?
How to tell that you are a giant?
Compare a given version number in the form major.minor.build.patch and see if one is less than the other
What is the longest distance a player character can jump in one leap?
How would a mousetrap for use in space work?
How come Sam didn't become Lord of Horn Hill?
Denied boarding although I have proper visa and documentation. To whom should I make a complaint?
Trademark violation for app?
How to convince students of the implication truth values?
Unable to access MongoDB installed on a GCE VM from client desktop
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
Come Celebrate our 10 Year Anniversary!mongoDB won't connect remotelyiptables blocking local connection to mongodbCommunication errors while trying to replicate mongodbSomething is filtering 27017 port even then firewall is not workingEnabling WiredTiger engine in MongoDB 3Unable to connect to MongoDB running on AWS EC2 instance via SSHerror while connecting to mongo dbCan not connect to MongoDB with Mongo Compass CEMongoDB, Windows Server, SSL Certificate, Compass Connection Not WorkingMongodb doesn't start on reboot
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
So I installed MongoDB v4.0 on an Ubuntu 18.10 VM running on Google Compute Engine. Installed successfully, working well with the mongo
shell via SSH. Now I wanted to access the database remotely from my desktop.
Following this guide, I edited my /etc/mongod.conf
file and commented out the bind_ip
line in the following code:
net:
port: 27017
# bindIp: 127.0.0.1
Restarted the service service mongod restart
Also opened the TCP port 27017 on the Google Cloud Platform Firewall.
However, the database is still inaccessible via all means, i.e. the mongo
shell installed on my local machine, MongoDB Compass, the server_ip:27017
format on Google Chrome, all fail to connect.
I ran sudo netstat -tlnp
via SSH on the VM,
I only got the following line for MongoDB:
tcp 0 0 127.0.0.1:27017 0.0.0.0:* LISTEN 18490/mongod
The 0.0.0.0
line which should have been there indicating that it is open to all connections was still missing.
Can this possibly be a configuration error or is some internal firewall blocking the connection?
Edit: I even made sure iptables isn't causing this.
Issued the commands
iptables -A INPUT -p tcp --destination-port 27017 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp --source-port 27017 -m state --state ESTABLISHED -j ACCEPT
Still no luck
remote-access google-compute-engine mongodb
add a comment |
So I installed MongoDB v4.0 on an Ubuntu 18.10 VM running on Google Compute Engine. Installed successfully, working well with the mongo
shell via SSH. Now I wanted to access the database remotely from my desktop.
Following this guide, I edited my /etc/mongod.conf
file and commented out the bind_ip
line in the following code:
net:
port: 27017
# bindIp: 127.0.0.1
Restarted the service service mongod restart
Also opened the TCP port 27017 on the Google Cloud Platform Firewall.
However, the database is still inaccessible via all means, i.e. the mongo
shell installed on my local machine, MongoDB Compass, the server_ip:27017
format on Google Chrome, all fail to connect.
I ran sudo netstat -tlnp
via SSH on the VM,
I only got the following line for MongoDB:
tcp 0 0 127.0.0.1:27017 0.0.0.0:* LISTEN 18490/mongod
The 0.0.0.0
line which should have been there indicating that it is open to all connections was still missing.
Can this possibly be a configuration error or is some internal firewall blocking the connection?
Edit: I even made sure iptables isn't causing this.
Issued the commands
iptables -A INPUT -p tcp --destination-port 27017 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp --source-port 27017 -m state --state ESTABLISHED -j ACCEPT
Still no luck
remote-access google-compute-engine mongodb
add a comment |
So I installed MongoDB v4.0 on an Ubuntu 18.10 VM running on Google Compute Engine. Installed successfully, working well with the mongo
shell via SSH. Now I wanted to access the database remotely from my desktop.
Following this guide, I edited my /etc/mongod.conf
file and commented out the bind_ip
line in the following code:
net:
port: 27017
# bindIp: 127.0.0.1
Restarted the service service mongod restart
Also opened the TCP port 27017 on the Google Cloud Platform Firewall.
However, the database is still inaccessible via all means, i.e. the mongo
shell installed on my local machine, MongoDB Compass, the server_ip:27017
format on Google Chrome, all fail to connect.
I ran sudo netstat -tlnp
via SSH on the VM,
I only got the following line for MongoDB:
tcp 0 0 127.0.0.1:27017 0.0.0.0:* LISTEN 18490/mongod
The 0.0.0.0
line which should have been there indicating that it is open to all connections was still missing.
Can this possibly be a configuration error or is some internal firewall blocking the connection?
Edit: I even made sure iptables isn't causing this.
Issued the commands
iptables -A INPUT -p tcp --destination-port 27017 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp --source-port 27017 -m state --state ESTABLISHED -j ACCEPT
Still no luck
remote-access google-compute-engine mongodb
So I installed MongoDB v4.0 on an Ubuntu 18.10 VM running on Google Compute Engine. Installed successfully, working well with the mongo
shell via SSH. Now I wanted to access the database remotely from my desktop.
Following this guide, I edited my /etc/mongod.conf
file and commented out the bind_ip
line in the following code:
net:
port: 27017
# bindIp: 127.0.0.1
Restarted the service service mongod restart
Also opened the TCP port 27017 on the Google Cloud Platform Firewall.
However, the database is still inaccessible via all means, i.e. the mongo
shell installed on my local machine, MongoDB Compass, the server_ip:27017
format on Google Chrome, all fail to connect.
I ran sudo netstat -tlnp
via SSH on the VM,
I only got the following line for MongoDB:
tcp 0 0 127.0.0.1:27017 0.0.0.0:* LISTEN 18490/mongod
The 0.0.0.0
line which should have been there indicating that it is open to all connections was still missing.
Can this possibly be a configuration error or is some internal firewall blocking the connection?
Edit: I even made sure iptables isn't causing this.
Issued the commands
iptables -A INPUT -p tcp --destination-port 27017 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp --source-port 27017 -m state --state ESTABLISHED -j ACCEPT
Still no luck
remote-access google-compute-engine mongodb
remote-access google-compute-engine mongodb
edited Apr 12 at 7:16
Tanmay Vij
asked Apr 12 at 6:49
Tanmay VijTanmay Vij
113
113
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Solved it. It was indeed a configuration problem and not a firewall issue.
Apparently MongoDB no longer works fine with bindIp: 0.0.0.0
or commenting out bindIp
entirely.
What worked is that I removed the bindIp line and replaced it with
bindIpAll: true
So the final code looks like:
net:
port: 27017
bindIpAll: true
# bindIp: 127.0.0.1
P.S. If you're doing this on your server, don't forget to enable MongoDB authentication
Uncomment the line security:
And add authorization: 'enabled'
below that.
security:
authorization: 'enabled'
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "2"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f962727%2funable-to-access-mongodb-installed-on-a-gce-vm-from-client-desktop%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Solved it. It was indeed a configuration problem and not a firewall issue.
Apparently MongoDB no longer works fine with bindIp: 0.0.0.0
or commenting out bindIp
entirely.
What worked is that I removed the bindIp line and replaced it with
bindIpAll: true
So the final code looks like:
net:
port: 27017
bindIpAll: true
# bindIp: 127.0.0.1
P.S. If you're doing this on your server, don't forget to enable MongoDB authentication
Uncomment the line security:
And add authorization: 'enabled'
below that.
security:
authorization: 'enabled'
add a comment |
Solved it. It was indeed a configuration problem and not a firewall issue.
Apparently MongoDB no longer works fine with bindIp: 0.0.0.0
or commenting out bindIp
entirely.
What worked is that I removed the bindIp line and replaced it with
bindIpAll: true
So the final code looks like:
net:
port: 27017
bindIpAll: true
# bindIp: 127.0.0.1
P.S. If you're doing this on your server, don't forget to enable MongoDB authentication
Uncomment the line security:
And add authorization: 'enabled'
below that.
security:
authorization: 'enabled'
add a comment |
Solved it. It was indeed a configuration problem and not a firewall issue.
Apparently MongoDB no longer works fine with bindIp: 0.0.0.0
or commenting out bindIp
entirely.
What worked is that I removed the bindIp line and replaced it with
bindIpAll: true
So the final code looks like:
net:
port: 27017
bindIpAll: true
# bindIp: 127.0.0.1
P.S. If you're doing this on your server, don't forget to enable MongoDB authentication
Uncomment the line security:
And add authorization: 'enabled'
below that.
security:
authorization: 'enabled'
Solved it. It was indeed a configuration problem and not a firewall issue.
Apparently MongoDB no longer works fine with bindIp: 0.0.0.0
or commenting out bindIp
entirely.
What worked is that I removed the bindIp line and replaced it with
bindIpAll: true
So the final code looks like:
net:
port: 27017
bindIpAll: true
# bindIp: 127.0.0.1
P.S. If you're doing this on your server, don't forget to enable MongoDB authentication
Uncomment the line security:
And add authorization: 'enabled'
below that.
security:
authorization: 'enabled'
answered Apr 12 at 7:43
Tanmay VijTanmay Vij
113
113
add a comment |
add a comment |
Thanks for contributing an answer to Server Fault!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f962727%2funable-to-access-mongodb-installed-on-a-gce-vm-from-client-desktop%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown