Fail to start mongod service but mongodb service












0














Ubuntu: 14.04



MongodB version: 3.2.6



MongoDB shell version: 3.2.6 connecting to: test

2017-06-26T07:46:48.195+0000 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
2017-06-26T07:46:48.196+0000 E QUERY [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed :
connect@src/mongo/shell/mongo.js:229:14
@(connect):1:6 exception: connect failed


Hi guys,



Our service contains both mongodb and mongod service. We used to run mongod service (sudo service mongod start) however recently when re run mongod service, we got the error above.



However this problem didn't happen when we run mongodB service .



This is the mongod.conf file. Wonder who can give me some advice? Thanks!



storage:
smallFiles: true
dbPath: /var/lib/mongodb
journal:
enabled: true

systemLog:
destination: file
logAppend: true
path: /var/log/mongodb/mongod.log

net:
port: 27017
bindIp: [127.0.0.1,X.X.X.X]

replSet=spof
replication:
replSetName: rs0









share|improve this question



























    0














    Ubuntu: 14.04



    MongodB version: 3.2.6



    MongoDB shell version: 3.2.6 connecting to: test

    2017-06-26T07:46:48.195+0000 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
    2017-06-26T07:46:48.196+0000 E QUERY [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed :
    connect@src/mongo/shell/mongo.js:229:14
    @(connect):1:6 exception: connect failed


    Hi guys,



    Our service contains both mongodb and mongod service. We used to run mongod service (sudo service mongod start) however recently when re run mongod service, we got the error above.



    However this problem didn't happen when we run mongodB service .



    This is the mongod.conf file. Wonder who can give me some advice? Thanks!



    storage:
    smallFiles: true
    dbPath: /var/lib/mongodb
    journal:
    enabled: true

    systemLog:
    destination: file
    logAppend: true
    path: /var/log/mongodb/mongod.log

    net:
    port: 27017
    bindIp: [127.0.0.1,X.X.X.X]

    replSet=spof
    replication:
    replSetName: rs0









    share|improve this question

























      0












      0








      0







      Ubuntu: 14.04



      MongodB version: 3.2.6



      MongoDB shell version: 3.2.6 connecting to: test

      2017-06-26T07:46:48.195+0000 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
      2017-06-26T07:46:48.196+0000 E QUERY [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed :
      connect@src/mongo/shell/mongo.js:229:14
      @(connect):1:6 exception: connect failed


      Hi guys,



      Our service contains both mongodb and mongod service. We used to run mongod service (sudo service mongod start) however recently when re run mongod service, we got the error above.



      However this problem didn't happen when we run mongodB service .



      This is the mongod.conf file. Wonder who can give me some advice? Thanks!



      storage:
      smallFiles: true
      dbPath: /var/lib/mongodb
      journal:
      enabled: true

      systemLog:
      destination: file
      logAppend: true
      path: /var/log/mongodb/mongod.log

      net:
      port: 27017
      bindIp: [127.0.0.1,X.X.X.X]

      replSet=spof
      replication:
      replSetName: rs0









      share|improve this question













      Ubuntu: 14.04



      MongodB version: 3.2.6



      MongoDB shell version: 3.2.6 connecting to: test

      2017-06-26T07:46:48.195+0000 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
      2017-06-26T07:46:48.196+0000 E QUERY [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed :
      connect@src/mongo/shell/mongo.js:229:14
      @(connect):1:6 exception: connect failed


      Hi guys,



      Our service contains both mongodb and mongod service. We used to run mongod service (sudo service mongod start) however recently when re run mongod service, we got the error above.



      However this problem didn't happen when we run mongodB service .



      This is the mongod.conf file. Wonder who can give me some advice? Thanks!



      storage:
      smallFiles: true
      dbPath: /var/lib/mongodb
      journal:
      enabled: true

      systemLog:
      destination: file
      logAppend: true
      path: /var/log/mongodb/mongod.log

      net:
      port: 27017
      bindIp: [127.0.0.1,X.X.X.X]

      replSet=spof
      replication:
      replSetName: rs0






      14.04 upstart mongodb






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jun 26 '17 at 8:32









      Josie

      111




      111






















          3 Answers
          3






          active

          oldest

          votes


















          0














          Try the following:



          sudo rm /var/lib/mongodb/mongod.lock
          sudo mongod --repair
          sudo service mongod start
          sudo service mongod status


          Double check you've not got conflicting rules in iptables.



          Double check /etc/mongod.conf and check bind_ip = 0.0.0.0 to allow external connections.






          share|improve this answer





























            0














            It might be due to permission issues with your db directory (dbPath). You can try giving appropriate permission to you directory. Try following steps:



            Step 1: Give permission to /var/lib/mongodb directory:



            sudo chmod -R 0777 /var/lib/mongodb


            Step 2: Try to start mongod service as :



            sudo service mongod start


            Step 3: Check status of mongod service:



            sudo service mongod status





            share|improve this answer





























              -1














              The format of bindIp is not correct.



              If you want to have multiple IPs, you should do it like this:



              net:
              port: 27017
              bindIp: 127.0.0.1,X.X.X.X





              share|improve this answer























              • Hello and welcome to AskUbuntu! Looks like the correct format is indeed what the OP has: bindIp = [127.0.0.1, 192.168.0.155, 10.0.0.155]. You might want to edit the answer.
                – Mr Shunz
                Sep 14 at 9:32













              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "89"
              };
              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%2faskubuntu.com%2fquestions%2f929198%2ffail-to-start-mongod-service-but-mongodb-service%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              0














              Try the following:



              sudo rm /var/lib/mongodb/mongod.lock
              sudo mongod --repair
              sudo service mongod start
              sudo service mongod status


              Double check you've not got conflicting rules in iptables.



              Double check /etc/mongod.conf and check bind_ip = 0.0.0.0 to allow external connections.






              share|improve this answer


























                0














                Try the following:



                sudo rm /var/lib/mongodb/mongod.lock
                sudo mongod --repair
                sudo service mongod start
                sudo service mongod status


                Double check you've not got conflicting rules in iptables.



                Double check /etc/mongod.conf and check bind_ip = 0.0.0.0 to allow external connections.






                share|improve this answer
























                  0












                  0








                  0






                  Try the following:



                  sudo rm /var/lib/mongodb/mongod.lock
                  sudo mongod --repair
                  sudo service mongod start
                  sudo service mongod status


                  Double check you've not got conflicting rules in iptables.



                  Double check /etc/mongod.conf and check bind_ip = 0.0.0.0 to allow external connections.






                  share|improve this answer












                  Try the following:



                  sudo rm /var/lib/mongodb/mongod.lock
                  sudo mongod --repair
                  sudo service mongod start
                  sudo service mongod status


                  Double check you've not got conflicting rules in iptables.



                  Double check /etc/mongod.conf and check bind_ip = 0.0.0.0 to allow external connections.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jun 26 '17 at 12:44









                  Swinkid

                  12




                  12

























                      0














                      It might be due to permission issues with your db directory (dbPath). You can try giving appropriate permission to you directory. Try following steps:



                      Step 1: Give permission to /var/lib/mongodb directory:



                      sudo chmod -R 0777 /var/lib/mongodb


                      Step 2: Try to start mongod service as :



                      sudo service mongod start


                      Step 3: Check status of mongod service:



                      sudo service mongod status





                      share|improve this answer


























                        0














                        It might be due to permission issues with your db directory (dbPath). You can try giving appropriate permission to you directory. Try following steps:



                        Step 1: Give permission to /var/lib/mongodb directory:



                        sudo chmod -R 0777 /var/lib/mongodb


                        Step 2: Try to start mongod service as :



                        sudo service mongod start


                        Step 3: Check status of mongod service:



                        sudo service mongod status





                        share|improve this answer
























                          0












                          0








                          0






                          It might be due to permission issues with your db directory (dbPath). You can try giving appropriate permission to you directory. Try following steps:



                          Step 1: Give permission to /var/lib/mongodb directory:



                          sudo chmod -R 0777 /var/lib/mongodb


                          Step 2: Try to start mongod service as :



                          sudo service mongod start


                          Step 3: Check status of mongod service:



                          sudo service mongod status





                          share|improve this answer












                          It might be due to permission issues with your db directory (dbPath). You can try giving appropriate permission to you directory. Try following steps:



                          Step 1: Give permission to /var/lib/mongodb directory:



                          sudo chmod -R 0777 /var/lib/mongodb


                          Step 2: Try to start mongod service as :



                          sudo service mongod start


                          Step 3: Check status of mongod service:



                          sudo service mongod status






                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Sep 27 at 5:25









                          Jitendra

                          1186




                          1186























                              -1














                              The format of bindIp is not correct.



                              If you want to have multiple IPs, you should do it like this:



                              net:
                              port: 27017
                              bindIp: 127.0.0.1,X.X.X.X





                              share|improve this answer























                              • Hello and welcome to AskUbuntu! Looks like the correct format is indeed what the OP has: bindIp = [127.0.0.1, 192.168.0.155, 10.0.0.155]. You might want to edit the answer.
                                – Mr Shunz
                                Sep 14 at 9:32


















                              -1














                              The format of bindIp is not correct.



                              If you want to have multiple IPs, you should do it like this:



                              net:
                              port: 27017
                              bindIp: 127.0.0.1,X.X.X.X





                              share|improve this answer























                              • Hello and welcome to AskUbuntu! Looks like the correct format is indeed what the OP has: bindIp = [127.0.0.1, 192.168.0.155, 10.0.0.155]. You might want to edit the answer.
                                – Mr Shunz
                                Sep 14 at 9:32
















                              -1












                              -1








                              -1






                              The format of bindIp is not correct.



                              If you want to have multiple IPs, you should do it like this:



                              net:
                              port: 27017
                              bindIp: 127.0.0.1,X.X.X.X





                              share|improve this answer














                              The format of bindIp is not correct.



                              If you want to have multiple IPs, you should do it like this:



                              net:
                              port: 27017
                              bindIp: 127.0.0.1,X.X.X.X






                              share|improve this answer














                              share|improve this answer



                              share|improve this answer








                              edited Sep 14 at 10:30









                              Mr Shunz

                              2,1901922




                              2,1901922










                              answered Sep 14 at 9:22









                              Hossein Ojani

                              1




                              1












                              • Hello and welcome to AskUbuntu! Looks like the correct format is indeed what the OP has: bindIp = [127.0.0.1, 192.168.0.155, 10.0.0.155]. You might want to edit the answer.
                                – Mr Shunz
                                Sep 14 at 9:32




















                              • Hello and welcome to AskUbuntu! Looks like the correct format is indeed what the OP has: bindIp = [127.0.0.1, 192.168.0.155, 10.0.0.155]. You might want to edit the answer.
                                – Mr Shunz
                                Sep 14 at 9:32


















                              Hello and welcome to AskUbuntu! Looks like the correct format is indeed what the OP has: bindIp = [127.0.0.1, 192.168.0.155, 10.0.0.155]. You might want to edit the answer.
                              – Mr Shunz
                              Sep 14 at 9:32






                              Hello and welcome to AskUbuntu! Looks like the correct format is indeed what the OP has: bindIp = [127.0.0.1, 192.168.0.155, 10.0.0.155]. You might want to edit the answer.
                              – Mr Shunz
                              Sep 14 at 9:32




















                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Ask Ubuntu!


                              • 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.





                              Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                              Please pay close attention to the following guidance:


                              • 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%2faskubuntu.com%2fquestions%2f929198%2ffail-to-start-mongod-service-but-mongodb-service%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

                              How did Captain America manage to do this?

                              迪纳利

                              南乌拉尔铁路局