MongoDB server not accessible in local Network despite binding ip












0















I am using MongoDB v3.6.3 on macOS, installed via home-brew. I have used almost every possible way to make my MongoDB server accessible on local network, but to no avail. I have:




  • Turned off firewall on both machines

  • Edited etcmongod.conf file to add bindIP.

  • used options-> bind_ip, bind_ip_all (127.0.0.1, 0.0.0.0, other machine's address)


As a matter of fact, also, my redis-server is not accessible on network.
I believe there is a common issue in between this.
I have tried the above mentioned solutions on macOS High Sierra, Ubuntu 16, Windows 10.










share|improve this question























  • It sounds like you're trying to connect to a "remote" database instance, i.e. one that is hosted on a separate machine from your application server. If so, then you should be sure that you're trying to connect using a local IP address or that you have the necessary port forwarding and/or firewall configuration set up. Please provide further information regarding your setup and configuration, because right now we can only speculate as to what your issue might be.

    – B. Fleming
    Mar 30 '18 at 19:56











  • You've listed several operating systems which don't work: can you narrow down the description to a single test case to start with? Can you include the IP address of your macOS machine and the remote you are trying to connect from? I assume both are private IPs on the same network. Note: the bind_ip directive only applies to local IP addresses a mongod can listen to: used options-> bind_ip, bind_ip_all (127.0.0.1, 0.0.0.0, other machine's address). You should have either bind_ip with a list of local addresses to listen to, or bind_ip_all (but not both settings).

    – Stennie
    Mar 30 '18 at 23:46











  • Can you also include the command line you are using to test connectivity and any specific error messages or output? I would use the mongo shell as a simple test before trying any third party tools or drivers. It would be helpful to confirm the shell version (mongo --version); ideally this should match your server version.

    – Stennie
    Mar 30 '18 at 23:48











  • what is the output of netstat -antu | grep redis and netstat -antu | grep mongo ?

    – ruhul
    Mar 31 '18 at 14:33
















0















I am using MongoDB v3.6.3 on macOS, installed via home-brew. I have used almost every possible way to make my MongoDB server accessible on local network, but to no avail. I have:




  • Turned off firewall on both machines

  • Edited etcmongod.conf file to add bindIP.

  • used options-> bind_ip, bind_ip_all (127.0.0.1, 0.0.0.0, other machine's address)


As a matter of fact, also, my redis-server is not accessible on network.
I believe there is a common issue in between this.
I have tried the above mentioned solutions on macOS High Sierra, Ubuntu 16, Windows 10.










share|improve this question























  • It sounds like you're trying to connect to a "remote" database instance, i.e. one that is hosted on a separate machine from your application server. If so, then you should be sure that you're trying to connect using a local IP address or that you have the necessary port forwarding and/or firewall configuration set up. Please provide further information regarding your setup and configuration, because right now we can only speculate as to what your issue might be.

    – B. Fleming
    Mar 30 '18 at 19:56











  • You've listed several operating systems which don't work: can you narrow down the description to a single test case to start with? Can you include the IP address of your macOS machine and the remote you are trying to connect from? I assume both are private IPs on the same network. Note: the bind_ip directive only applies to local IP addresses a mongod can listen to: used options-> bind_ip, bind_ip_all (127.0.0.1, 0.0.0.0, other machine's address). You should have either bind_ip with a list of local addresses to listen to, or bind_ip_all (but not both settings).

    – Stennie
    Mar 30 '18 at 23:46











  • Can you also include the command line you are using to test connectivity and any specific error messages or output? I would use the mongo shell as a simple test before trying any third party tools or drivers. It would be helpful to confirm the shell version (mongo --version); ideally this should match your server version.

    – Stennie
    Mar 30 '18 at 23:48











  • what is the output of netstat -antu | grep redis and netstat -antu | grep mongo ?

    – ruhul
    Mar 31 '18 at 14:33














0












0








0








I am using MongoDB v3.6.3 on macOS, installed via home-brew. I have used almost every possible way to make my MongoDB server accessible on local network, but to no avail. I have:




  • Turned off firewall on both machines

  • Edited etcmongod.conf file to add bindIP.

  • used options-> bind_ip, bind_ip_all (127.0.0.1, 0.0.0.0, other machine's address)


As a matter of fact, also, my redis-server is not accessible on network.
I believe there is a common issue in between this.
I have tried the above mentioned solutions on macOS High Sierra, Ubuntu 16, Windows 10.










share|improve this question














I am using MongoDB v3.6.3 on macOS, installed via home-brew. I have used almost every possible way to make my MongoDB server accessible on local network, but to no avail. I have:




  • Turned off firewall on both machines

  • Edited etcmongod.conf file to add bindIP.

  • used options-> bind_ip, bind_ip_all (127.0.0.1, 0.0.0.0, other machine's address)


As a matter of fact, also, my redis-server is not accessible on network.
I believe there is a common issue in between this.
I have tried the above mentioned solutions on macOS High Sierra, Ubuntu 16, Windows 10.







node.js mongodb redis redis-server






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 30 '18 at 19:47









Nabeel JavedNabeel Javed

1




1













  • It sounds like you're trying to connect to a "remote" database instance, i.e. one that is hosted on a separate machine from your application server. If so, then you should be sure that you're trying to connect using a local IP address or that you have the necessary port forwarding and/or firewall configuration set up. Please provide further information regarding your setup and configuration, because right now we can only speculate as to what your issue might be.

    – B. Fleming
    Mar 30 '18 at 19:56











  • You've listed several operating systems which don't work: can you narrow down the description to a single test case to start with? Can you include the IP address of your macOS machine and the remote you are trying to connect from? I assume both are private IPs on the same network. Note: the bind_ip directive only applies to local IP addresses a mongod can listen to: used options-> bind_ip, bind_ip_all (127.0.0.1, 0.0.0.0, other machine's address). You should have either bind_ip with a list of local addresses to listen to, or bind_ip_all (but not both settings).

    – Stennie
    Mar 30 '18 at 23:46











  • Can you also include the command line you are using to test connectivity and any specific error messages or output? I would use the mongo shell as a simple test before trying any third party tools or drivers. It would be helpful to confirm the shell version (mongo --version); ideally this should match your server version.

    – Stennie
    Mar 30 '18 at 23:48











  • what is the output of netstat -antu | grep redis and netstat -antu | grep mongo ?

    – ruhul
    Mar 31 '18 at 14:33



















  • It sounds like you're trying to connect to a "remote" database instance, i.e. one that is hosted on a separate machine from your application server. If so, then you should be sure that you're trying to connect using a local IP address or that you have the necessary port forwarding and/or firewall configuration set up. Please provide further information regarding your setup and configuration, because right now we can only speculate as to what your issue might be.

    – B. Fleming
    Mar 30 '18 at 19:56











  • You've listed several operating systems which don't work: can you narrow down the description to a single test case to start with? Can you include the IP address of your macOS machine and the remote you are trying to connect from? I assume both are private IPs on the same network. Note: the bind_ip directive only applies to local IP addresses a mongod can listen to: used options-> bind_ip, bind_ip_all (127.0.0.1, 0.0.0.0, other machine's address). You should have either bind_ip with a list of local addresses to listen to, or bind_ip_all (but not both settings).

    – Stennie
    Mar 30 '18 at 23:46











  • Can you also include the command line you are using to test connectivity and any specific error messages or output? I would use the mongo shell as a simple test before trying any third party tools or drivers. It would be helpful to confirm the shell version (mongo --version); ideally this should match your server version.

    – Stennie
    Mar 30 '18 at 23:48











  • what is the output of netstat -antu | grep redis and netstat -antu | grep mongo ?

    – ruhul
    Mar 31 '18 at 14:33

















It sounds like you're trying to connect to a "remote" database instance, i.e. one that is hosted on a separate machine from your application server. If so, then you should be sure that you're trying to connect using a local IP address or that you have the necessary port forwarding and/or firewall configuration set up. Please provide further information regarding your setup and configuration, because right now we can only speculate as to what your issue might be.

– B. Fleming
Mar 30 '18 at 19:56





It sounds like you're trying to connect to a "remote" database instance, i.e. one that is hosted on a separate machine from your application server. If so, then you should be sure that you're trying to connect using a local IP address or that you have the necessary port forwarding and/or firewall configuration set up. Please provide further information regarding your setup and configuration, because right now we can only speculate as to what your issue might be.

– B. Fleming
Mar 30 '18 at 19:56













You've listed several operating systems which don't work: can you narrow down the description to a single test case to start with? Can you include the IP address of your macOS machine and the remote you are trying to connect from? I assume both are private IPs on the same network. Note: the bind_ip directive only applies to local IP addresses a mongod can listen to: used options-> bind_ip, bind_ip_all (127.0.0.1, 0.0.0.0, other machine's address). You should have either bind_ip with a list of local addresses to listen to, or bind_ip_all (but not both settings).

– Stennie
Mar 30 '18 at 23:46





You've listed several operating systems which don't work: can you narrow down the description to a single test case to start with? Can you include the IP address of your macOS machine and the remote you are trying to connect from? I assume both are private IPs on the same network. Note: the bind_ip directive only applies to local IP addresses a mongod can listen to: used options-> bind_ip, bind_ip_all (127.0.0.1, 0.0.0.0, other machine's address). You should have either bind_ip with a list of local addresses to listen to, or bind_ip_all (but not both settings).

– Stennie
Mar 30 '18 at 23:46













Can you also include the command line you are using to test connectivity and any specific error messages or output? I would use the mongo shell as a simple test before trying any third party tools or drivers. It would be helpful to confirm the shell version (mongo --version); ideally this should match your server version.

– Stennie
Mar 30 '18 at 23:48





Can you also include the command line you are using to test connectivity and any specific error messages or output? I would use the mongo shell as a simple test before trying any third party tools or drivers. It would be helpful to confirm the shell version (mongo --version); ideally this should match your server version.

– Stennie
Mar 30 '18 at 23:48













what is the output of netstat -antu | grep redis and netstat -antu | grep mongo ?

– ruhul
Mar 31 '18 at 14:33





what is the output of netstat -antu | grep redis and netstat -antu | grep mongo ?

– ruhul
Mar 31 '18 at 14:33












2 Answers
2






active

oldest

votes


















0














Open MongoDB config file.



Add the below command in that file(mongod.conf) and save it.



Mac config file location is : /usr/local/etc/mongod.conf



net:
bindIp: 0.0.0.0


Important Note: Once saved please restart the MongoDB services then only it will work.






share|improve this answer































    0














    I have been facing the same error.
    You could allow external access using the following parameters when starting your server:



    mongod --bind_ip_all // Allow any ip


    or



    mongod --bind_ip <your_ip_here>





    share|improve this answer























      Your Answer






      StackExchange.ifUsing("editor", function () {
      StackExchange.using("externalEditor", function () {
      StackExchange.using("snippets", function () {
      StackExchange.snippets.init();
      });
      });
      }, "code-snippets");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "1"
      };
      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%2fstackoverflow.com%2fquestions%2f49580538%2fmongodb-server-not-accessible-in-local-network-despite-binding-ip%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0














      Open MongoDB config file.



      Add the below command in that file(mongod.conf) and save it.



      Mac config file location is : /usr/local/etc/mongod.conf



      net:
      bindIp: 0.0.0.0


      Important Note: Once saved please restart the MongoDB services then only it will work.






      share|improve this answer




























        0














        Open MongoDB config file.



        Add the below command in that file(mongod.conf) and save it.



        Mac config file location is : /usr/local/etc/mongod.conf



        net:
        bindIp: 0.0.0.0


        Important Note: Once saved please restart the MongoDB services then only it will work.






        share|improve this answer


























          0












          0








          0







          Open MongoDB config file.



          Add the below command in that file(mongod.conf) and save it.



          Mac config file location is : /usr/local/etc/mongod.conf



          net:
          bindIp: 0.0.0.0


          Important Note: Once saved please restart the MongoDB services then only it will work.






          share|improve this answer













          Open MongoDB config file.



          Add the below command in that file(mongod.conf) and save it.



          Mac config file location is : /usr/local/etc/mongod.conf



          net:
          bindIp: 0.0.0.0


          Important Note: Once saved please restart the MongoDB services then only it will work.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 27 '18 at 7:24









          Bharathi DevarasuBharathi Devarasu

          5,05111216




          5,05111216

























              0














              I have been facing the same error.
              You could allow external access using the following parameters when starting your server:



              mongod --bind_ip_all // Allow any ip


              or



              mongod --bind_ip <your_ip_here>





              share|improve this answer




























                0














                I have been facing the same error.
                You could allow external access using the following parameters when starting your server:



                mongod --bind_ip_all // Allow any ip


                or



                mongod --bind_ip <your_ip_here>





                share|improve this answer


























                  0












                  0








                  0







                  I have been facing the same error.
                  You could allow external access using the following parameters when starting your server:



                  mongod --bind_ip_all // Allow any ip


                  or



                  mongod --bind_ip <your_ip_here>





                  share|improve this answer













                  I have been facing the same error.
                  You could allow external access using the following parameters when starting your server:



                  mongod --bind_ip_all // Allow any ip


                  or



                  mongod --bind_ip <your_ip_here>






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jan 17 at 19:05









                  albertTaberneralbertTaberner

                  74511020




                  74511020






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Stack Overflow!


                      • 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%2fstackoverflow.com%2fquestions%2f49580538%2fmongodb-server-not-accessible-in-local-network-despite-binding-ip%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

                      Lallio

                      Futebolista

                      Jornalista