集群流控下,如何保障TokenServer高可用性
Issue Description
无论是采用alone还是embedded,当一台TokenServer挂了,是否有机制自动选择其他可用的Server。例如embedded时,如果机器A作为TokenServer挂了,必须要手动调用http://
Describe what happened (or what feature you want)
Describe what you expected to happen
How to reproduce it (as minimally and precisely as possible)
Tell us your environment
Anything else we need to know?
如果2台机器都设置成了TokenServer会怎样
如果2台机器都设置成了TokenServer会怎样
如果2台机器都设置成了Token Server会自动走本机
能否把TokenServer的功能移到redis,将统计数据保存到redis上面,这样可以避免TokenServer高可用性的问题,
I'm developing the ha solution for token server in cluster mode using zookeeper
这个肯定要借助于中间件了,无论是redis,zk或者也要考虑中间件的小概率故障事件,最好有本地缓存或者数据同步机制结合心跳来保证最大程度的可用性
这个肯定要借助于中间件了,无论是redis,zk或者也要考虑中间件的小概率故障事件,最好有本地缓存或者数据同步机制结合心跳来保证最大程度的可用性
zookeeper use zab to solve ha,redis use raft, they all have own ha solutions, don't worry
这个肯定要借助于中间件了,无论是redis,zk或者也要考虑中间件的小概率故障事件,最好有本地缓存或者数据同步机制结合心跳来保证最大程度的可用性
zookeeper use zab to solve ha,redis use raft, they all have own ha solutions, don't worry
But some times the redis and zk are also unstable, we met this couple times in production env.
It is unusual, but that is very terrible when it happens. The A of CAP is not real "A", even it use zab or raft for the middleware.
So it's better to monitor or check the middleware status and have a simple plan B to support the "A" when the middleware is not stable.
这个肯定要借助于中间件了,无论是redis,zk或者也要考虑中间件的小概率故障事件,最好有本地缓存或者数据同步机制结合心跳来保证最大程度的可用性
zookeeper use zab to solve ha,redis use raft, they all have own ha solutions, don't worry
But some times the redis and zk are also unstable, we met this couple times in production env.
It is unusual, but that is very terrible when it happens. The A of CAP is not real "A", even it use zab or raft for the middleware.
So it's better to monitor or check the middleware status and have a simple plan B to support the "A" when the middleware is not stable.
Zookeeper can push the available token server nodes to client, and then client cache the available nodes in local.
The following is my solution:
- When token server starting, connect zookeeper and add node listener, register itself to zookeeper
- Token client subscribe the directory of token server zk nodes
- Zookeeper listen the change of token server nodes, when a server unavailable, notify the last updated available nodes to token client, then client cache the available nodes in local
- After token client accept the flow request, get the available token server nodes from local cache ,and then load balance to select one node
@wchswchs How about things are going?
- zookeeper
i think token client should only connect to one tokenServer,if token client do load balance to connect to one tokenServer ,how to solve the problem of qps data sharing between different token server
@wchswchs 这个方案进展的怎么样? 有PR提出来吗?