Wednesday, February 20, 2019

Basic MongoDB(NoSQL) Part 02:Installation on Windows and Linux

MongoDB Part 02: Installation on Windows and Linux


>>>   Installation   <<<
>     Windows     <
>         Linux        <




          1. Check current OS version and after downloading installation file then install it. Here is the page for installation file URLhttps://www.mongodb.com/download-center#community 



         2. MongoDB folder is moved from default installed path to \Database folder as depicted. This state is the state before launching mongod.exe at server-side with specific database path.
        3. To verify running port by using telnet client it will accept connection from telnet if server properly runs on waiting state.
         4. Use mongo.exe client instead telnet client for making a connection to mongod.exe server at running port. It looks like Oracle and sqlplus which is server and client respectively.




kevin@phoenix:~$ cat installation.log

# 01 command for requesting keyserver
# Below adding key commands raised error then I ignored it.
# This OS is Debian-based 
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
 
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10

# 02 create a empty source file for MongoDB repository
sudo touch /etc/apt/sources.list.d/mongodb.list

# 03 insert below line in created source file
deb http://repo.mongodb.org/apt/debian jessie/mongodb-org/3.4 main

# 04 update header files of all repositories by command
sudo apt-get update

# 05 in case properly fetching repository you can install MongoDB by command
sudo apt-get install mongodb
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
  libboost-regex1.62.0 libgoogle-perftools4 libpcrecpp0v5 libtcmalloc-minimal4
  libunwind8 libyaml-cpp0.5v5 mongo-tools mongodb-clients mongodb-server
The following NEW packages will be installed:
  libboost-regex1.62.0 libgoogle-perftools4 libpcrecpp0v5 libtcmalloc-minimal4
  libunwind8 libyaml-cpp0.5v5 mongo-tools mongodb mongodb-clients
  mongodb-server
0 upgraded, 10 newly installed, 0 to remove and 400 not upgraded.
Need to get 11.9 MB/45.8 MB of archives.
After this operation, 196 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y

Get:1 http://mirror.kku.ac.th/kali kali-rolling/main amd64 mongodb-server amd64 1:3.2.11-2 [11.9 MB]
Get:2 http://mirror.kku.ac.th/kali kali-rolling/main amd64 mongodb amd64 1:3.2.11-2 [16.8 kB]
Fetched 3821 kB in 6s (628 kB/s)
Selecting previously unselected package libpcrecpp0v5:amd64.
(Reading database ... 305507 files and directories currently installed.)
Preparing to unpack .../0-libpcrecpp0v5_2%3a8.39-3_amd64.deb ...
Unpacking libpcrecpp0v5:amd64 (2:8.39-3) ...
Selecting previously unselected package libboost-regex1.62.0:amd64.
Preparing to unpack .../1-libboost-regex1.62.0_1.62.0+dfsg-4_amd64.deb ...
Unpacking libboost-regex1.62.0:amd64 (1.62.0+dfsg-4) ...
Selecting previously unselected package libtcmalloc-minimal4.
Preparing to unpack .../2-libtcmalloc-minimal4_2.5-2.2_amd64.deb ...
Unpacking libtcmalloc-minimal4 (2.5-2.2) ...
Selecting previously unselected package libunwind8.
Preparing to unpack .../3-libunwind8_1.1-4.1_amd64.deb ...
Unpacking libunwind8 (1.1-4.1) ...
Selecting previously unselected package libgoogle-perftools4.
Preparing to unpack .../4-libgoogle-perftools4_2.5-2.2_amd64.deb ...
Unpacking libgoogle-perftools4 (2.5-2.2) ...
Selecting previously unselected package libyaml-cpp0.5v5:amd64.
Preparing to unpack .../5-libyaml-cpp0.5v5_0.5.2-4_amd64.deb ...
Unpacking libyaml-cpp0.5v5:amd64 (0.5.2-4) ...
Selecting previously unselected package mongo-tools.
Preparing to unpack .../6-mongo-tools_3.2.11-1+b2_amd64.deb ...
Unpacking mongo-tools (3.2.11-1+b2) ...
Selecting previously unselected package mongodb-clients.
Preparing to unpack .../7-mongodb-clients_1%3a3.2.11-2_amd64.deb ...
Unpacking mongodb-clients (1:3.2.11-2) ...
Selecting previously unselected package mongodb-server.
Preparing to unpack .../8-mongodb-server_1%3a3.2.11-2_amd64.deb ...
Unpacking mongodb-server (1:3.2.11-2) ...
Selecting previously unselected package mongodb.
Preparing to unpack .../9-mongodb_1%3a3.2.11-2_amd64.deb ...
Unpacking mongodb (1:3.2.11-2) ...
Setting up libboost-regex1.62.0:amd64 (1.62.0+dfsg-4) ...
Setting up libtcmalloc-minimal4 (2.5-2.2) ...
Setting up libunwind8 (1.1-4.1) ...
Processing triggers for libc-bin (2.24-9) ...
Processing triggers for systemd (232-22) ...
Processing triggers for man-db (2.7.6.1-2) ...
Setting up libpcrecpp0v5:amd64 (2:8.39-3) ...
Setting up libyaml-cpp0.5v5:amd64 (0.5.2-4) ...
Setting up mongo-tools (3.2.11-1+b2) ...
Setting up libgoogle-perftools4 (2.5-2.2) ...
Setting up mongodb-clients (1:3.2.11-2) ...
Setting up mongodb-server (1:3.2.11-2) ...
update-rc.d: We have no instructions for the mongodb init script.
update-rc.d: It looks like a network service, we disable it.
Setting up mongodb (1:3.2.11-2) ...
Processing triggers for libc-bin (2.24-9) ...
Processing triggers for systemd (232-22) ...

kevin@phoenix:~$


kevin@phoenix:~$ uname -a
Linux kali 4.9.0-kali3-amd64 #1 SMP Debian 4.9.18-1kali1 (2017-04-04) x86_64 GNU/Linux
 
kevin@phoenix:~$ 
kevin@phoenix:~$ sudo service mongodb start
[sudo] password for kevin:
 
kevin@phoenix:~$   
kevin@phoenix:~$ ps -ef |grep mongodb
mongodb    355     1  1 12:14 ?        00:00:00 /usr/bin/mongod --unixSocketPrefix=/run/mongodb --config /etc/mongodb.conf
kevin      374  1867  0 12:14 pts/1    00:00:00 grep mongodb
 

kevin@phoenix:~$  

kevin@phoenix:~$ mongo
MongoDB shell version: 3.2.11
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
> db.test.save( { kevin: 1 } )
WriteResult({ "nInserted" : 1 })
>
> db.test.find()
{ "_id" : ObjectId("5947c09d5dba0e5c41e89b48"), "kevin" : 1 }
>
>
> exit
bye
 
kevin@phoenix:~$  
kevin@phoenix:~$ sudo service mongodb restart 
kevin@phoenix:~$ ps -ef |grep mongodb
mongodb    395     1 25 12:17 ?        00:00:00 /usr/bin/mongod --unixSocketPrefix=/run/mongodb --config /etc/mongodb.conf
kevin      413  1867  0 12:17 pts/1    00:00:00 grep mongodb
 
kevin@phoenix:~$  
kevin@phoenix:~$ sudo service mongodb stop    
kevin@phoenix:~$ ps -ef |grep mongodb
kevin      447  1867  0 12:17 pts/1    00:00:00 grep mongodb
 
kevin@phoenix:~$
 





You may leave comment to improve it.
Thank you from THAILAND.
 

No comments:

Android OS: Fundamental Awareness

Thai government single policy     *** IMPORTANT *** Please carefully take a look this post https://chattrawits-security.blogspo...