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

使用ImadcnIdentifierGenerator雪花算法生成id #22

Open
lj919374296 opened this issue Apr 27, 2023 · 3 comments
Open

使用ImadcnIdentifierGenerator雪花算法生成id #22

lj919374296 opened this issue Apr 27, 2023 · 3 comments

Comments

@lj919374296
Copy link

image
配置如下
image
两个不同的服务,注册zookeeper后生成的workerid 都是0,这样应该是会导致生成的id重复

@imadcn
Copy link
Owner

imadcn commented Apr 27, 2023

请提供配置文件,和使用的版本

@lj919374296
Copy link
Author

com.baomidou mybatis-plus 3.4.0 com.imadcn.framework idworker 1.5.0

@imadcn
Copy link
Owner

imadcn commented Apr 28, 2023

请确认是否是同一工程本地调试。节点注册时候会默认依赖本地缓存文件,同一工程调试时会读取到同一缓存文件,认为是同一个实例,以下为2种解决方案
1、删除本地缓存(默认在./tmp/idworker/GROUPNAME.cache)后,将程序放置于不同目录后,运行
2、升级至1.6.0版本,<idworker:generator />中,cacheable的值置为 false

其余配置,请查阅 README.MD

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

2 participants