Custom Search

Sunday, March 15, 2015

OpenContrail Uses of ZooKeeper

In OpenContrail ZooKeeper is currently used for

1) master-election

* For schema-transformer: https://github.com/Juniper/contrail-controller/blob/master/src/config/schema-transformer/to_bgp.py#L3713

* For device-manager: https://github.com/Juniper/contrail-controller/blob/master/src/config/device-manager/device_manager/device_manager.py#L469

2) index-allocation

*IndexAllocator: https://github.com/Juniper/contrail-controller/blob/master/src/config/common/zkclient.py#L22

* In schema-transformer: https://github.com/Juniper/contrail-controller/blob/master/src/config/schema-transformer/to_bgp.py#L2526


* index-allocation is used for things like (virtual-network id for every VN, security-group id for every SG).There is a vn-id for every VN. this vn-id is sent across in bgp messages between control-node.

3) Arbitration reasons

* To convert fq-name to uuid when uuid not specified in requests.
* If there is 2 concurrent requests, api-server allocates/reserves a uuid in zk, that way only one create will succeed.

* create_fq_name_to_uuid_mapping: https://github.com/Juniper/contrail-controller/blob/master/src/config/api-server/vnc_cfg_ifmap.py#L1129

* ZookeeperClient: https://github.com/Juniper/contrail-controller/blob/master/src/config/common/zkclient.py#L181



No comments:

Post a Comment