-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Clustering, cache invalidation and event bus #729
Conversation
06b8921
to
067aad4
Compare
--["cluster"] = { | ||
-- ["bind"] = "0.0.0.0:7947", | ||
-- ["rpc-addr"] = "127.0.0.1:7374" | ||
--}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is currently a problem because of the YAML library we use. Related to lubyk/yaml#2.
I like this as a the default approach, especially useful to ensure nodes of the same cluster AND data store only can join together (to avoid conflicts when multiple clusters of different data stores are available) |
Auto-join would be also useful because the deployment method would be the same as Kong < 0.6.0 - so nothing new to learn. |
9d638d3
to
8938cd5
Compare
There is a problem with the |
there are ways to discover the machine's own IP ... but if course not accurately and not always successfully. we can start with that? and if not successful, requires manual configuration? |
7e492e0
to
2193fe4
Compare
|
898c686
to
56609df
Compare
f6b99a8
to
13a53f5
Compare
The different test suites and the way test/development running Kong need a different configuration file can be confusing at first, so this adds some more insight as to what is needed and why. Of course, this is the current system but nothing prevents it from being improved in the future.
3020790
to
f577a33
Compare
Cassandra from 3 to 2 during an update and a delete, it removed the possibility of updating and deleting APIs and Consumers by their name, because that change made it so the base_dao's underlying `delete()` and `update()` were directly used instead of first querying the entity. Querying the entity first allowed to retrieve its PRIMARY KEY fields, and hence `delete()` and `update()` never complained. But by removing this initial retrieving, we removed this feature, and **there were not tests** for it! - This adds test for PATCH/DELETE APIs and Consumers by name/username - Adds an argument to the base_dao `update()` and `delete()` to select by any field rather than only the PRIMARY KEY fields.
Fix for issue #393 for response-transformer motivated fix for this plugin too. New config append/replace added to support adding new value to existing header/querystring and replcaing existing header/querystring with new value.
Now add will only add header/json if it does not exist, config `append` added to support adding new value to existing header/json. If header does not exist, a new one will be added. config `replace added to replace the value of existing header/json with new value
…Events - Invalidations
The different test suites and the way test/development running Kong need a different configuration file can be confusing at first, so this adds some more insight as to what is needed and why. Of course, this is the current system but nothing prevents it from being improved in the future.
feb6e0e
to
5ab02aa
Compare
7f539c6
to
d6633e9
Compare
Merged with 4720b7b |
Note: Running this PR requires having serf installed into
/usr/local/bin/serf
.This PR implements an invalidation strategy (#15), and for doing so it also implements the following features/improvements:
/cache/
endpoint for retrieving elements stored in the in-memory cache of a node./cluster/
endpoint used to add/remove/list members of the cluster, and also used internally for data propagation.kong cluster <command>
.kong status
command that checks the status of all the Kong services./oauth2_tokens/
with the possibility to retrieve, update or delete OAuth 2.0 access tokens.marshall_event
function as an option to the schemas used to define which properties to send to the cluster. Required to improve the performance (smaller data means greater network performance) and because there is a hard limit of 512 bytes to the payload that can be sent across the cluster (because the data needs to fit inside a UDP packet).nodes
table for the auto-join feature.TODO
I am not happy by the output of the CLI, I will need to do a minor enhancement for this (also to disable it from the tests).Cluster auto-join feature, by storing the active machines in a Cassandra table and listen to Serf events to add/remove the nodes from that table (as long as the nodes point to the same datastore they will auto-join themselves). Maybe this feature could be enabled/disabled by anautojoin: true
property in the configuration.