node.js - Mongodb in linux server -


By using SSH I have installed the MongoDub in the Linux server with the following steps.

  1. In the / bin folder in the Setter

  2. Edit .bash_profile and add >

    Pat = $ path: $ HOME / bin / mongodb-linux-x86_64-2.6.0 / bin

      export path   < / Li> 
  3. To run mkdir -p / data / db

  4. to mongod --dbpath / data / Db / code>
  5. mongo

    to run the mongo command, it shows an error such as this:

      MongoDB shell Versions: Connecting to 2.6.0: Exam 2014-04-24 T 10: 07: 58.831 + 0530 Warning: Connectors from 127.0.0.17 0777 Failed to install, because: errno: 111 Connection refused: 2014-04-24T10: 07: 58.832 + 0530 Error: 127.0.0.170177 (127.0.0.1) Could not connect to server, connection attempt src / mongo / shell Failed on / mongo.js: 146 Exception: Connect failed   

    How can this solve?

    First of all, make sure your DBPit is present. Start mongod with

      mkdir -p ~ / data / db   

    then again:

      mongod --dbpath Finally  
      mongo   

    edit : I saw that some people vote for this answer. To make it clear, this solution is for you to start mongod with the command line. Most of the time if you have installed the Mongodebi package from the source, then you can only start this daemon:

      sudo systemctl start mongodb # arc linux pseudo service start #centos / redhat   

    The configuration file can be found in:

      vim /etc/mongod.conf   

    and if you want to Daemon is started automatically by boot,

      enabled on sudo systemctl mongodb # Arch Linux sudo chkconfig mongod # CentOS / Redhat     Do

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -