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

nodeID cann't config when use Json #60

Open
takeseem opened this issue Jul 26, 2017 · 5 comments
Open

nodeID cann't config when use Json #60

takeseem opened this issue Jul 26, 2017 · 5 comments

Comments

@takeseem
Copy link

in join method nodeID = UUID.randomUUID().toString(), i think it is better in the conscutor.
Example:

  public ZookeeperClusterManager(JsonObject config) {
    this.conf = config;
    this.nodeID = config.getString("nodeID", UUID.randomUUID().toString());
  }

ZookeeperClusterManager.nodeId

@takeseem
Copy link
Author

my mind is:
nodeID: include my application id, ip and pid.
or
nodeData: will be set zookeeper node data path /io.vertx/cluster/nodes/mynode-uuid

when I monitor zookeeper, I can fast found my application by node's name or node's data

{
  nodeID: 'account-center#ip#pid#uuid',
  nodeData: '{appId: "account-center", ip: "192.168.1.2", pid: "1123"}'
}

@nabhosal
Copy link

nabhosal commented Jul 26, 2017

Hi @takeseem,
I resolved my issue by creating CustomZookeeperClusterManager class by extending ZookeeperClusterManager, it relies on unique node id passed from command line... I have attached code for you.

cmd options

-Dvertx.cluster.managerClass=<package path>.CustomZookeeperClusterManager 
-Dvertx.zookeeper.node=<node_name>

Hoping that it will help you.....

@stream-iori
Copy link
Contributor

nodeID be managed by vertx-zk-cluster, it can not be passed with config. I am not sure it's good idea that assign nodeID with user.

@nabhosal
Copy link

@stream1984 , We do agree its not a good idea to take nodeID from users. But, consider a deployment having a large number of service running then it becomes difficult for dev-ops to track which service is down even though we use zk watcher since UUID are non-intuitive.
We faced this issue in initial days, and we resolve by creating unique intuitive nodeIds.
Refer this fork, we are using this in our production
https://github.com/nabhosal/vertx-zookeeper

@jinke007
Copy link

in join method nodeID = UUID.randomUUID().toString(), i think it is better in the conscutor.
Example:

  public ZookeeperClusterManager(JsonObject config) {
    this.conf = config;
    this.nodeID = config.getString("nodeID", UUID.randomUUID().toString());
  }

ZookeeperClusterManager.nodeId

After zk is disconnected, the cluster node needs to be re-registered, but the nodeId in this join method is generated using UUID, so there is no way to re-register to zk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants