-
Notifications
You must be signed in to change notification settings - Fork 538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Client Node-Discovery and Auto-configuration (aka "autoconfig") #356
Comments
Thinking of @Vagabond's recent RFC & work, would this be information that would be exposed before or after authentication? |
@slfritchie I think at least it should be filterable by what hosts patterns the user can connect from. This needs more thought! |
I think having something akin to what couchbase has with moxi would be helpful. A lightweight "proxy" that understands the autoconfig -- and possibly authentication, as well. Could be used in place of haproxy in most of my use cases and I can continue to use "dumb" clients. |
@bakins What client(s) are you currently using? |
@seancribbs ruby, go, and Lua |
@bakins Not sure we can manage writing our own proxy, but with the way this is designed, it should be very straightforward to write a daemon that reconfigures existing proxy software. Alternatively, a Chef/Puppet/etc run could be used to rewrite the configuration, which is what most people do nowadays. It is my intention that admins will be able to turn off the feature, and client participation is totally optional, even if the feature is enabled. |
A small nitpick: message RpbClientInterface {
enum RpbProtocol {
PB = 1;
HTTP = 2;
HTTPS = 3;
}
required RpbProtocol protocol = 1;
// This can be a FQDN or a text representation of an IP address.
required bytes host = 2;
required uint32 port = 3;
} To prevent from wrong value, isn't it good to set the type of port as After all I totally like this idea because several users are suffering network bottleneck at the load balancer or automatic client-side failover of connection. |
I'd love to, but there's no uint16 type in protobuff. On Tue, Aug 27, 2013 at 3:26 AM, UENISHI Kota notifications@github.comwrote:
Sean Cribbs sean@basho.com |
A short Google search made me misunderstand that it has uint16. I should have refered here: https://developers.google.com/protocol-buffers/docs/proto#scalar |
+1 I haven't dug into the technical detail above, but this part resonates with my infrastructure needs:
|
Unfortunately due to time constraints and other big features, this will not be in 2.0. |
Bumped milestone to 2.1 |
Moved reference to riak_ql to reltool instead of riak_kv
We've talked about this at 365. Definitely need this. |
Several other clustered datastores (including Couchbase/Membase,
Amazon DynamoDB, MongoDB with the "config server") have ways of
discovering new nodes in the cluster. Since any Riak node can handle
any request, we should be able to advertise the existence of other
nodes to clients so that they can reconfigure automatically, spreading
load more evenly among the Riak nodes. This can reduce operational
burden, because applications will not need to be restarted to take
advantage of a grown cluster. This will also pave the way for the
future work of preflist-hinting or client-side routing.
Client-Server Interaction
The goal of this proposal is to provide as much backward- and forward-
compatibility as possible. As such, existing request/response cycles
are overloaded with new information; the "/" URL on HTTP and the
RpbGetServerInfoResp
will be modified for this purpose.In addition to the one-roundtrip cycle, clients should be able to
stream updates by providing an additional request parameter or
limiting the acceptable media-types. This allows them to receive
cluster changes as they occur and update accordingly, perhaps using a
background thread or reactor loop. It also removes the need to send
reconfiguration messages in-band with other requests.
Implementation Details
PB
The
RpbGetServerInfoResp
would be modified to add information aboutother nodes in the cluster, and
RpbGetServerInfoReq
would be made afull message:
HTTP
The "root" resource
riak_core_wm_urlmap
would be modified to returnadditional information:
A link (in the HTML format) with relation "self" that identifies
the URL of the current node and its name:
This could also be represented in a similar fashion in the
Link
response header. If the node also has PB configured, it should
include similar links using the "alternate" relation.
Links for other known nodes in the cluster, listed in the
same fashion as the current node but using the "alternate"
relation.
If given the query string parameter
stream=true
, then updates tothe configuration will be streamed back to the client.
The JSON format of
riak_core_wm_urlmap
would change like so:Server Implementation
A new dedicated process on each node, probably called
riak_api_autoconfig
, will be added to broadcast, cache, and servelistener information among the cluster members. When receiving an
update from another node, the process will update its internal cache
and notify client-socket processes if the state has changed. Client
processes will filter the information according to the addresses that
are reachable from the peer (CIDR).
Existing code from
riak_repl
andriak_core
will be repurposed orrefactored to support detecting and filtering interfaces.
Additionally, base HTTP support will likely be moved into
riak_api
so that client-interface configuration can live in a single place.
TBD: Autoconfig information might also be affected by authorization, see #355.
Risks/Problems
proxy-load-balancer (e.g. HAProxy), in a sense making this feature
unneeded. The client should have an option to turn off or ignore
autoconfig, as well as disabling it server-side.
inet_gethost calls could needlessly dominate, assuming someone
bound an interface to a hostname rather than IP address. This could
get even stickier if administrators use round-robin DNS or VIP,
in which case autoconfig should likely be disabled.
wire when a node is not starting up or cleanly shutting down.
Network partitions between nodes could cause flappy and undesirable
behavior in clients.
The text was updated successfully, but these errors were encountered: