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;








0















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










share|improve this question






























    0















    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










    share|improve this question


























      0












      0








      0








      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










      share|improve this question
















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 12 at 7:16







      Tanmay Vij

















      asked Apr 12 at 6:49









      Tanmay VijTanmay Vij

      113




      113




















          1 Answer
          1






          active

          oldest

          votes


















          0














          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'







          share|improve this answer























            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
            );



            );













            draft saved

            draft discarded


















            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









            0














            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'







            share|improve this answer



























              0














              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'







              share|improve this answer

























                0












                0








                0







                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'







                share|improve this answer













                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'








                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Apr 12 at 7:43









                Tanmay VijTanmay Vij

                113




                113



























                    draft saved

                    draft discarded
















































                    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.




                    draft saved


                    draft discarded














                    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





















































                    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







                    Popular posts from this blog

                    Wikipedia:Vital articles Мазмуну Biography - Өмүр баян Philosophy and psychology - Философия жана психология Religion - Дин Social sciences - Коомдук илимдер Language and literature - Тил жана адабият Science - Илим Technology - Технология Arts and recreation - Искусство жана эс алуу History and geography - Тарых жана география Навигация менюсу

                    Bruxelas-Capital Índice Historia | Composición | Situación lingüística | Clima | Cidades irmandadas | Notas | Véxase tamén | Menú de navegacióneO uso das linguas en Bruxelas e a situación do neerlandés"Rexión de Bruxelas Capital"o orixinalSitio da rexiónPáxina de Bruselas no sitio da Oficina de Promoción Turística de Valonia e BruxelasMapa Interactivo da Rexión de Bruxelas-CapitaleeWorldCat332144929079854441105155190212ID28008674080552-90000 0001 0666 3698n94104302ID540940339365017018237

                    What should I write in an apology letter, since I have decided not to join a company after accepting an offer letterShould I keep looking after accepting a job offer?What should I do when I've been verbally told I would get an offer letter, but still haven't gotten one after 4 weeks?Do I accept an offer from a company that I am not likely to join?New job hasn't confirmed starting date and I want to give current employer as much notice as possibleHow should I address my manager in my resignation letter?HR delayed background verification, now jobless as resignedNo email communication after accepting a formal written offer. How should I phrase the call?What should I do if after receiving a verbal offer letter I am informed that my written job offer is put on hold due to some internal issues?Should I inform the current employer that I am about to resign within 1-2 weeks since I have signed the offer letter and waiting for visa?What company will do, if I send their offer letter to another company