2

I am trying to install MongoDB 3.0.0 on one of the sandbox which has RHEL Linux 5.11 64bit

I was able to download all the packages using yum command mentioned in the official document here MongoDB Installation.

I am trying to run following command as per the documentation

semanage port -a -t mongod_port_t -p tcp 27017

and it is giving me below error.

/usr/sbin/semanage port -a -t mongod_port_t -p tcp 27017
libsepol.context_from_record: type mongod_port_t is not defined
libsepol.context_from_record: could not create context structure
libsepol.port_from_record: could not create port structure for range 27017:27017 (tcp)
libsepol.sepol_port_modify: could not load port range 27017 - 27017 (tcp)
libsemanage.dbase_policydb_modify: could not modify record value
libsemanage.semanage_base_merge_components: could not merge local modifications into policy
/usr/sbin/semanage: Could not add port tcp/27017

I have root access on this sandbox but I am really clueless what this means. How can I install MongoDB successfully?

halfer
  • 19,824
  • 17
  • 99
  • 186
Shantanoo K
  • 765
  • 5
  • 15
  • 43

2 Answers2

0

Step 1: Configure the package management system(yum)

Sudo vi /etc/yum.repos.d/mongodb-org-3.4.

so that you can install MongoDB directly, using yum.

Use the following repository file:

[mongodb-org-3.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-
org/3.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc

Step 2: Use the below command to install MongoDB

Sudo yum install -y mongodb-org

Step 3:Start Mongod Service

Sudo service mongod start

Step 4: Then start Mongo with the command below

Mongo

Now Create your database as use

And then start building collections and insert documents into in the collection

For More detail vist https://docs.mongodb.com/master/tutorial/install-mongodb-on-red-hat/

Nanda Kumar
  • 2,016
  • 1
  • 9
  • 12
-1

By default this port is already authorized:

#### # semanage port -l | grep mongod_port_t
mongod_port_t  tcp      **27017**-27019, 28017-28019
Smajl
  • 7,555
  • 29
  • 108
  • 179