First, which telnet works? You can telnet from machine 2 to ALL of these IP:port combinations? '10.85.121.212:9300', "10.85.121.212:9301", "10.85.121.212:9302" AND from those to the node on machine 2 (10.85.120.33:9300) ? If that works, then I have no idea, but otherwise:
In Docker, you have to make sure your containers on machine A are accessible from other machines, which is hard by default, depending on your networking.
ES often will not know the IP it can use for other machines to reach it - your 10.85.121.212 - you may need to set that on machine 1 nodes' network.publish_host - else they'll publish their docker IPs which may be something different, like 192.x, etc.
Also, for Machine B, initial master nodes are usually node names, not IPs (though IPs can work), but not matter as you are not forming a new cluster. Suggest removing them as the cluster is formed, and as soon as this 'new' master talks to the current master/slave it'll know the cluster into. Initial master nodes is so a new cluster can setup during bootstrap.
Welcome do Docker - that is a core challenge - you need to setup for an IP/port that BOTH local containers AND remote containers can reach, and tell the nodes what those are.
If you use default Docker settings and basic port forwarding (e.g. -P 9201:9201), you can use the VM's IP and the ports like 9200, 9201, etc. as both local and remote containers should be able to reach that (though been a while since I set it up).
Hmm, as far as I know you can't really change ports, as there is no way to change the published port, just the IP.
So if ES is listening 9200/9300 it has to appear that way on the advertised IP, too as that's how the internal list is managed - you can change IPs but not ports from my reading of it.
So change your ES configured port in the container (via YML or env vars) to 9201/9301 and 9202/9302, and map them 9201:9201, etc., and then the ES knows it's on 9201 and knows the IP .212 and will advertise those.
The it just might work. I'm confused why/how your Machine A works now, though as they will be advertising their 9200/9300 ports in the cluster state, too.
Bottom line, change IPs if you want via publish setting, but don't change ports.
Oh, I was wrong, you can publish the port; set transport.publish_port: 9301, etc. for the ports and then it'll announce correctly, but this might break your local node though not sure as they are using the internal network (see below) though best if you specify IP/port that everyone can reach/see, then it's clear - set both publish IP and port (to 9301, 9302, etc.)
Here are Docker Compose docs, but in this version probably what you are using, the containers are connecting locally on port 9300 inside Docker; if you do this, you'll have the problem you are seeing as the ES servers are not exposed for transport port 9300 outside.
So set ES to listen on 9300, 9301, 9302 and set publish port on each to that, and map 9301:9301, etc. and I bet it'll all work. I hope.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.