04 June 2015

Install MongoDB in Debian

As a part of Sitecore 8 setup, we need to install MongoDB in Debian.

  1. Check Debian version. The MongoDB 3.xx requires at least Debian 7.1



  2. So we need to upgrade to Debian 7.1 at least. Here is how to do it.

    Edit your /etc/apt/sources.list file and change all instances of squeeze to wheezy. Once you have finished, your /etc/apt/sources.list should resemble the following:

       /etc/apt/sources.list


      
    deb http://ftp.us.debian.org/debian/ wheezy main
    deb-src http://ftp.us.debian.org/debian/ wheezy main
    
    deb http://security.debian.org/ wheezy/updates main
    deb-src http://security.debian.org/ wheezy/updates main
    
    # wheezy-updates, previously known as 'volatile'
    deb http://ftp.us.debian.org/debian/ wheezy-updates main
    deb-src http://ftp.us.debian.org/debian/ wheezy-updates main




    How to use "vi" http://www.howtogeek.com/102468/a-beginners-guide-to-editing-text-files-with-vi/
  3. Go through the update process.

    Enter the following command to update your package lists:
    apt-get update

    Keep getting the error of " GPG error: http://ftp.us.debian.org wheezy Release: The following signatures couldn't be verified because the public key is not available: Try this and ignore the warning.
    apt-get install debian-archive-keyring
  4. More info: http://serverfault.com/questions/337278/debian-how-can-i-securely-get-debian-archive-keyring-so-that-i-can-do-an-apt-g
  5. Enter the following command to grab the latest versions of key system utilities:
  6. apt-get install apt dpkg aptitude
  7. After the package updates have completed, upgrade your system by entering the following command. The upgrade will download and install numerous packages. This step may take a while to complete.
    apt-get dist-upgrade


  8. After "reboot", check the debian version again. 
  9.            cat /etc/debian_version









  • Install MongoDB

    The Debian package management tools (i.e. dpkg and apt) ensure package consistency and authenticity by requiring that distributors sign packages with GPG keys.

    Import the public key used by the package management system.

    Issue the following command to add the MongoDB public GPG Key to the system key ring.
    apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10

    Create a /etc/apt/sources.list.d/mongodb-org-3.0.list file for MongoDB.

    Create the list file using the following command:
    echo "deb http://repo.mongodb.org/apt/debian "$(lsb_release -sc)"/mongodb-org/3.0 main" | tee /etc/apt/sources.list.d/mongodb-org-3.0.list


    If your Debian installation does not have lsb_release installed, you may install it using sudoapt-get install lsb-release.

    Reload local package database.

    Issue the following command to reload the local package database:
    apt-get update
    root@debian-x64:~# apt-get update
    Ign http://58.162.66.11 squeeze Release.gpg
    Ign http://58.162.66.11/linux/debian-6.0.1a-x64/ squeeze/main Translation-en
    Ign http://58.162.66.11/linux/debian-6.0.1a-x64/ squeeze/main Translation-en_AU
    Hit http://58.162.66.11 squeeze Release
    Ign http://58.162.66.11 squeeze/main Sources/DiffIndex
    Ign http://58.162.66.11 squeeze/main amd64 Packages/DiffIndex
    Hit http://58.162.66.11 squeeze/main Sources
    Ign http://58.162.66.11 squeeze/main amd64 Packages
    Hit http://58.162.66.11 squeeze/main amd64 Packages
    Ign http://repo.mongodb.org squeeze/mongodb-org/3.0 Release.gpg
    Ign http://repo.mongodb.org/apt/debian/ squeeze/mongodb-org/3.0/main Translation-en
    Ign http://repo.mongodb.org/apt/debian/ squeeze/mongodb-org/3.0/main Translation-en_AU
    Ign http://repo.mongodb.org squeeze/mongodb-org/3.0 Release
    Ign http://repo.mongodb.org squeeze/mongodb-org/3.0/main amd64 Packages
    Err http://repo.mongodb.org squeeze/mongodb-org/3.0/main amd64 Packages
    404 Not Found
    Get:1 http://ftp.au.debian.org squeeze-updates Release.gpg [836 B]
    Hit http://security.debian.org squeeze/updates Release.gpg
    Ign http://security.debian.org/ squeeze/updates/main Translation-en
    Ign http://security.debian.org/ squeeze/updates/main Translation-en_AU
    Ign http://ftp.au.debian.org/debian/ squeeze-updates/main Translation-en
    Ign http://ftp.au.debian.org/debian/ squeeze-updates/main Translation-en_AU
    Hit http://security.debian.org squeeze/updates Release
    Hit http://security.debian.org squeeze/updates/main Sources
    Hit http://security.debian.org squeeze/updates/main amd64 Packages
    Get:2 http://ftp.au.debian.org squeeze-updates Release [113 kB]
    Err http://ftp.au.debian.org squeeze-updates Release
    Fetched 837 B in 5s (158 B/s)
    Reading package lists... Done
    W: A error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://ftp.au.debian.org squeeze-updates Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 8B48AD6246925553
    W: Failed to fetch http://repo.mongodb.org/apt/debian/dists/squeeze/mongodb-org/3.0/main/binary-amd64/Packages.gz 404 Not Found
    W: Failed to fetch http://ftp.au.debian.org/debian/dists/squeeze-updates/Release
    W: Some index files failed to download, they have been ignored, or old ones used instead.

    gpg --keyserver pgpkeys.mit.edu --recv-key 8B48AD6246925553
    gpg -a --export 8B48AD6246925553 | apt-key add -

    Install the MongoDB packages.

    You can install either the latest stable version of MongoDB or a specific version of MongoDB.
    export LANGUAGE=en_US.UTF-8
    export LANG=en_US.UTF-8
    locale-gen en_US.UTF-8
    export LC_ALL=en_US.UTF-8
    dpkg-reconfigure locales
    
    

    Install the latest stable version of MongoDB.

    Issue the following command:
    sudo apt-get install -y mongodb-org 

    Install a specific release of MongoDB.

    Specify each component package individually and append the version number to the package name, as in the following example:


    3.0.2 mongodb-org-server=3.0.2 mongodb-org-shell=3.0.2 mongodb-org-mongos=3.0.2 mongodb-org-tools=3.0.2
    If we get this error as below, go to


    [FAIL] Starting database: mongod failed!
    invoke-rc.d: initscript mongod, action "start" failed.
    dpkg: error processing mongodb-org-server (--configure):
     subprocess installed post-installation script returned error exit status 1
    Setting up mongodb-org-mongos (3.0.2) ...
    Setting up mongodb-org-tools (3.0.2) ...
    dpkg: dependency problems prevent configuration of mongodb-org:
     mongodb-org depends on mongodb-org-server; however:
      Package mongodb-org-server is not configured yet.

    dpkg: error processing mongodb-org (--configure):
     dependency problems - leaving unconfigured
    Errors were encountered while processing:
     mongodb-org-server
     mongodb-org
    E: Sub-process /usr/bin/dpkg returned an error code (1)

    Make sure remove "/tmp/mongodb-27017.sock" if there is any.
    Also, go to "/var/log/mongodb/mongod.log" to see the logs.
    If the log showing insufficient space related error.
    Put "smallfiles=true" in the etc/mongod.conf to get over it for now and raise up with CAV to give more spaces for the related path.


  • No comments:

    Post a Comment

    WFFM Web form for marketer fail to submit in Sitecore

    I have setup a standard form using WFFM in Sitecore 8.2. It always fail when submit. Error as below, Error: Exception: System.Data.DataE...