MongoDB是一个基于分布式文件存储的数据库。由C++语言编写。旨在为WEB应用提供可扩展的高性能数据存储解决方案。
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
$ mkdir /byrd/tools -p $ cd /byrd/tools $ wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel70-4.0.4.tgz $ tar zxf mongodb-linux-x86_64-rhel70-4.0.4.tgz $ mv mongodb-linux-x86_64-rhel70-4.0.4 /opt/ $ ln -s /opt/mongodb-linux-x86_64-rhel70-4.0.4 /usr/local/mongodb $ mkdir /usr/local/mongodb/data/db -p $ mkdir /usr/local/mongodb/logs $ mkdir /usr/local/mongodb/conf $ mkdir /var/run/mongodb/ $ echo "export PATH=/usr/local/mongodb/bin:$PATH" >> /etc/profile $ source /etc/profile $ /usr/local/mongodb/bin/mongod -f /usr/local/mongodb/conf/mongod.conf $ grep -v "^#\|^$" /usr/local/mongodb/conf/mongod.conf systemLog: destination: file logAppend: true path: /usr/local/mongodb/logs/mongod.log storage: dbPath: /usr/local/mongodb/data/db journal: enabled: true processManagement: fork: true pidFilePath: /var/run/mongodb/mongod.pid timeZoneInfo: /usr/share/zoneinfo net: port: 27017 bindIp: 127.0.0.1 > use admin switched to db admin > db.createUser( {user: "byrd",pwd: "123456",roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]}); Successfully added user: { "user" : "byrd", "roles" : [ { "role" : "userAdminAnyDatabase", "db" : "admin" } ] } > show users { "_id" : "admin.byrd", "user" : "byrd", "db" : "admin", "roles" : [ { "role" : "userAdminAnyDatabase", "db" : "admin" } ], "mechanisms" : [ "SCRAM-SHA-1", "SCRAM-SHA-256" ] } |
资料来源:
0:http://www.runoob.com/mongodb/nosql.html
1:https://baike.baidu.com/item/mongodb/60411
2:https://www.mongodb.com/download-center/community
3:https://www.mongodb.org/dl/linuxSourceByrd's Weblog-https://note.t4x.org/basic/rhel-install-mongodb/
SourceByrd's Weblog-https://note.t4x.org/basic/rhel-install-mongodb/
申明:除非注明Byrd's Blog内容均为原创,未经许可禁止转载!详情请阅读版权申明!