Skip to content

Commit

Permalink
Corrected link, using pull request now.
Browse files Browse the repository at this point in the history
Added doc on sync-marks
  • Loading branch information
Sumit Jamgade committed Mar 28, 2017
1 parent 2a69f1e commit 5d362d3
Showing 1 changed file with 26 additions and 9 deletions.
35 changes: 26 additions & 9 deletions doc/barclamp.md
Original file line number Diff line number Diff line change
Expand Up @@ -1368,23 +1368,25 @@ to take care of your barclamp's needs.

## High Availability (HA) Integration

# TODO:
Things you need:

- Already tested barclamp waiting to be come HA compliant.
- A set of nodes ready to become cluster.



# TODO:
Define
- HA
- Pacemaker
- LSB



[This commit](https://github.com/crowbar/crowbar-openstack/commit/0d98286319bb35c4e8290801455536495f927d56?diff=unified) has more or less everything that makes a barclamp HA compatible. So we can just base our understanding around that commit.
[This commit](https://github.com/crowbar/crowbar-openstack/pull/512/files) has more or less everything that makes a barclamp HA compatible. So we can just base our understanding around that commit.

- [default.rb](https://github.com/crowbar/crowbar-openstack/commit/0d98286319bb35c4e8290801455536495f927d56?diff=unified#diff-f9a1e9d161032b6c0015336ab6812c14) This file defines the default for all the values of the vars required by barclamp.
- [default.rb](https://github.com/crowbar/crowbar-openstack/pull/512/files#diff-f9a1e9d161032b6c0015336ab6812c14) This file defines the default for all the values of the vars required by barclamp.

```ruby
default[:barbican][:ha]
Expand All @@ -1406,25 +1408,40 @@ default[:barbican][:ha]



- [barbican_service.rb](https://github.com/crowbar/crowbar-openstack/commit/0d98286319bb35c4e8290801455536495f927d56?diff=unified#diff-3f95710598349c27e4d1e79ba4cd7826)
- [barbican_service.rb](https://github.com/crowbar/crowbar-openstack/pull/512/files#diff-3f95710598349c27e4d1e79ba4cd7826)
Makes the installation of the service HA aware, by using [```provider Chef::Provider::CrowbarPacemakerService```](https://github.com/crowbar/crowbar-ha/blob/master/chef/cookbooks/crowbar-pacemaker/providers/service.rb) (Beware internal documentation on link) By adding that line we tell chef to use **service resource** from that provider and not the default one.

- [helpers.rb](https://github.com/crowbar/crowbar-openstack/commit/0d98286319bb35c4e8290801455536495f927d56?diff=unified#diff-744d98e238ae12f454d5f6e0781624d5)
- [helpers.rb](https://github.com/crowbar/crowbar-openstack/pull/512/files#diff-744d98e238ae12f454d5f6e0781624d5)
Here we define a helper class to initialize the variables/ports correctly ```if ha_enabled```

[api.rb](https://github.com/crowbar/crowbar-openstack/commit/0d98286319bb35c4e8290801455536495f927d56?diff=unified#diff-f9e37f7c8ba0f34831a43d2f89d87722)
- [api.rb](https://github.com/crowbar/crowbar-openstack/pull/512/files#diff-f9e37f7c8ba0f34831a43d2f89d87722), here we register the endpoint with keystone, using appropriate port.
```bash
If : not using ha, use the standard port
else: use port where ha is listening
...
bind api on correct port accordingly
```

[common.rb](https://github.com/crowbar/crowbar-openstack/pull/512/files#diff-fb3b92d9c323babdb9c28ba1a019c1de), common recipe is executed for all services and on all nodes of a cluster in parallel. So in case of ha, the db/user should only be created once, so make sure only ```cluster_founder```

To make sure the other nodes do not start accessing the database before the founder has created the database. **sync_marks** are created. This is part of the **crowbar_pacemaker** ([provider](https://github.com/crowbar/crowbar-ha/blob/master/chef/cookbooks/crowbar-pacemaker/providers/sync_mark.rb), [resource](https://github.com/crowbar/crowbar-ha/blob/master/chef/cookbooks/crowbar-pacemaker/resources/sync_mark.rb)) cookbook on the [crowbar-ha](https://github.com/crowbar/crowbar-ha)

These marks help provide synchronization between the nodes while chef is applying the states on the nodes. This synchronization can be of two types.

[common.rb](https://github.com/crowbar/crowbar-openstack/commit/0d98286319bb35c4e8290801455536495f927d56?diff=unified#diff-fb3b92d9c323babdb9c28ba1a019c1de)
- Wait and watch (**wait**-_ActionToBeDone_ - **create**-_ActionToBeDone_) ([example](https://github.com/crowbar/crowbar-openstack/blob/1718ebdcd5071ceac796744a33faaaddbdf71d73/chef/cookbooks/barbican/recipes/common.rb#L44-L101))
To be more precise these markers make sure that certain section of a cookbook which should be **entered and finished by founder node** and other nodes should wait until then.
All non-founder nodes wait till they see _ActionToBeDone_ while founder node keep going. It is upto the founder to do **create-_ActionToBeDone_**. So wait and create always go in **pairs**. And if founder does not do create-_ActionToBeDone_ non-founders will timeout.

- Wait and start together ([example](https://github.com/crowbar/crowbar-openstack/blob/1718ebdcd5071ceac796744a33faaaddbdf71d73/chef/cookbooks/glance/recipes/ha.rb#L46))
As the name says, let everyone reach here. No node can proceed unless all the other nodes have reached here.

[ha.rb](https://github.com/crowbar/crowbar-openstack/commit/0d98286319bb35c4e8290801455536495f927d56?diff=unified#diff-0605880109e91323b0a511b5506433ee)

[ha.rb](https://github.com/crowbar/crowbar-openstack/pull/512/files#diff-0605880109e91323b0a511b5506433ee)

[role_barbican_controller.rb](https://github.com/crowbar/crowbar-openstack/commit/0d98286319bb35c4e8290801455536495f927d56?diff=unified#diff-62c9844abda53dc328542cea19d7a1ef)

[role_barbican_controller.rb](https://github.com/crowbar/crowbar-openstack/pull/512/files#diff-62c9844abda53dc328542cea19d7a1ef)

[barbican_service.rb](https://github.com/crowbar/crowbar-openstack/commit/0d98286319bb35c4e8290801455536495f927d56?diff=unified#diff-5da3f802a2cc89670c00fd0f53ff10b2)
[barbican_service.rb](https://github.com/crowbar/crowbar-openstack/pull/512/files#diff-5da3f802a2cc89670c00fd0f53ff10b2)


## Help patch the existing barclamp

0 comments on commit 5d362d3

Please sign in to comment.