some questions about yami4

59 views
Skip to first unread message

carl.wei...@googlemail.com

unread,
May 13, 2013, 2:18:31 PM5/13/13
to ya...@googlegroups.com
Hi,

some days ago I started to play with yami4 and I like it very much.

I have two questions concerning failover:

As I understand, the implemented failover is a mixture of load balancing and failover.
The messages are randomly sent to one of the servers of the "failover-cluster", if one or more of them fail,
the messages are sent to one of the remaining servers of the cluster.

Is there a way to do a pure failover? That means: all messages are sent to server1, only if
it fails, then the messages are sent to server2 and so on.


How can a single nameserver support a failover-cluster of "application"-servers?
When I do the following sequence
1.) start nameserver
2.) start first "application"-server
3.) start second "application"-server

then the nameserver seems to forget the first "application"-server and all messages are
sent to the second "application"-server.


Last but not least the following question:

Why are all libraries built as static libraries? I created additional shared libraries
for core and ada and with these shared libraries all demo programs that I tested
worked without any problem.

----
Carl

Maciej Sobczak

unread,
May 13, 2013, 4:42:30 PM5/13/13
to ya...@googlegroups.com
Hi Carl,

 
I have two questions concerning failover:

As I understand, the implemented failover is a mixture of load balancing and failover.

It would be more correct to say that the implemented mechanism can be used for both load balancing and failover.
 
The messages are randomly sent to one of the servers of the "failover-cluster", if one or more of them fail,
the messages are sent to one of the remaining servers of the cluster.

Yes. This process is repeated until success or until the list of servers is exhausted. 
 
Is there a way to do a pure failover? That means: all messages are sent to server1, only if
it fails, then the messages are sent to server2 and so on.

This functionality can be implemented at the application level. A very minor modification of the library would be needed to change the existing implementation to do what you have described. I think that it makes sense to introduce this distinction in future versions of the library.
 
How can a single nameserver support a failover-cluster of "application"-servers?
When I do the following sequence
1.) start nameserver
2.) start first "application"-server
3.) start second "application"-server

then the nameserver seems to forget the first "application"-server and all messages are
sent to the second "application"-server.

This is because single servers do not know about each other and the name server cannot decide that they actually form a cluster.
You can solve this problem by registering the servers by hand (or by an additional program) under a single name and with a "failover:..." target. In other words, do not allow individual servers to overwrite each other's bindings, but create a single binding for all servers. This way, when the client asks the name server for the location of the given service, the name server will reply with the single "failover:..." entry that lists all servers, which will then be used by the client. 
 
Why are all libraries built as static libraries?

Because they are easier to use. That is, after the programs are linked, there is no need to worry about the libraries any longer.
It is still possible to compile the libraries as shared (there are separate Makefiles for this for Visual Studio users).

Note that the Python library is always based on the shared loadable module.

Regards,

--
Maciej Sobczak * http://www.inspirel.com

carl.wei...@googlemail.com

unread,
May 17, 2013, 12:29:42 PM5/17/13
to ya...@googlegroups.com


Am Montag, 13. Mai 2013 22:42:30 UTC+2 schrieb Maciej Sobczak:
Hi Carl,
 
.......... lines deleted ......

How can a single nameserver support a failover-cluster of "application"-servers?
When I do the following sequence
1.) start nameserver
2.) start first "application"-server
3.) start second "application"-server

then the nameserver seems to forget the first "application"-server and all messages are
sent to the second "application"-server.

This is because single servers do not know about each other and the name server cannot decide that they actually form a cluster.
You can solve this problem by registering the servers by hand (or by an additional program) under a single name and with a "failover:..." target. In other words, do not allow individual servers to overwrite each other's bindings, but create a single binding for all servers. This way, when the client asks the name server for the location of the given service, the name server will reply with the single "failover:..." entry that lists all servers, which will then be used by the client. 
 

 
Hi Maciej,

thank you for the fast answer to my questions.

What would you think about an optional third parameter for the nameservers bind method of type boolean/boolean array called replace (or append)
If replace = true (append = false) then the old entry is replaced (current behavior, should be the default for compatibility),
if replace = false (append = true) then the new entry is appended (to failover group or failover created if this is the second entry).

Regards,

Carl


Maciej Sobczak

unread,
May 17, 2013, 3:24:18 PM5/17/13
to ya...@googlegroups.com

It is not that simple. The reason why entries are replaced is that servers can be started with system-assigned port numbers. Each time the server starts the port number can be different and the whole server endpoint will be different as well. Replacing the whole entry is the easiest way to deal with this.
Now, if you would like the endpoint to be appended to some sequence, what would be the result if one of the servers is repeatedly restarted and binds with different endpoint every time? The resulting sequence of endpoints would contain mostly garbage.

I see what you are trying to achieve, but this requires some higher-level handling. For example, individual servers would need to know their logical place in the cluster and the name server would need to replace their individual entries in the endpoint sequence. Another solution would be to define clusters in the nameserver config file. In any case, something more elaborate is needed.
Reply all
Reply to author
Forward
0 new messages