MongoDB database installation configuration under Kali Linux
1, download mongodb.tgz compressed;
2, to extract: tar -zxvf mongodb.tgz / usr / local / mongodb
3. Create and log data storage needs of database runtime: mkdir -p / usr / local / mongodb / data mkdir -p / usr / local / mongodb / logs
4, configure the startup parameters vi /etc/mongodb.conf mongodb
dbpath=/usr/local/mongodb/data
master=true
logpath=/usr/local/mongodb/logs/mongodb.log
logappend=true
5, enter mongodb installation directory cd / usr / local / mongodb / bin run mongodb: ./mongod -f /etc/mongodb.conf & by
ps -def | grep mongod
can view the service process has been started.
6, let mongodb it from the start when the system starts: / bin / mongod -f in /etc/rc.local / usr / local / mongodb /etc/mongodb.conf &
7, adding environment variables, edit the command: vi / etc / profile, profile add the following code in the last line: export PATH = $ PATH: / usr / local / mongodb / bin and then use the following command: source / etc / profile # make configuration takes effect immediately
8, and then restart the server, use: mongo # MongoDB into the console show dbs # view the default database MongoDB exit # exit console