In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Today, I will talk to you about how to install MongoDB in the Linux system, many people may not know much about it. In order to make you understand better, the editor has summarized the following content for you. I hope you can get something according to this article.
Configure the YumSource of MongoDB: vi / etc/yum.repos.d/mongodb-4.0.repo [mongodb-org-4.0] name=MongoDB Repositorybaseurl= https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.0/x86_64/gpgcheck=1enabled=1gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc
Install MongoDB:yum install-y mongodb-org Note: yum installation installs the following packages: MongoDB official source contains the following dependent packages: mongodb-org: MongoDB meta-package, the installation automatically installs the following four component packages: mongodb-org-server: contains the Mongod daemon and related configuration files and init system service scripts. Mongodb-org-mongos: a daemon that contains mongos. Mongodb-org-shell: contains mongo shell. Mongodb-org-tools: management tools including MongoDB: mongoimport, bsondump, mongodump, mongoexport, mongofiles, mongooplog, mongoperf, mongorestore, mongostat, and mongotop. Modify the configuration file vi / etc/mongod.conf bind_ip=192.168.80.100 of mangodb to set the listening port to facilitate the connection of systemctl start mongod.servicenetstat-anpt | grep mongod
Mongo login:
Mongo
-above is yum installation mongodb-
Source code compilation
1. Download wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel70-4.0.5.tgz2, extract the package tar xzvf mongodb-linux-x86_64-rhel70-4.0.5.tgz-C / opt/3, move the extracted directory to / usr/local and rename it to mongodbcd / opt/mv mongodb-linux-x86_64-rhel70-4.0.0 / / usr/local/mongodb4, Create a data storage directory and a log file directory mkdir-p / usr/local/mongodb/data/dbmkdir-p / usr/local/mongodb/logs5, Edit the mongodb startup configuration file cd / usr/local/mongodb/binvim mongodb.conf dbpath = / usr/local/mongodb/data/db / / data storage directory logpath = / usr/local/mongodb/logs/mongodb.log / / log file directory fork = true / / background running auth=true / / authentication bind_ip=0.0.0.0 / / listening address 6, the executable file of mongodb is located in the bin directory You need to add it to the PATH path at the end of vim / etc/profileexport MONGODB_HOME=/usr/local/mongodbexport PATH=$PATH:$MONGODB_HOME/bin / / add source / etc/profile / / reload environment variable 7, start mongodbcd / usr/local/mongodb/binmongod-f mongodb.conf / / start 8, connect to mongodb and visit / usr/local/mongodb/bin/mongo or mangodb to see the above, do you have any further understanding of how to install MongoDB in Linux system? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
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.