I'm working on a PySpark project that requires a config.json file to store information about telecom operators and database connections. Here’s a simplified version of my configuration file:
{
"operator_patterns": {
"Operator A": "^123(45[0-9]{7}|67[0-9]{7})$",
"Operator B": "^456(78[0-9]{7}|90[0-9]{7})$"
},
"server_ips": {
"Operator A": "192.168.1.1",
"Operator B": "192.168.1.2"
},
"spark": {
"mongodb_uri": "mongodb://user:[email protected]:27017"
}
}
The issue is that I’m not sure if these IP addresses are correct. I need a reliable way to obtain:
The real IP addresses of telecom operator servers.
The correct IP address of my MongoDB database, hosted on a remote server.
What I’ve Tried: For MongoDB: I checked my config using cat /etc/mongod.conf | grep bindIp, but I’m unsure how to find the public IP if it’s hosted remotely.
For telecom operators: I tried nslookup and dig +short on their domain names (e.g., operatorA), but this doesn’t necessarily return their telecom server IPs.
How can I retrieve the public IP address of my remote MongoDB server (accessible via SSH)?
Is there a way to find the IP addresses of telecom operator servers?
Are there APIs or databases that centralize this kind of information?
Any help or suggestions to correctly update my config.json with reliable IP addresses would be greatly appreciated. Thanks in advance!