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

How to verify the legitimacy of a member? #1102

Closed
funky-eyes opened this issue Apr 22, 2024 · 2 comments
Closed

How to verify the legitimacy of a member? #1102

funky-eyes opened this issue Apr 22, 2024 · 2 comments

Comments

@funky-eyes
Copy link
Contributor

Your question

请问如何初始化raft集群时,对彼此的身份进行验证?然后进行增删节点时,该节点也必须是通过某种校验后,合法节点再纳入集群中。
When initializing a raft cluster, how to verify each other's identities? Then when adding or deleting nodes, the nodes must also pass some kind of verification before the legitimate nodes are included in the cluster.

Your scenes

防止生产环境中错误增加一个成员,比如ip错误,或者将其他的raft集群中的成员写入到该集群的成员中,以免造成一些未知影响,实际上应该不会有什么问题,只不过每次只有加入进去了,看日志才能看出来加入的节点有问题之类的,无法在调用changepeers,addpeers等等场景时,就能给出一个明确反馈该成员不合法的信息或异常。
To prevent errors in the production environment from adding a member, such as an incorrect IP or inadvertently adding a member from another Raft cluster to the current one, thereby avoiding potential unknown consequences. In reality, there shouldn't be any issues, but it's difficult to detect problems with newly added nodes until inspecting the logs. It's not feasible to provide immediate feedback indicating that a member is invalid when calling functions like changepeers or addpeers. However, it would be beneficial to have a clear indication or exception that the member is invalid.

Your advice

Environment

  • SOFAJRaft version:
  • JVM version (e.g. java -version):
  • OS version (e.g. uname -a):
  • Maven version:
  • IDE version:
@killme2008
Copy link
Contributor

这个难道不是应用层才知道的信息吗? 你们自己封装一层 addPeer, ChangePeer 的 API,在那边做校验就可以了。

从 jraft 角度来看,只要这个 peer 不在当前 conf ,就可以允许添加的,他不知道这个peer 是不是非法的,或者其他 group 的,这个只有应用知道。

@funky-eyes
Copy link
Contributor Author

这个难道不是应用层才知道的信息吗? 你们自己封装一层 addPeer, ChangePeer 的 API,在那边做校验就可以了。

从 jraft 角度来看,只要这个 peer 不在当前 conf ,就可以允许添加的,他不知道这个peer 是不是非法的,或者其他 group 的,这个只有应用知道。

是可以应用层来做处理,但是换个角度像,千人千面的实现感觉不太标准,如果jraft有一个统一的api便于用户扩展,那实现起来的话会比较标准规范,出问题的概率也比较小。

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