Client has 2 ips/interfaces, how do I tell dispy which to use?

Questions, issues regarding dispy / pycos

Moderator: admin

Post Reply
ScriptedAnarchy
Posts: 2
Joined: Sat Mar 05, 2022 11:58 am

Client has 2 ips/interfaces, how do I tell dispy which to use?

Post 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?
Giri
Site Admin
Posts: 58
Joined: Sun Dec 27, 2020 5:35 pm

Re: Client has 2 ips/interfaces, how do I tell dispy which to use?

Post 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).
ScriptedAnarchy
Posts: 2
Joined: Sat Mar 05, 2022 11:58 am

Re: Client has 2 ips/interfaces, how do I tell dispy which to use?

Post 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.
Giri
Site Admin
Posts: 58
Joined: Sun Dec 27, 2020 5:35 pm

Re: Client has 2 ips/interfaces, how do I tell dispy which to use?

Post 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.
Post Reply