In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
The operating system environment is as follows:
[root@zxl-nginx ~] # cat / etc/issueCentOS release 6.4 (Final) Kernel\ r on an\ m [root@zxl-nginx ~] # uname-r2.6.32-358.el6.x86_64
Mongodb2.6 download address
# wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.6.11.tgz
Install mongodb2.6
[root@zxl-nginx src] # ll mongodb-linux-x86_64-2.6.11.gz-rw-r--r-- 1 root root 116659120 Dec 13 09:32 mongodb-linux-x86_64-2.6.11.gz [root@zxl-nginx src] # tar fxz mongodb-linux-x86_64-2.6.11.gz [root@zxl-nginx src] # mv mongodb-linux-x86_64-2.6.11 / usr/local/ [root@zxl-nginx src] # ln-s / usr/local/mongodb-linux-x86_64-2.6.11 / usr/local/mongodb
Create a mongodb user
[root@zxl-nginx src] # groupadd-r mongodb [root@zxl-nginx src] # useradd-r-g mongodb mongodb
Create a mongodb database and logs directory
[root@zxl-nginx src] # mkdir / data/ [root@zxl-nginx src] # mkdir / data/logs / data/m20000 [root@zxl-nginx src] # chown mongodb.mongodb / data-R
Mongo environment variable configuration
Vim / etc/profileexport PATH=$PATH:/usr/local/mongodb/bin
Load environment profile
Source / ect/profile
Start mongodb
Mongod-dbpath=/data/m20000/-logpath=/data/logs/m20000.log-logappend-fork-port 20000
Log in to mongodb
[root@zxl-nginx ~] # mongo-- port 20000MongoDB shell version: 2.6.11connecting to: 127.0.0.1:20000/test > dbtest
Create data and view
> use zxlswitched to db zxl > db.ha.insert ({name: "abc", age:21}) WriteResult ({"nInserted": 1}) > db.ha.find () {"_ id": ObjectId ("56739b27154b52481c1c5749"), "name": "abc", "age": 21}
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.