1.Import the public key used by the package management system. this is
to ensure package consistency and authenticity by requiring that distributors sign packages with GPG keys
ram@ram-pc:~$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
[sudo] password for ram:
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.T0369j2BIX --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
gpg: requesting key 7F0CEB10 from hkp server keyserver.ubuntu.com
gpg: key 7F0CEB10: public key "Richard Kreuter <richard@10gen.com>" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
ram@ram-pc:~$
2. Create a list file for MongoDB.
ram@ram-pc:~$ echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 multiverse
3. Reload local package database
ram@ram-pc:~$ sudo apt-get update
4. Install the MongoDB packages.
ram@ram-pc:~$ sudo apt-get install -y mongodb-org
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
mongodb-org-mongos mongodb-org-server mongodb-org-shell mongodb-org-tools
The following NEW packages will be installed:
mongodb-org mongodb-org-mongos mongodb-org-server mongodb-org-shell
mongodb-org-tools
0 upgraded, 5 newly installed, 0 to remove and 290 not upgraded.
Need to get 50.7 MB of archives.
After this operation, 157 MB of additional disk space will be used.
Get:1 http://repo.mongodb.org/apt/ubuntu/ trusty/mongodb-org/3.0/multiverse mongodb-org-shell amd64 3.0.4 [4,245 kB]
Get:2 http://repo.mongodb.org/apt/ubuntu/ trusty/mongodb-org/3.0/multiverse mongodb-org-server amd64 3.0.4 [8,607 kB]
Get:3 http://repo.mongodb.org/apt/ubuntu/ trusty/mongodb-org/3.0/multiverse mongodb-org-mongos amd64 3.0.4 [4,029 kB]
Get:4 http://repo.mongodb.org/apt/ubuntu/ trusty/mongodb-org/3.0/multiverse mongodb-org-tools amd64 3.0.4 [33.8 MB]
Get:5 http://repo.mongodb.org/apt/ubuntu/ trusty/mongodb-org/3.0/multiverse mongodb-org amd64 3.0.4 [3,616 B]
Fetched 50.7 MB in 37s (1,355 kB/s)
Selecting previously unselected package mongodb-org-shell.
(Reading database ... 168992 files and directories currently installed.)
Preparing to unpack .../mongodb-org-shell_3.0.4_amd64.deb ...
Unpacking mongodb-org-shell (3.0.4) ...
Selecting previously unselected package mongodb-org-server.
Preparing to unpack .../mongodb-org-server_3.0.4_amd64.deb ...
Unpacking mongodb-org-server (3.0.4) ...
Selecting previously unselected package mongodb-org-mongos.
Preparing to unpack .../mongodb-org-mongos_3.0.4_amd64.deb ...
Unpacking mongodb-org-mongos (3.0.4) ...
Selecting previously unselected package mongodb-org-tools.
Preparing to unpack .../mongodb-org-tools_3.0.4_amd64.deb ...
Unpacking mongodb-org-tools (3.0.4) ...
Selecting previously unselected package mongodb-org.
Preparing to unpack .../mongodb-org_3.0.4_amd64.deb ...
Unpacking mongodb-org (3.0.4) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Processing triggers for ureadahead (0.100.0-16) ...
ureadahead will be reprofiled on next reboot
Setting up mongodb-org-shell (3.0.4) ...
Setting up mongodb-org-server (3.0.4) ...
Adding system user `mongodb' (UID 117) ...
Adding new user `mongodb' (UID 117) with group `nogroup' ...
Not creating home directory `/home/mongodb'.
Adding group `mongodb' (GID 125) ...
Done.
Adding user `mongodb' to group `mongodb' ...
Adding user mongodb to group mongodb
Done.
mongod start/running, process 3003
Setting up mongodb-org-mongos (3.0.4) ...
Setting up mongodb-org-tools (3.0.4) ...
Processing triggers for ureadahead (0.100.0-16) ...
Setting up mongodb-org (3.0.4) ...
5. Install the latest stable version of MongoDB.
ram@ram-pc:~$ sudo apt-get install -y mongodb-org=3.0.4 mongodb-org-server=3.0.4 mongodb-org-shell=3.0.4 mongodb-org-mongos=3.0.4 mongodb-org-tools=3.0.4
Reading package lists... Done
Building dependency tree
Reading state information... Done
mongodb-org is already the newest version.
mongodb-org-mongos is already the newest version.
mongodb-org-mongos set to manually installed.
mongodb-org-server is already the newest version.
mongodb-org-server set to manually installed.
mongodb-org-shell is already the newest version.
mongodb-org-shell set to manually installed.
mongodb-org-tools is already the newest version.
mongodb-org-tools set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 290 not upgraded.
6. Start mongodb service
ram@ram-pc:~$ sudo service mongod start
start: Job is already running: mongod
6. Connect mongo shell
ram@ram-pc:~$ mongo
MongoDB shell version: 3.0.4
connecting to: test
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
http://docs.mongodb.org/
Questions? Try the support group
http://groups.google.com/group/mongodb-user
Server has startup warnings:
2015-06-16T22:08:48.583+0530 I CONTROL [initandlisten]
2015-06-16T22:08:48.583+0530 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2015-06-16T22:08:48.583+0530 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2015-06-16T22:08:48.583+0530 I CONTROL [initandlisten]
2015-06-16T22:08:48.583+0530 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2015-06-16T22:08:48.583+0530 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2015-06-16T22:08:48.583+0530 I CONTROL [initandlisten]
>
Source/Reference:
http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/
http://docs.mongodb.org/getting-started/shell/client/
to ensure package consistency and authenticity by requiring that distributors sign packages with GPG keys
ram@ram-pc:~$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
[sudo] password for ram:
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.T0369j2BIX --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
gpg: requesting key 7F0CEB10 from hkp server keyserver.ubuntu.com
gpg: key 7F0CEB10: public key "Richard Kreuter <richard@10gen.com>" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
ram@ram-pc:~$
2. Create a list file for MongoDB.
ram@ram-pc:~$ echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 multiverse
3. Reload local package database
ram@ram-pc:~$ sudo apt-get update
4. Install the MongoDB packages.
ram@ram-pc:~$ sudo apt-get install -y mongodb-org
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
mongodb-org-mongos mongodb-org-server mongodb-org-shell mongodb-org-tools
The following NEW packages will be installed:
mongodb-org mongodb-org-mongos mongodb-org-server mongodb-org-shell
mongodb-org-tools
0 upgraded, 5 newly installed, 0 to remove and 290 not upgraded.
Need to get 50.7 MB of archives.
After this operation, 157 MB of additional disk space will be used.
Get:1 http://repo.mongodb.org/apt/ubuntu/ trusty/mongodb-org/3.0/multiverse mongodb-org-shell amd64 3.0.4 [4,245 kB]
Get:2 http://repo.mongodb.org/apt/ubuntu/ trusty/mongodb-org/3.0/multiverse mongodb-org-server amd64 3.0.4 [8,607 kB]
Get:3 http://repo.mongodb.org/apt/ubuntu/ trusty/mongodb-org/3.0/multiverse mongodb-org-mongos amd64 3.0.4 [4,029 kB]
Get:4 http://repo.mongodb.org/apt/ubuntu/ trusty/mongodb-org/3.0/multiverse mongodb-org-tools amd64 3.0.4 [33.8 MB]
Get:5 http://repo.mongodb.org/apt/ubuntu/ trusty/mongodb-org/3.0/multiverse mongodb-org amd64 3.0.4 [3,616 B]
Fetched 50.7 MB in 37s (1,355 kB/s)
Selecting previously unselected package mongodb-org-shell.
(Reading database ... 168992 files and directories currently installed.)
Preparing to unpack .../mongodb-org-shell_3.0.4_amd64.deb ...
Unpacking mongodb-org-shell (3.0.4) ...
Selecting previously unselected package mongodb-org-server.
Preparing to unpack .../mongodb-org-server_3.0.4_amd64.deb ...
Unpacking mongodb-org-server (3.0.4) ...
Selecting previously unselected package mongodb-org-mongos.
Preparing to unpack .../mongodb-org-mongos_3.0.4_amd64.deb ...
Unpacking mongodb-org-mongos (3.0.4) ...
Selecting previously unselected package mongodb-org-tools.
Preparing to unpack .../mongodb-org-tools_3.0.4_amd64.deb ...
Unpacking mongodb-org-tools (3.0.4) ...
Selecting previously unselected package mongodb-org.
Preparing to unpack .../mongodb-org_3.0.4_amd64.deb ...
Unpacking mongodb-org (3.0.4) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Processing triggers for ureadahead (0.100.0-16) ...
ureadahead will be reprofiled on next reboot
Setting up mongodb-org-shell (3.0.4) ...
Setting up mongodb-org-server (3.0.4) ...
Adding system user `mongodb' (UID 117) ...
Adding new user `mongodb' (UID 117) with group `nogroup' ...
Not creating home directory `/home/mongodb'.
Adding group `mongodb' (GID 125) ...
Done.
Adding user `mongodb' to group `mongodb' ...
Adding user mongodb to group mongodb
Done.
mongod start/running, process 3003
Setting up mongodb-org-mongos (3.0.4) ...
Setting up mongodb-org-tools (3.0.4) ...
Processing triggers for ureadahead (0.100.0-16) ...
Setting up mongodb-org (3.0.4) ...
5. Install the latest stable version of MongoDB.
ram@ram-pc:~$ sudo apt-get install -y mongodb-org=3.0.4 mongodb-org-server=3.0.4 mongodb-org-shell=3.0.4 mongodb-org-mongos=3.0.4 mongodb-org-tools=3.0.4
Reading package lists... Done
Building dependency tree
Reading state information... Done
mongodb-org is already the newest version.
mongodb-org-mongos is already the newest version.
mongodb-org-mongos set to manually installed.
mongodb-org-server is already the newest version.
mongodb-org-server set to manually installed.
mongodb-org-shell is already the newest version.
mongodb-org-shell set to manually installed.
mongodb-org-tools is already the newest version.
mongodb-org-tools set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 290 not upgraded.
6. Start mongodb service
ram@ram-pc:~$ sudo service mongod start
start: Job is already running: mongod
6. Connect mongo shell
ram@ram-pc:~$ mongo
MongoDB shell version: 3.0.4
connecting to: test
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
http://docs.mongodb.org/
Questions? Try the support group
http://groups.google.com/group/mongodb-user
Server has startup warnings:
2015-06-16T22:08:48.583+0530 I CONTROL [initandlisten]
2015-06-16T22:08:48.583+0530 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2015-06-16T22:08:48.583+0530 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2015-06-16T22:08:48.583+0530 I CONTROL [initandlisten]
2015-06-16T22:08:48.583+0530 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2015-06-16T22:08:48.583+0530 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2015-06-16T22:08:48.583+0530 I CONTROL [initandlisten]
>
Source/Reference:
http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/
http://docs.mongodb.org/getting-started/shell/client/
No comments:
Post a Comment