3/30/2023 0 Comments Connect mongodb compass to aws![]() Using below command to check service is running or not : sudo systemctl status mongodĮnable MongoDB service at System startup using below command : sudo systemctl enable mongodīy default, MongoDB is listening on 127.0.0.1:27017 only: Reload the system daemon to apply changes : sudo systemctl daemon-reload Start the MongoDB service using below command : sudo systemctl start mongod You can specify any available version of MongoDB add the following exclude directive to your /etc/yum.conf file: exclude=mongodb-org,mongodb-org-database,mongodb-org-server,mongodb-org-shell,mongodb-org-mongos,mongodb-org-tools Install MongoDB using below command : sudo yum install -y mongodb-org Step 2: How to Install MongoDB on Amazon Linux 2 Step 1: Configure the package management system (yum)Ĭreate a /etc//mongodb-org-5.0.repo file so that you can install MongoDB directly : sudo nano /etc//mongodb-org-5.0.repoĪnd add this below lines in this directory To install latest MongoDB and specific MongoDB visit MongoDB official download page connect to terminal How to Install MongoDB on Amazon Linux 2 ![]() Then in Use private key you need to give the path of your key pair that we have created. So you can see in this image firstly click on session then SSH then in Remote host paste the ip_address then in username you can specify only ec2-user for Amazon Linux 2. So now here im using MobaXterm to connect terminal so copy the ip_address of your instance connect to your terminal Then after click on launch there is pop up select an existing key pair or create a key pair so if have already a key pair then select a key pair otherwise create a key pair launch instance Step 7 : Here review once its correct or not then click on launch. Step 6 : So here select “ Select an existing security group” then select “ default” conf security grp Step 5: Here you can give any meaning full name to your instance. Step 4: Here they give us 8 GiB free space. ![]() Here you can specify the number of instances you want. Step 2: Choose an Instance type so if you want another instance you can select as per your choice. ![]() Step 1: Go to Ec2 instance then click on launch instance then select Amazon Linux 2 launch instance AMI How to create Amazon Linux 2 EC2 Instance in AWS You should be connected.In this article we are going to cover How to Install MongoDB on Amazon Linux 2 and Connect MongoDB using compass. Therefore it is recommended to close this port when shipping to production)Ĭhoose "fill in connection fields individually"įill in the hostname with the IP address of your vps, port is the port which you opened previously 27017 in this case and select authentication by username and password.Įnter the username and password of the mongodb admin which you should have created already.Ĭhoose the authentication database (usually admin) (Please note that will expose your mongo database to the internet. Setup the firewall to allow connections to port 27017 (the default mongodb port) from anywhere. Save the file and restart the mongodb connection This will allow remote connections to the mongodb instance It is recommended to secure your mongodb connection with a username and passwordĮnter a comma and append the IP address of the vps to the end of the bindIp field.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |