Skip to content

Instantly share code, notes, and snippets.

@smijar
Last active September 22, 2020 05:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smijar/c14ca4a0897ec16c3145f12c9a611353 to your computer and use it in GitHub Desktop.
Save smijar/c14ca4a0897ec16c3145f12c9a611353 to your computer and use it in GitHub Desktop.
Installing mongodb on centos 7
# from:https://quicktechnotes.wordpress.com/2017/01/02/how-to-install-mongodb-elasticsearch-and-graylog-on-centos-7/
# Install EPEL
sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum -y install pwgen
sudo yum -y update
# Add mongodb repo.
sudo vi /etc/yum.repos.d/mongodb-org-3.2.repo
# Copy following code block to this file.
[mongodb-org-3.2]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.2/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.2.asc
# install mongodb-org from repo
sudo yum -y install mongodb-org
# To configure MongoDB to start on system’s boot
sudo chkconfig --add mongod
sudo systemctl daemon-reload
sudo systemctl enable mongod.service
sudo systemctl start mongod.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment