<commit_before>InfraKit Flavor Plugin - Zookeeper
==================================

This is a plugin for handling Zookeeper ensemble.

## Running

Begin by building plugin [binaries](../../../README.md#binaries).

Start the [vagrant instance plugin](/example/instance/vagrant):

```
$ build/infrakit-instance-vagrant
INFO[0000] Listening on: unix:///run/infrakit/plugins/instance-vagrant.sock
INFO[0000] listener protocol= unix addr= /run/infrakit/plugins/instance-vagrant.sock err= <nil>
```

Start the [Group plugin](/cmd/group):

```
$ build/infrakit-group-default --log=5
DEBU[0000] Opening: /run/infrakit/plugins
DEBU[0000] Discovered plugin at unix:///run/infrakit/plugins/flavor-swarm.sock
DEBU[0000] Discovered plugin at unix:///run/infrakit/plugins/flavor-zookeeper.sock
DEBU[0000] Discovered plugin at unix:///run/infrakit/plugins/instance-file.sock
INFO[0000] Listening on: unix:///run/infrakit/plugins/group.sock
INFO[0000] listener protocol= unix addr= /run/infrakit/plugins/group.sock err= <nil>
```

Start Zookeeper flavor plugin:

```
$ build/infrakit-flavor-zookeeper
INFO[0000] Listening on: unix:///run/infrakit/plugins/flavor-zookeeper.sock
INFO[0000] listener protocol= unix addr= /run/infrakit/plugins/flavor-zookeeper.sock err= <nil>
```

Be sure to verify that the plugin is [discoverable](../../../cmd/cli/README.md#list-plugins).

Here's a JSON for the group we'd like to see [vagrant-zk-example.json](./vagrant-zk-example.json):

```
{
    "ID": "zk",
    "Properties": {
        "Instance" : {
            "Plugin": "instance-vagrant",
            "Properties": {
                "Box": "bento/ubuntu-16.04"
            }
        }
        "Flavor" : {
            "Plugin": "flavor-zookeeper",
            "Properties": {
                "type": "member",
                "IPs": ["192.168.1.200", "192.168.1.201", "192.168.1.202"]
            }
        }
    }
}
```

Now tell the group plugin to watch the zk group, create if necessary:

```
$ build/infrakit group --name group watch ./vagrant-zk-example.json
watching zk
```
<commit_msg>Fixing JSON in zookeeper README (#222)<commit_after>InfraKit Flavor Plugin - Zookeeper
==================================

This is a plugin for handling Zookeeper ensemble.

## Running

Begin by building plugin [binaries](../../../README.md#binaries).

Start the [vagrant instance plugin](/example/instance/vagrant):

```
$ build/infrakit-instance-vagrant
INFO[0000] Listening on: unix:///run/infrakit/plugins/instance-vagrant.sock
INFO[0000] listener protocol= unix addr= /run/infrakit/plugins/instance-vagrant.sock err= <nil>
```

Start the [Group plugin](/cmd/group):

```
$ build/infrakit-group-default --log=5
DEBU[0000] Opening: /run/infrakit/plugins
DEBU[0000] Discovered plugin at unix:///run/infrakit/plugins/flavor-swarm.sock
DEBU[0000] Discovered plugin at unix:///run/infrakit/plugins/flavor-zookeeper.sock
DEBU[0000] Discovered plugin at unix:///run/infrakit/plugins/instance-file.sock
INFO[0000] Listening on: unix:///run/infrakit/plugins/group.sock
INFO[0000] listener protocol= unix addr= /run/infrakit/plugins/group.sock err= <nil>
```

Start Zookeeper flavor plugin:

```
$ build/infrakit-flavor-zookeeper
INFO[0000] Listening on: unix:///run/infrakit/plugins/flavor-zookeeper.sock
INFO[0000] listener protocol= unix addr= /run/infrakit/plugins/flavor-zookeeper.sock err= <nil>
```

Be sure to verify that the plugin is [discoverable](../../../cmd/cli/README.md#list-plugins).

Here's a JSON for the group we'd like to see [vagrant-zk-example.json](./vagrant-zk-example.json):

```
{
    "ID": "zk",
    "Properties": {
        "Instance" : {
            "Plugin": "instance-vagrant",
            "Properties": {
                "Box": "bento/ubuntu-16.04"
            }
        },
        "Flavor" : {
            "Plugin": "flavor-zookeeper",
            "Properties": {
                "type": "member",
                "IPs": ["192.168.1.200", "192.168.1.201", "192.168.1.202"]
            }
        }
    }
}
```

Now tell the group plugin to watch the zk group, create if necessary:

```
$ build/infrakit group --name group watch ./vagrant-zk-example.json
watching zk
```

{'fraction_non_alphanumeric': 0.1728276524243879, 'fraction_numerical': 0.036725876140182426, 'mean_word_length': 3.158682634730539, 'pattern_counts': {'":': 18, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 6, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4208875', 'n_tokens_mistral': 1559, 'n_tokens_neox': 1378, 'n_words': 303}