Zum Inhalt springen

Troubleshooting

Diese Seite ist noch nicht in deiner Sprache verfügbar. Englische Seite aufrufen

When you can’t connect to your instance, there could be several reasons. Use the diagram’s flow to troubleshoot your connection problems. Each square box references a subchapter in this article which further instructions.

Diagram

Troubleshoot the settings of your instance

Section titled “Troubleshoot the settings of your instance”

When you made changes to your instance recently, try to do a roll-back. If you recently created an instance or the roll-back does not solve the issue, check the most common reasons for an instance to become unavailable:

  • Your instance is not in the Active state. If this is the case, wait till the instance is in the Active state again and retry.
  • Your ACL settings are wrong. Ensure that the correct external IPv4 address of your client is added to the ACL. Read Create and manage instances for MongoDB Flex on how to edit the ACL.

Check the connection of your client to the internet

Section titled “Check the connection of your client to the internet”

First, check, if your client has a connection to the internet and if DNS lookup works as well. To check the internet connection in general, open a command shell on the affected client and ping the Google DNS server:

bash ping 8.8.8.8 The answer should look similiar to this: PING 8.8.8.8 (8.8.8.8): 56 data bytes 64 bytes from 8.8.8.8: icmp_seq=0 ttl=118 time=16.012 ms

To check DNS lookup and especially lookup of the STACKIT environment, try to lookup the hostname of your instance. Open a shell on the affected client and lookup the STACKIT Portal hostname:

Terminal window
nslookup portal.stackit.cloud

The answer should look similiar to this:

Server: 2003:e5:3f0f:5200:ea9f:80ff:fe78:8a93
Address: 2003:e5:3f0f:5200:ea9f:80ff:fe78:8a93#53
Non-authoritative answer:
Name: portal.stackit.cloud
Address: 185.86.188.7

If your answer includes an error message or Address: 185.86.188.7 is missing, then there is a problem with the DNS resolution of your client.

Troubleshoot the connection of your client to the internet

Section titled “Troubleshoot the connection of your client to the internet”

Due to the fact that internet connection problems and their elimination are highly individual, STACKIT cannot give a structured guide on solving those issues. Please contact the ISP that’s responsible for your affected client to get help.

Check the connection from your client to the MongoDB instance

Section titled “Check the connection from your client to the MongoDB instance”

To check the connection to your instance, use nc. First, you need to extract the hostname of your instance from your connection URI. Copy everything after the @ sign and before the : which declares the port. If your connection URI is for example:

mongodb://example:yKXA2YRrBpbna5Ni@s-917c9836-af2f-4a50-9786-a2db22069e7f-0.mongodb.eu01.onstackit.cloud:27017/books?authSource=books&tls=true&authMechanism=SCRAM-SHA-256

then the hostname of your instance is:

s-917c9836-af2f-4a50-9786-a2db22069e7f-0.mongodb.eu01.onstackit.cloud

Open a shell:

Terminal window
nc -z <INSTANCE HOSTNAME> 27017

The answer should look similiar to this:

Connection to s-917c9836-af2f-4a50-9786-a2db22069e7f-0.mongodb.eu01.onstackit.cloud port 27017 [tcp/*] succeeded!

If your answer includes an error message or a timeout, continue in the diagram.

Check if your client’s IP address is added to the ACL. If you haven’t entered the correct IP address yet, the STACKIT firewall will block your request. Read Create and manage instances for MongoDB Flex on how to edit the ACL. To get the public IP address of your client, visit https://1.1.1.1/cdn-cgi/trace with your clients browser. You can also visit the page with the console, for example when your client is not the computer you are working on at the moment:

Terminal window
curl https://1.1.1.1/cdn-cgi/trace

You get something like this:

fl=472f87
h=1.1.1.1
ip=84.136.82.147
ts=1755607546.598
visit_scheme=https
uag=curl/8.7.1
colo=FRA
sliver=005-tier1
http=http/2
loc=DE
tls=TLSv1.3
sni=off
warp=off
gateway=off
rbi=off
kex=X25519

In this case 84.136.82.147 is the IP address. You need to add /32 to this single address to the ACL: 84.136.82.147/32.

Add an entry in your firewall to allow your client to reach the STACKIT servers on 27017/TCP.

Check if your credentials are correct and there is no typo in it. If in doubt, consult Create and manage users for MongoDB Flex to create a new user and thus get new credentials.

If you followed all steps and still can’t connect to your database, reach out via the Help Center.

Problems with the performance of the instance

Section titled “Problems with the performance of the instance”

If you encounter performance problems, it is best practice to quantify them. Only with quantification can you ensure that they have their cause in the database. Read Monitor MongoDB Flex on how to identify bottlenecks.

After confirming that your performance problems derive from the database, you have two options. Please check your options in the order which is presented here:

  1. Improve the layout of your database and optimize your queries.

    Before assigning more CPUs, memory, IOPS and bandwith, try to optimize the layout of your database and/or optimize your queries. Read MongoDB query optimization to learn about it.

  2. Increase your instance’s resources.

    After identifying the bottlenecks, analyze, if your bottleneck can be mitigated with more CPU/memory or with more storage IOPS/storage bandwith. Consult Plan your MongoDB Flex instance to determine which parameters can be changed with or without downtime and Create and manage instances for MongoDB Flex how to actually make the changes.