. The command is as follows (the command is executed below mongdb after the package is decompressed and renamed ):
e.1mkdirdb
e.3 mkdir logs
F. Start mongoDB to verify whether the installation is successful. The database directory option specified here is the database created in mongodb. If the command is as follows, the system prompts that the installation is successful.
f.1./bin/mongod--dbpath
/mongodb.log--auth--logappendAfter startup, the default port is 27017, which detectsNetstat-tunlp1.5 Starting the ClientNo certification required$sudo MONGOCertification requiredsudo mongo-u user-p pwd ip:port/db_log1.6 Close MongodWall Crack RecommendationEnter MONGO ShellUse Admindb.shutdownserver ()Orsudo killall mongodresolutely oppose kill-9 Mongod2. Set the passwordNote : The V3 version of MongoDB no longer uses adduser, but uses Db.createuser.T
logpath to run the mongodb Service
Connect to mongoDB?
assad@DESKTOP-assad ~ $ mongo
MongoDB shell version v3.6.2
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 3.6.2
......
>Here I already set? Mongodb-3.6.2/b
opened.
Vi/etc/sysconfig/iptables
Directly in the configuration file-A input under those commands
Add a line:
-A input-m state--state new-m tcp-p TCP--dport 27017-j ACCEPT
Restarting the firewall
[root@ser6-52 mongodb]#/etc/init.d/iptables Restart
Iptables:setting chains to Policy Accept:filter [OK]
iptables:flushing fi
\mongodb\data"
D:\set up\mongodb\bin> Mongo.exeMongoDB installed in UbuntuRun the following command to import the MongoDB public GPG key: sudo apt-key adv--keyserver HKP://keyserver.ubuntu.com:80--recv 7f0ceb10 Use the following command to create a/etc/apt/sources.list.d/mongodb.list file Echo ' Deb Http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10
passwordmongodb:primary> Use adminSwitched to DB adminMongodb:primary> db.adduser (' root ', ' 123456 '); (Wrong way)V3 version MongoDB no longer uses adduser, but uses the Db.createuser2015-09-27t09:10:34.491+0800 E QUERY typeerror:property ' addUser ' of object admin is not a functionat (Shell): 1:4mongodb:primary> Use adminSwitched to DB adminMongodb:primary> Db.createuser (... {... User: "Admin",... pwd: "admin",... roles: [{role: ' Useradminanyd
: 127.0.0.1• Default port MongoDB is listening: 27017
You can modify the above information by editing/etc/mongod. conf.
Enable/disable$ Sudo service producer D start$ Sudo service producer D stop$ Sudo service producer D restart
Install PHP Mongodb Driver
1. install DriverEcho "no"> answers.txtSudo pecl install mongo Rm answers.txt
2. Enable PHP ExtensionEcho 'ex
192.168.1.12 javasdb12.kk.net 21018
192.168.1.13 mongodb13.kk.net 21019
192.168.1.14 mongodb14.kk.net 21020
The test structure is as follows:
Note: Before configuration, make sure that the Members you want to join the cluster can connect to each other.
[1. Configure config servers] (on 192.168.1.14 server)
Configuration server (Config serversStore cluster metadata, so Configure the server first. To configure the server, you must use the-configsvr parameter to start the mongod service. If
MongoDB Study Notes (1) -- install MongoDB in Windows and take mongodb Study Notes
First, download the windows Installation Package for mongodb from the official website, select a 32-bit or 64-bit version based on your system type, and then follow the prompts to complete the next step. If the installation directory is
create a text file, enter
Mongod -- dbpath D: \ MongoDB \ mongoDBdata
Save it as a batch file suffixed with. bat
This is a file for enabling the Service. You can click this file to enable the Service directly, without the need to use cmd to enter the corresponding directory.
Note that there is a cmd.exe program in the D: \ MongoDB \ mongoDB \ bindirectory to con
Mongodb series: first recognized by Mongodb and first recognized by mongodb Series
I. background:
We are honored to have taken part in the examination system maintenance at the beginning of the month. (For more information, see the activities we attended in those years: System Maintenance summary for the first half of the 15 years.) It is mainly responsible for s
/local/src/3. Unpack the expansion packTAR-ZXF mongodb-1.1.9.tgz4. Enter the MongoDB expansion directory, compile and install the extensionCD mongodb-1.1.9/phpize./configure--with-php-config=/usr/local/php/bin/php-configmake make install5. Modify the php.ini fileVim/usr/local/php/etc/php.ini6. Add mongodb.so extension configuration, save exitExtension=mongodb.so
/local/src/3. Unpack the expansion packTAR-ZXF mongodb-1.1.9.tgz4. Enter the MongoDB expansion directory, compile and install the extensionCD mongodb-1.1.9/phpize./configure--with-php-config=/usr/local/php/bin/php-configmake make install5. Modify the php.ini fileVim/usr/local/php/etc/php.ini6. Add mongodb.so extension configuration, save exitExtension=mongodb.so
[Learning MongoDB step by step]-Brief Introduction to MongoDB (1), brief introduction to mongodb
In the previous blog, we spoke about NoSQL. We have a comprehensive understanding of NoSQL. Starting from this blog, we will take everyone into the MongoDB world. Next we will introduce
Learning MongoDB 6: MongoDB query (cursor operation, cursor information) (3), mongodb cursorI. Introduction
Db. collection. find () can be used to query based on conditions and specify fields returned using the projection operator to omit this parameter to return all fields in the matching document. The cursor of the matching document is returned. You can modify
more information.The MongoDB instance stores their data files /var/lib/mongodb in and their log files /var/log/mongodb in by default, and runs using the mongodb user AC Count. You can specify alternate log and the data file directories in /etc/mongod.conf . See and for systemLog.path storage.dbPath additional informat
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.