I have executed the curl statement and it worked!
Could be possible that yum has a bug? ¿?
I have executed the curl statement and it worked!
Could be possible that yum has a bug? ¿?
Very unlikely as I can run it in Centos7 and Redhat 7 fine. Are you still trying this on CPanel. Have you contacted their support?
Yes, but they redirect to your documentation.
Which version of yum have you installed? They could be different.
That variable wasn’t defined. I updated that yum.conf and I have got this result:
Loaded plugins: fastestmirror, langpacks, universal-hooks
Loading mirror speeds from cached hostfile
Not my documentation
Try it anywhere other than CPanel. I’m sure it will work.
It appears mongodb-org-4.4 | 2.5 kB but I don’t know if it is installed…
root@server.abelardolg.com [~]# sudo yum install -y mongodb-org-4.4.4 mongodb-org-server-4.4.4 mongodb-org-shell-4.4.4 mongodb-org-mongos-4.4.4 mongodb-org-tools-4.4.4
Loaded plugins: fastestmirror, langpacks, universal-hooks
Loading mirror speeds from cached hostfile
No package mongodb-org-4.4.4 available.
No package mongodb-org-server-4.4.4 available.
No package mongodb-org-shell-4.4.4 available.
No package mongodb-org-mongos-4.4.4 available.
No package mongodb-org-tools-4.4.4 available.
Error: Nothing to do
root@server.abelardolg.com [~]#
How could I check if I can reach your server from my CentOS 7 server, please?
The package you are installing should just be mongodb-org
yum install mongodb-org
If you are wanting a specific release the format is for example:
yum install mongodb-org-4.4.4-1.el7
What does yum search mongodb-org
show now ?
Hey Abelardo! I had a chance to dig into this a bit this morning. The script here is based on the instructions with some modifications mentioned in this thread. This script was tested on a cloud VPS running CentOS 7.4 with cPanel/WHM installed under a trial license. No other modifications were made to the system aside from the activation process for the cPanel/WHM license.
#!/bin/bash
#
# Example MongoDB Install on CentOS 7 / cPanel
#
# This code is for informational purposes and not maintained or warrantied for any specific use
#
# (c) 2021 MongoDB Inc
# author: ryan.quinn@mongodb.com
# Create entry for MongoDB repository
cat > /etc/yum.repos.d/mongodb-org-4.4.repo <<- EOM
[mongodb-org-4.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/7/mongodb-org/4.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.4.asc
EOM
# Install MongoDB packages
sudo yum install -y mongodb-org;
# Configure SELinux (only needed if running SELinux in enforcing mode)
sudo yum install checkpolicy;
cat > mongodb_cgroup_memory.te <<EOF
module mongodb_cgroup_memory 1.0;
require {
type cgroup_t;
type mongod_t;
class dir search;
class file { getattr open read };
}
#============= mongod_t ==============
allow mongod_t cgroup_t:dir search;
allow mongod_t cgroup_t:file { getattr open read };
EOF
checkmodule -M -m -o mongodb_cgroup_memory.mod mongodb_cgroup_memory.te;
semodule_package -o mongodb_cgroup_memory.pp -m
mongodb_cgroup_memory.mod;
sudo semodule -i mongodb_cgroup_memory.pp;
cat > mongodb_proc_net.te <<EOF
module mongodb_proc_net 1.0;
require {
type proc_net_t;
type mongod_t;
class file { open read };
}
#============= mongod_t ==============
allow mongod_t proc_net_t:file { open read };
EOF
checkmodule -M -m -o mongodb_proc_net.mod mongodb_proc_net.te
semodule_package -o mongodb_proc_net.pp -m mongodb_proc_net.mod
sudo semodule -i mongodb_proc_net.pp
# Start the MongoDB Service
sudo systemctl daemon-reload;
sudo systemctl start mongod;
# Check MongoDB status
sudo systemctl status mongod;
# Enable MongoDB to automatically start on boot (optional)
sudo systemctl enable mongod;
cat << EOF
------------------------------------------------------
This script has completed.
Please check the output for any critical
errors and ensure that the MongoDB service is running.
------------------------------------------------------
EOF
Wow, it’s terrible that you’re still having issues after all this time. Do you actually need to run MongoDB on a CentOS7 machine with cPanel?
Personally, I don’t bother with MongoDB on Linux (except for debugging to help others!), I just use Atlas - The free tier is enough for my needs (I have a few databases I regularly use) and you don’t need to provide a credit card for the free tier, just head on over to cloud.mongodb.com - and with a few clicks and waiting about 5-10 minutes for the machines to spin up, you’ll be querying in no time…
Hi there,
Thanks for your piece of advice.
I prefer MongoDB on CentOS 7 since I wouldn’t like to share my personal data in any online platform such as Atlas.
I know I can’t avoid anybody accesses to my data but I prefer not doing it with online platforms.
Best regards.
Loaded plugins: fastestmirror, langpacks, universal-hooks
Loading mirror speeds from cached hostfile
Name and summary matches only, use “search all” for everything.
@ABELARDO_GONZALEZ Absolutely - data privacy is very important! I was very pleased to learn when I joined that, as an employee, I was not allowed to go into any databases without explicit permission - e.g. we have to ask “may I look into your database?” specifically, if it’s needed to debug an issue.
Here’s a link to MongoDB’s privacy policy - this isn’t specifically for you, Abelardo, but just in case other people are worried if MongoDB is using your data…I want to assure them we’re not!
-Sheeri
Hello there!
Thanks for your all time / effort / support.
My issue was successfully solved.
I could install MongoDB on CentOS 7.
The problem was I followed your instructions:
exclude=mongodb-org,mongodb-org-server,mongodb-org-shell,mongodb-org-mongos,mongodb-org-tools
and it avoided any installation.
I removed mongodb from this section and it worked like a charm.
Warmest regards.
That step is executes after a yum install. If your yum install didn’t succeed then adding this would indeed block installing.
You can specify any available version of MongoDB. However
yum
upgrades the packages when a newer version becomes available. To prevent unintended upgrades, pin the package. To pin a package, add the followingexclude
directive to your/etc/yum.conf
file:
exclude=mongodb-org,mongodb-org-server,mongodb-org-shell,mongodb-org-mongos,mongodb-org-tools
Thanks for following up, it was a head scratcher.
Hi there,
I executed a yum install. Since it didn’t work, I included these files under the “excluded” section. Consequently, future invocations to install Mongodb didn’t work.
I think that documentation should warm to future users to avoid writing these names under the excluded section.
Regards.
Great to see you were able to successfully solve your installation issue! Thank you for confirming the problem with the excluded
section - I created a suggestion for our documentation team you can watch, upvote, or comment on with additional information: DOCS-14314.
I know you prefer to manage your own hosting, but for future reference you might be interested to know that cloud security has evolved significantly.
With MongoDB Atlas:
All storage volumes use cloud provider encrypted storage (encryption at rest).
You can further Restrict MongoDB Support Access to Atlas Backend Infrastructure .
You can also Manage Your Own Encryption Keys for a dedicated cluster so the data is completely opaque to Atlas support.
There’s more information on security, compliance, and privacy in the MongoDB Trust Centre.
With MongoDB 4.2+ (self-hosted or Atlas) you can also use Client-Side Field Level Encryption (CSFLE) to encrypt sensitive fields in documents prior to sending to the server. The CSFLE Guide includes some practical examples for using CSFLE and other security measures.
Regards,
Stennie
Topic | Replies | Views | Activity |
---|---|---|---|
Failed to start MongoDB Database Server [CentOS7] | 2 | 895 | May 2024 |
Installation Error while installing on WIndows 10 | 1 | 634 | Aug 2024 |
wiredtiger checkpoint logging | 1 | 492 | Jul 2024 |
Terminal not recognizing brew tap mongodb/brew command when I try to set up MongoDB | 0 | 40 | Jan 9 |
Mongodb compass not displaying | 0 | 35 | Jan 10 |