最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to Retrieve the Correct Server IP Addresses for a Configuration File? - Stack Overflow

programmeradmin2浏览0评论

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!

发布评论

评论列表(0)

  1. 暂无评论