-
Notifications
You must be signed in to change notification settings - Fork 363
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
java中workerId的数据类型short最大值是32767,要是服务集群部署,每个节点分配一个用不了多久就达到最大值了吧 #83
Comments
你的服务器集群,容器启动个数,会超过32700个吗? |
当然会了,我们现在就是扩位的,16位,用IP最后两位,最大长度是2^16-1,short在这里不合理,对于java来说,java都是有符号位的。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
项目中使用redis自增的方式为微服务集群每个节点动态分配workerId值,就是每次服务启动的时候采用redis从0开始自增获取workerId,
要是集群规模比较大的话,用不了多久这个workerId就能达到short最大值了吧,难道要重新把它刷到0开始自增吗
The text was updated successfully, but these errors were encountered: