Discussion about M103: Basic Cluster Administration
Hi everybody , welcome to M103! I am @Kushagra_Kesav, your Curriculum Services Engineer for this course. As a CSE, I help in developing MongoDB University courses, support learners, and incorporate feedback into future curriculum development.
We really hope that you will enjoy learning about MongoDB. If you have any questions or feedback regarding the content of this course, please start a new discussion topic and we will be more than happy to help you.
If you are new to our discussion forums, some suggested starting points are:
- University Forum quick start - a short introduction.
- Getting Started with the MongoDB Community - FAQs, feature guides, and best practices.
- Welcome category - introduce yourself and meet other community members.
Good luck and happy learning!
Thanks & Regards.
Curriculum Services Engineer
Basically, code 48 indicates that newly started MongoDB could not listen to incoming connections, due to an error.
STEP 1: Try to cross verify the configuration parameters in the MongoDB configuration file.
STEP 2: Check the
port values in the IDE environment, which should be:
net: bindIp: localhost port: 27000
“errmsg” : “Either all hostnames in a replica set configuration must be localhost references, or none must be; found 1 out of 2”
This error raises due to the replica set configuration.
STEP 1: Run the
rs.initiate() and check
port in the output of the following command.
STEP 2: Check the syntax of
STEP 3: In this lab
localhost is considered to be the hostname in the IDE environment. The port number for the second member of the replica set is
This error states that newly started
mongoscould not start listening for incoming connections due to an error.
ERROR: child process failed, exited with error number 48
STEP 1: Check for an existing running
mongod instance on the same port. If there is an existing instance of
mongod, please stop the instance first by using
db.adminCommand('shutdown') and re-start the process.
STEP 2: If the first approach did not resolve your issue, click on the Reset Workspace button and then refresh the page. After relaunching the IDE, try to execute the command again.
Try refreshing the page or click on Reset Workspace and try to re-run the command again. Also, make sure the IDE is not active in some other tab at the same time.
“Error: couldn’t connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Connection refused”
A connection attempt will fail or be refused if a MongoDB server is not actively listening on the specified IP address and port.
Example error using the `mongo` shell
user@M103# mongo --username m103-admin --password m103-pass MongoDB shell version v4.0.5 connecting to: mongodb://127.0.0.1:27017/?gssapiServiceName=mongodb 2022-04-13T09:23:26.924+0000 E QUERY [js] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Connection refused : connect@src/mongo/shell/mongo.js:328:13 @(connect):1:6 exception: connect failed
Try to specify the port
27000 in the command line. For example:
mongosh --port 27000 -u "m103-admin" -p "m103-pass" --authenticationDatabase "admin"
“Facing issue in launching IDE/ There was an unexpected error.(error code: 1200) / Unable to hit Run Test Button”
Please try the given troubleshooting steps:
- Logging out and logging in again in MongoDB University.
- Clearing your browser cache and cookies.
- Opening the link in Incognito mode.
- Switching to a different browser.