Troubleshooting
Problems with availability and connecting
Section titled “Problems with availability and connecting”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.
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
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
bash ping 8.8.8.8 The answer should look similiar to this: Ping wird ausgeführt für 8.8.8.8 mit 32 Bytes Daten: Antwort von 8.8.8.8: Bytes=32 Zeit=25ms TTL=117
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:
nslookup portal.stackit.cloudThe answer should look similiar to this:
Server: 2003:e5:3f0f:5200:ea9f:80ff:fe78:8a93Address: 2003:e5:3f0f:5200:ea9f:80ff:fe78:8a93#53
Non-authoritative answer:Name: portal.stackit.cloudAddress: 185.86.188.7If 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.
nslookup portal.stackit.cloudThe answer should look similiar to this:
Server: 2003:e5:3f0f:5200:ea9f:80ff:fe78:8a93Address: 2003:e5:3f0f:5200:ea9f:80ff:fe78:8a93#53
Non-authoritative answer:Name: portal.stackit.cloudAddress: 185.86.188.7If 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.
nslookup portal.stackit.cloudThe answer should look similiar to this:
Server: 2003:e5:3f0f:5200:ea9f:80ff:fe78:8a93Address: 2003:e5:3f0f:5200:ea9f:80ff:fe78:8a93#53
Non-authoritative answer:Name: portal.stackit.cloudAddress: 185.86.188.7Troubleshoot 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-256then the hostname of your instance is:
s-917c9836-af2f-4a50-9786-a2db22069e7f-0.mongodb.eu01.onstackit.cloudOpen a shell:
nc -z <INSTANCE HOSTNAME> 27017The 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.
Open a shell:
nc -z <INSTANCE HOSTNAME> 27017The 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 errormessage or a timeout, continue in the diagram.
Open a PowerShell-Window:
Test-NetConnection -ComputerName <INSTANCE HOSTNAME> 27017The answer should look similiar to this:
ComputerName : s-917c9836-af2f-4a50-9786-a2db22069e7f-0.mongodb.eu01.onstackit.cloudRemoteAddress : 45.129.43.38RemotePort : 27017InterfaceAlias : Ethernet 1SourceAddress : 192.168.10.210TcpTestSucceeded : TrueTroubleshoot your ACL settings
Section titled “Troubleshoot your ACL settings”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:
curl https://1.1.1.1/cdn-cgi/traceYou get something like this:
fl=472f87h=1.1.1.1ip=84.136.82.147ts=1755607546.598visit_scheme=httpsuag=curl/8.7.1colo=FRAsliver=005-tier1http=http/2loc=DEtls=TLSv1.3sni=offwarp=offgateway=offrbi=offkex=X25519In 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.
Troubleshoot your firewall settings
Section titled “Troubleshoot your firewall settings”Add an entry in your firewall to allow your client to reach the STACKIT servers on 27017/TCP.
Troubleshoot your credentials
Section titled “Troubleshoot your credentials”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.
Contact STACKIT support to get help
Section titled “Contact STACKIT support to get help”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:
-
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.
-
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.