Skip to content
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

多台服务器的时候生成的 ID 会重复。 #99

Open
xtuer opened this issue Nov 1, 2024 · 0 comments
Open

多台服务器的时候生成的 ID 会重复。 #99

xtuer opened this issue Nov 1, 2024 · 0 comments

Comments

@xtuer
Copy link

xtuer commented Nov 1, 2024

  1. 写一个测试接口。
  2. 访问接口生成 1000 个 ID,然后保存到数据库,ID 作为主键。
  3. 同样的服务启动 2 个,使用 Nginx 做负载均衡。
  4. 不停的访问这个接口,然后就会看到提示主键冲突: Duplicate entry '1508919604150272' for key 'test_id.PRIMARY'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant