-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
How to join cluster #1592
Comments
I used |
I'm solving the problem. Becuase ser2 is ser1's copy , so the serf.id is the same with ser1. The serf.id is not change with kong's start that not good enough. |
@seedotlee what do you mean by "serf.id" ? |
@thefosk |
@seedotlee you would need to specify different
and
|
@thefosk |
It could be that you have the same hostname for both machines, and that the random part of this line: https://github.com/Mashape/kong/blob/master/kong/cmd/utils/prefix_handler.lua#L218 is actually not so random since from what I can tell, the random number generator is not seeded when invoked from the CLI, hence both nodes generate the same uuid. If you could add some debug statement right there and confirm with us that they are both generating the same uuid (and that you have the same hostname on both nodes), then I would qualify this as a bug. The fix would be to - properly - seed the random number generation. This is definitely tricky with Lua but once done right, the random numbers are of good quality (with the LuaJIT implementation, especially). |
@thibaultcha this could be a problem. Do we need a specific patch for this in 0.9.2? We should also check everywhere where |
If spawning multiple nodes at once (making use of the CLI from different host machines), we need to make sure none of them are using the same seed. To enforce this, we make use of the patched 'math.randomseed()' function, which should greatly reduce the probability of seed collision. To allow for this change, we need a special flag indicating our scripts if we are running inside of our CLI, so that out 'math.randomseed()' does not complain about being called in resty-cli's 'timer' context. * add `ngx.RESTY_CLI` flag in `bin/kong` * add an edge case in our patched `math.randomseed()` * apply `kong.core.globalpatches` to our CLI environment Fix #1592
Should be fixed with #1641, to be released in 0.9.2, thanks for reporting. |
If spawning multiple nodes at once (making use of the CLI from different host machines), we need to make sure none of them are using the same seed. To enforce this, we make use of the patched 'math.randomseed()' function, which should greatly reduce the probability of seed collision. To allow for this change, we need a special flag indicating our scripts if we are running inside of our CLI, so that out 'math.randomseed()' does not complain about being called in resty-cli's 'timer' context. * add `ngx.RESTY_CLI` flag in `bin/kong` * add an edge case in our patched `math.randomseed()` * apply `kong.core.globalpatches` to our CLI environment Fix #1592
Summary
I have 2 servers ,call them ser1 and ser2.
I started ser1 with config
After, I started ser2 with config
Two servers can visited, but I get
http://1.1.1.1:8001/cluster
just 1 cluster.Using cluster should I pay attention to ?
Additional Details & Logs
0.9.0
)The text was updated successfully, but these errors were encountered: