基于AWS Marketplace的Corda镜像VM运行节点失败问题咨询
UnknownHostException on AWS VM This error pops up because your system can’t resolve the hostname ip-20-0-0-41 that Corda is trying to use. AWS assigns private DNS hostnames to EC2 instances, but these aren’t always automatically added to the local hosts file—something Java relies on for hostname resolution. Here’s how to fix it step by step:
Update your system's hosts file
On Linux-based VMs, edit the/etc/hostsfile with root privileges:sudo nano /etc/hostsAdd a line mapping your instance's private IP address to its hostname. For your case, it should look like:
20.0.0.41 ip-20-0-0-41Save the file (Ctrl+O, then Enter) and exit (Ctrl+X).
Verify hostname resolution
Run this command to confirm the hostname now resolves correctly:ping ip-20-0-0-41You should see responses from
20.0.0.41instead of an error message.Check Corda node configuration files
Navigate to your nodes directory (./kotlin-source/build/nodes/) and open each node'snode.conffile. Look for entries likep2pAddressorrpcAddressthat useip-20-0-0-41. You can either:- Keep the hostname (now that resolution works), or
- Replace it with
localhostor your instance's private IP for simplicity, e.g.:p2pAddress="20.0.0.41:10002"
Restart the nodes
Run therunnodescommand again:./kotlin-source/build/nodes/runnodes
If the issue lingers, double-check that your AWS VM’s security groups allow inbound/outbound traffic on the ports Corda uses (default P2P ports start at 10002, RPC at 10006). But the UnknownHostException is almost always a hostname resolution issue, so the steps above should get your nodes up and running.
内容的提问来源于stack exchange,提问作者Kalyan Konda

