Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install MongoDB server in Fedora

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

How to install MongoDB server in Fedora? for this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and easy way.

How to install a MongoDB server from upstream

When Fedora users want to install the MongoDB server, they need to get the MongoDB directly upstream. However, the upstream does not provide RPM packages for Fedora. Instead, the MongoDB server can get the source tarball, and users need to compile it themselves (which requires some development knowledge), or Fedora users can use some compatible packages. Among the compatible options, the best choice is RHEL-8 RPM. The following steps describe how to install them and how to start the daemon.

1. Create a warehouse using upstream RPM (RHEL-8 build)

$sudo cat > / etc/yum.repos.d/mongodb.repo > > EOF [mongodb-upstream] name=MongoDB Upstream Repositorybaseurl= https://repo.mongodb.org/yum/redhat/8Server/mongodb-org/4.2/x86_64/gpgcheck=1enabled=1gpgkey=https://www.mongodb.org/static/pgp/server-4.2.ascEOF

2. Install meta software packages to pull servers and toolkits

Sudo dnf install mongodb-org.Installed: mongodb-org-4.2.3-1.el8.x86_64 mongodb-org-mongos-4.2.3-1.el8.x86_64 mongodb-org-server-4.2.3-1.el8.x86_64 mongodb-org-shell-4.2.3-1.el8.x86_64 mongodb-org-tools-4.2.3-1.el8.x86_64 Complete!

3. Start the MongoDB daemon

$sudo systemctl status mongod ● mongod.service-MongoDB Database Server Loaded: loaded (/ usr/lib/systemd/system/mongod.service; enabled; vendor preset: disabled) Active: active (running) since Sat 2020-02-08 12:33:45 EST 2s ago Docs: https://docs.mongodb.org/manual Process: 15768 ExecStartPre=/usr/bin/mkdir-p / var/run/mongodb (code=exited, status=0/SUCCESS) Process: 15769 ExecStartPre=/usr/bin/chown mongod:mongod / var/run/mongodb (code=exited, status=0/SUCCESS) Process: 15770 ExecStartPre=/usr/bin/chmod 0755 / var/run/mongodb (code=exited, status=0/SUCCESS) Process: 15771 ExecStart=/usr/bin/mongod $OPTIONS (code=exited Status=0/SUCCESS) Main PID: 15773 (mongod) Memory: 70.4m CPU: 611ms CGroup: / system.slice/mongod.service

4. Use mongo shell to connect to the server to verify whether it is running.

$mongoMongoDB shell version v4.2.3connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodbImplicit session: session {"id": UUID ("20b6e61f-c7cc-4e9b-a25e-5e306d60482f")} MongoDB server version: 4.2.3Welcome to the MongoDB shell.For interactive help, type "help" .for more comprehensive documentation, see http://docs.mongodb.org/--- 's answer to the question on how to install MongoDB server in Fedora is shared here. I hope the above content can help you to a certain extent, if you still have a lot of doubts to be solved, you can follow the industry information channel to learn more related knowledge.

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report