{"id":16160,"date":"2022-03-22T16:58:46","date_gmt":"2022-03-22T16:58:46","guid":{"rendered":"https:\/\/linuxways.net\/?p=16160"},"modified":"2022-03-22T16:58:46","modified_gmt":"2022-03-22T16:58:46","slug":"how-to-install-mongodb-on-opensuse","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/opensuse\/how-to-install-mongodb-on-opensuse\/","title":{"rendered":"How to Install MongoDB on openSUSE"},"content":{"rendered":"<p>MongoDB is one of the widely popular document-oriented <a href=\"https:\/\/linuxways.net\/de\/ubuntu\/how-to-install-nosql-on-linux\/\">NoSQL<\/a> databases. It is designed to store a massive amount of data while also allowing you to work with that data in a very efficient manner. It is used in the development of many modern web applications. It is open-source and written in C++. MongoDB supports a variety of Linux platforms including <a href=\"https:\/\/linuxways.net\/de\/ubuntu\/how-to-install-mongodb-on-ubuntu-20-04-lts\/\">Ubuntu<\/a>, <a href=\"https:\/\/linuxways.net\/de\/debian\/how-to-install-mongodb-on-debian-10\/\">Debian<\/a>, <a href=\"https:\/\/linuxways.net\/de\/centos\/how-to-install-mongodb-on-centos-8\/\">CentOS<\/a>, RedHat, and openSUSE. It also supports Windows and MacOS.<\/p>\n<p>In this post, we will install MongoDB on <strong>openSUSE Leap 15.3<\/strong> OS.<\/p>\n<h2>Installing MongoDB on openSUSE<\/h2>\n<p>In the following method, we will install MongoDB on the openSUSE machine by first adding the MongoDB repository. Then we will install MongoDB using the Zypper package manager. Let\u2019s get started.<\/p>\n<p>1. First, you will need to add the GPG key for the MongoDB repository. Execute the command below to add the MongoDB repository\u2019s GPG key to your system:<\/p>\n<pre>$ sudo rpm --import <a href=\"https:\/\/www.mongodb.org\/static\/pgp\/server-5.0.asc\">https:\/\/www.mongodb.org\/static\/pgp\/server-5.0.asc<\/a><\/pre>\n<p>Enter the sudo password.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"896\" height=\"69\" class=\"wp-image-16161\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/03\/word-image-158.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/03\/word-image-158.png 896w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/03\/word-image-158-300x23.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/03\/word-image-158-768x59.png 768w\" sizes=\"auto, (max-width: 896px) 100vw, 896px\" \/><\/p>\n<p>2. Add MongoDB repository through the command below:<\/p>\n<pre>$ sudo zypper addrepo --gpgcheck \"https:\/\/repo.mongodb.org\/zypper\/suse\/15\/mongodb-org\/5.0\/x86_64\/\" mongodb<\/pre>\n<p>If the repository is successfully added, you will see output as shown below:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1035\" height=\"349\" class=\"wp-image-16162\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/03\/word-image-159.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/03\/word-image-159.png 1035w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/03\/word-image-159-300x101.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/03\/word-image-159-1024x345.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/03\/word-image-159-768x259.png 768w\" sizes=\"auto, (max-width: 1035px) 100vw, 1035px\" \/><\/p>\n<p>3. Now in order to install MongoDB on your openSUSE system, execute the command below:<\/p>\n<pre>$ sudo zypper install mongodb-org<\/pre>\n<p>It will list the MongoDB package and all the dependencies that will be installed alongside it. To continue the operation, hit <strong>y<\/strong> and then <strong>Enter<\/strong> key. <img loading=\"lazy\" decoding=\"async\" width=\"1033\" height=\"528\" class=\"wp-image-16163\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/03\/word-image-160.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/03\/word-image-160.png 1033w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/03\/word-image-160-300x153.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/03\/word-image-160-1024x523.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/03\/word-image-160-768x393.png 768w\" sizes=\"auto, (max-width: 1033px) 100vw, 1033px\" \/><\/p>\n<p>After MongoDB is installed, you can initiate its service through the command below:<\/p>\n<pre>$ sudo systemctl start mongod<\/pre>\n<p>To verify if the service has been initiated, execute the command below:<\/p>\n<pre>$ sudo systemctl status mongod<\/pre>\n<p>If MongoDB service is started, you will see the output as shown below:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"956\" height=\"165\" class=\"wp-image-16164\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/03\/word-image-161.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/03\/word-image-161.png 956w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/03\/word-image-161-300x52.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/03\/word-image-161-768x133.png 768w\" sizes=\"auto, (max-width: 956px) 100vw, 956px\" \/><\/p>\n<p>After the MongoDB service has been initiated, you can start using it. To start the MongoDB session, execute the command below:<\/p>\n<pre>$ mongosh<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1032\" height=\"529\" class=\"wp-image-16165\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/03\/word-image-162.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/03\/word-image-162.png 1032w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/03\/word-image-162-300x154.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/03\/word-image-162-1024x525.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/03\/word-image-162-768x394.png 768w\" sizes=\"auto, (max-width: 1032px) 100vw, 1032px\" \/><\/p>\n<h2>Manage MongoDB services<\/h2>\n<p>If you want to stop the MongoDB service, execute the command below:<\/p>\n<pre>$ sudo service mongod stop<\/pre>\n<p>To restart the MongoDB service, execute the command below:<\/p>\n<pre>$ sudo service mongod restart<\/pre>\n<p>If you want to start the MongoDB service automatically at boot, execute the command below:<\/p>\n<pre>$ sudo service mongod enable<\/pre>\n<h2>Uninstall MongoDB<\/h2>\n<p>If you no longer need MongoDB installed on your system, you can uninstall it as follows:<\/p>\n<p>1. First, you will need to stop the MongoDB service by executing the command below:<\/p>\n<pre>$ sudo service mongod stop<\/pre>\n<p>2. To find the list of MongoDB packages that are installed on your openSUSE system, execute the command below:<\/p>\n<pre>$ rpm -qa | grep mongodb-org<\/pre>\n<p>It will list all the MongoDB packages installed on your system.<\/p>\n<p>3. To remove all the MongoDB packages, execute the command below:<\/p>\n<pre>sudo zypper remove mongodb-org-*<\/pre>\n<p>4. If you also want to remove MongoDB log files and databases, execute the command below:<\/p>\n<pre>$ sudo rm -r \/var\/lib\/mongo<\/pre>\n<pre>$ sudo rm -r \/var\/log\/mongodb<\/pre>\n<p>That is all there is to it! In this post, we covered how to install MongoDB on openSUSE OS through the MongoDB repository. Then we covered how to manage MongoDB services. In the end, we covered how to uninstall MongoDB in case you want to do so.<\/p>","protected":false},"excerpt":{"rendered":"<p>MongoDB is one of the widely popular document-oriented NoSQL databases. It is designed to store a massive amount of data while also allowing you to work with that&hellip;<\/p>","protected":false},"author":1,"featured_media":16204,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[83],"tags":[121,858],"class_list":["post-16160","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-opensuse","tag-mongodb-2","tag-opensuse"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/16160","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=16160"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/16160\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/16204"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=16160"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=16160"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=16160"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}