(This message has been automatically imported from the retired mailing list)
Hello,
I’d like to ask you for feedback regarding a certain feature.
Background
We use Redis right now for server-server communication. For instance,
when you upload a service it is eventually routed through Redis to other
servers using Redis publish/subscribe.
But now that Redis will not be a core dependency a mechanism is needed
to deliver such information between servers directly, i.e. through
synchronous TCP calls (REST).
I prefer it over things like Zyre [1] (which is fine in itself) because
this will allow us to achieve two additional desirable goals:
-
When a service is hot-deployed there will be immediate feedback in
web-admin if it succeeded or not so things like syntax errors will be
caught immediately -
We need to have something like below anyway:
response = self.servers[‘ServerName’].invoke(‘service’, request)
This is needed because in some scenarios it is important to invoke a
service on a selected server and none other - for instance, network
segmentation may dictate that only one server belongs to a VPN with an
external system Zato integrates with.
At the same time it is convenient to be able to simply specify in
server.conf …
[main]
gunicorn_bind=0.0.0.0:17010
… and be done with it.
Question
This however means that other servers, possibly in different operating
systems, do not know what a given server bound to, what its addresses are.
Hence there will be an idea of a preferred IP introduced for other
servers to call each other over.
(This is its default form in server.conf)
[bind_options]
preferred_server_to_server_ip=10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16,
eth0
bind_if_preferred_not_found=True
preferred_protocol=ipv4
allow_localhost_only=False
Now each server when it’s booting will store in ODB information what its
preferred IP address is so that other servers can always find it.
Thus everything should stay as convenient as today - one will be able to
use 0.0.0.0 and at the same time servers will find a way to announce
what their preferred IP is.
I just want to confirm if you think there are some use-cases not covered
by the logic below. The ones listed here will be supported just fine:
-
Run Zato in internal networks with fixed private IPs only
-
Run Zato in networks with unknown private IPs yet within a well-known
known network range -
Run Zato in networks with unknown IPs, private or public, but using
well known network interfaces -
Run Zato with public IPs only
-
If enabled, run Zato on localhost only
Implementation
The logic will be as follows:
-
Get all interfaces in the OS
-
If any is listed in preferred_server_to_server_ip, read its first IP
address and use as the preferred one -
If no network interface is explicitly listed in [bind_options] but
network ranges or concrete addresses are, get IPs that 0.0.0.0 resolved
to and use the first that matches what is in preferred_server_to_server_ip -
If 0.0.0.0 does not resolve to anything in
preferred_server_to_server_ip, arbitrarily pick first non-loopback
interface and its first IP -
If 0.0.0.0 turns out to point to localhost only then do not proceed
unless allow_localhost_only is True because it may be the case that
several servers in several systems all bind to their respective loopback
interfaces so there is really no communication here possible
Conclusion
Do you think this will cover your environments? I realize that there are
many ways to configure networking so it is important that everything
available today can continue to work in 3.0.
[1] https://github.com/zeromq/zyre
regards,