Skip to content

Level 3: Add an Operator

Before going through this guide, ensure you went through the level 2 : Storm.

This tutorial explains how to add an operator environment to your existing platform. This environment allows an operator (you) to define channels, start storm topologies, to debug zookeeper etc...

Once again, the deployer can be your macos or linux laptop. The starting situation is unchanged:

image

Configure Operator

Edit first the punchplatform-deployment.settings with your favorite text editor file and include the following content

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
"punchplatform_operator" : {
    "configuration_name_dir_from_home" : "pp-conf",
    "punchplatform_conf_url" : "localhost:2181/punchplatform-development",
    "operators_username" : ["operator1"],
    "servers" : {
        "server1" : {}
    }
},
"punchplatform_operator_environment_version": "punchplatform-operator-environment-5.5.1",
"punchplatform_conf_repo_git_local_url": "/data/git_bare.git",

To get more details on each subsection, please read the punchplatform-deployment.settings documentation.

Info

This configuration will create a user operator1 and configure its environment variables to get punch commands.

Info

Adapt the properties to suit your environment in particular the zookeeper_nodes_production_interface, as well as unix user and groups.

For example if you use a vagrant box the user is likely to be 'ubuntu' and the network interface 'enp0s8'. In doubt you can find out what is the right network intefaces using the ifconfig command.

Make sure you have the requirements installed on the deployer and target servers. In particular the deployer must have ssh access to the target server.

Prerequisites

There is several ways to configure operators. For the tutorial purpose, the previous configuration is the lightest one.

To manage the punch configuration, we have to create manually a git bare repository

Warning

This procedure works only when operator environment are located on a single device (for instance for testing).

on server1

1
2
3
4
5
ssh server1
cd /data
sudo git init --bare --shared=group pp_conf_bare.git
sudo chgrp -R punchplatform pp_conf_bare.git
exit

on deployer device

1
2
3
4
5
6
cd $PUNCHPLATFORM_CONF_DIR
git init .
git add .
git commit -m "my first commit"
git remote add origin ssh://server1:/data/pp_conf_bare.git
git push origin master

Check and Generate Your Configurations

First execute this command:

1
$ punchplatform-deployer.sh generate-ansible-inventory

Or in short:

1
$ punchplatform-deployer.sh -g

This command generates a complete set of so-called inventories from your two configuration files. It should output something like this:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
$ punchplatform-deployer.sh -g
LOG: checking your dependencies...
LOG: all the required packages are installed !

LOG: audit the punchplatform configuration...
LOG: found punchplatform.properties: /Users/dimi/Punch/deployer/conf/punchplatform.properties
LOG: found punchplatform-deployment.settings: /Users/dimi/Punch/deployer/conf/punchplatform-deployment.settings

LOG: generating deployment configuration from punchplatform.properties + punchplatform-deployment.settings...
LOG: Following groups and tags can bu used as additional parameters like: punchplatform-deployer.sh deploy [-Kk] [-l group1,group2] [-t tag1,tag2]
  - group: punchplatform_cluster     tag: N/A
  - group: N/A     tag: operator
  - group: zookeeper_servers      tag: zookeeper
  - group: storm_servers      tag: storm

LOG: configuration is ready for the deployment !

If that suceeds you can proceed.

Deploy Your Component(s)

From the deployer, make sure you can access your target server using ssh. Depending on your ssh configuration this may require a ssh password. Simply execute the following command.

1
punchplatform-deployer.sh deploy -Kk --tags operator

Note

You will be prompted (or not) for a ssh password. This depends on your ssh configuration.

Check your deployment

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
ssh server1
sudo su - operator1
cd $PUNCHPLATFORM_CONF_DIR

# Retrieve the reference configuration (that you have put from the deployment environment)
punchplatform-getconf.sh -pf 

ls
# You should have the punchplatform.properties:

# Now check  your available operator environment
punchplatform-version.sh

you should have an output indicating your operator environment version. e.g.:

1
2
PunchPlatform package:
punchplatform-operator-environment-5.4.0