By chance, I got a book, Amosq.haviv, "MEAN Web development." Originally did not know this thing, looked under the catalogue to find just have to speak MongoDB only. The project just needed to do mongodb content, then the book was thrown aside time to read.
Yesterday had time to turn out to look under, found mean and I thought mean is not the same thing.
Here we dig a new hole, "MEAN Web series"
Of course this article only about CentOS7 under the installation of MongoDB and service operation (boot)
Maybe my centos yum version is not enough, I can't find the MongoDB installation package directly using the Yum Install command. Then use the original method, download the latest version of the 3.2.3 Tgz package from the official website.
MongoDB installation is very easy, unzip to the specified location and then start from the command line, the front steps and the installation of Windows is not much different. A general explanation can be done.
1. Download and unzip:
I put the program under the/usr/local/mongodb/, the command is simple:
Cd/usr/local/cp/home/user/desktop/software/mongodb-linux-x86_64-3.2.3.tgz./TAR-ZXVF mongodb-linux-x86_64-3.2.3. tgz MV mongodb-linux-x86_64-3.2.3 MongoDB
So you can get the final MongoDB folder, inside the file structure is as follows:
The bin folder is the main program directory of MongoDB, which contains all the necessary executable files.
2. Configure DB data file path and log path
MongoDB database files require a separate DB folder, and internal files will be created automatically. Log files are also created automatically when the configuration is installed. We put it in the installation directory by default
namely:/usr/local/mongodb/data/and/usr/local/mongodb/logs/
3. The command line starts directly:
Let's look in the/bin directory:
The focus is on the Mongod and MONGO two executables.
In fact, Mongod is the equivalent of a server-side program, MONGO is a client program. Two programs are fully command-line operations, and directly support the syntax of JS format.
The start command is as follows:
Mongodb/bin/mongod--dbpath mongodb/data/--logpath mongodb/logs/log-fork#mongod for managing server side, Command-line startup needs to specify its Data folder path and log path.
Run effect
To test with a subclient connection:
See the contents of the red box, as long as the failure to report other errors is the connection success.
Of course there is a warning, because I started with sudo permissions, it is not safe to do so.
4. Configure MongoDB Dedicated Account
5. Configure the MongoDB boot from boot
6. Basic Operation Test
(After several parts of the evening continue more)
"MEAN Web Development" CentOS 7 installation MongoDB 3.2.3