|
Recently the company database to use MongoDB, but know that it is only concerned before distributed non-relational databases, data stored in the form of documents, data format is similar to the bson json format. As for the specific use and how to call java and not too much contact today spend one day understand MongoDB installed under Linux and the basic command-line invocation.
1. Linux Install MongoDB under
Enter the official website:
https://docs.mongodb.org/manual/tutorial/install-mongodb-on-Ubuntu/
Found Download:
https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.2.1.tgz
2. Use: wget to download the database to obtain: mongodb-linux-x86_64-3.2.1.tgz installation package
3. Use: tar-zxvf extracting archive
Here already downloaded executable file does not extract to a local, you can move the database to the next / user / local and then start the database in order to join the boot. Start here with the command directly.
4. Into the executable file in the bin
cd out mongodb-linux-x86_64-3.2.1 / bin
1. Show all files
ls -al
Here I have created a folder to store data with data mkdir, logs stored in the log information
6. See all of the commands to start the database parameters
./mongod --help
We can get help through this way
7. Start the database
./mongod --dbpath = / usr / local / mongodb / data --logpath = / usr / local / mongodb. / logs --logappend --port = 6699 --fork
dbpath storage location, logpath log path, logappend additional forms, port port number, fork boot.
1. Start verification
./mongo --port 6699
So that we can use the command line to operate the database.
9. Close the database service.
pkill mongod or (input into the client window: db.shuidownServer (), under the admin) |
|
|
|