Page 1 of 1
Client has 2 ips/interfaces, how do I tell dispy which to use?
Posted: Sat Mar 05, 2022 12:01 pm
by ScriptedAnarchy
Hi there!
I’m using a clusterhat with nat build (neat little device) to build a cluster. Problem is dispy wants to use the wifi connection by default. Can I tell it to start listening on another interface/ip address?
Re: Client has 2 ips/interfaces, how do I tell dispy which to use?
Posted: Sat Mar 05, 2022 2:40 pm
by Giri
Yes, you can use 'host' parameter to the hostname or IP you want to use. All dispy tools also have an option to specify one or more IP addresses to use in case of multi-homed network (or for masquerading even).
Re: Client has 2 ips/interfaces, how do I tell dispy which to use?
Posted: Sun Mar 06, 2022 2:29 am
by ScriptedAnarchy
That’s excellent to hear! Glad I’m not barking up the wrong tree.
Where would one set this parameter? I have not set any custom options in here like that before.
Re: Client has 2 ips/interfaces, how do I tell dispy which to use?
Posted: Wed Mar 09, 2022 7:08 pm
by Giri
As mentioned, pass 'host' parameter when creating cluster, e.g., 'dispy.JobCluster(compute, host="a.b.c.d")'.
dispy by default uses host name configured for the system so likely you may want to set 'hostname' and its DNS appropriately so 'socket.gethostbyname(socket.gethostname())' resolves to the desired address.