Skip to content

Level 1: Getting Started

The punchplatform deployment tools are powerful and modular. It is possible (and recommended) to start small and add more components or resources as you go, in particular if you discover the punchplatform and are not sure yet what will be your use case(s).

This chapter focuses on explaining the logic of deploying a single component (zookeeper) and setting up a platform operator. Once these are clear, it will be very simple for you to add more components and operators to compose your final platform.

We assume you have three target empty servers (server1, server2 and server3) where you will deploy a cluster of 3 zookeeper servers, and an operator on server1. We will do that from the deployer server, acting as the installer laptor .

The deployer can be your macos or linux laptop. Here is the starting situation.

image

Deploy the platform

You must now precisely define your platform by selecting the component you need. This is easy if you work with a ready-to-use package as all the choices have been made for you.

In case you selected the full deployer package it is your task to create and fill two files:

We strongly suggest you try first the tutorials, they will help you progress step by step:

These pages may also interest you:

Configure Zookeeper

Edit first the punchplatform.properties with your favorite text editor file and include the following content

{
  "zookeeper" : {
    "clusters" : {
      "common" : {
        "hosts" : ["server1", "server2", "server3"],
        "cluster_port" : 2181,
        "punchplatform_root_node" : "/punchplatform"
      }
    },
    "install_dir": "/data/opt/apache-zookeeper-3.5.5-bin"
  }
}

Next edit the punchplatform-deployment.settings file and include the following:

{
  "setups_root" : "/data/opt",
  "remote_data_root_directory" : "/data",
  "remote_logs_root_directory" : "/var/log/punchplatform",
  "punchplatform_daemons_user" : "punchplatform",
  "punchplatform_group" : "punchplatform",
  "zookeeper_version" : "apache-zookeeper-3.5.5-bin",
  "zookeeper_nodes_production_interface" : "eth1",
  "zookeeper_admin_cluster_name": "common",
  "zookeeper_childopts" : "-server -Xmx256m -Xms256m"
}

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.

Check and Generate Your Configurations

First execute this command:

punchplatform-deployer.sh --generate-inventory

Or in short:

punchplatform-deployer.sh -gi

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

punchplatform-deployer.sh --generate-inventory
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: zookeeper_servers      tag: zookeeper

LOG: configuration is ready for the deployment !

If that succeeds 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.

punchplatform-deployer.sh --deploy -Kk --tags zookeeper

Note

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

Check your deployment

ssh server1

systemctl status zookeeper
● zookeeper.service - Punchplatform Zookeeper
   Loaded: loaded (/lib/systemd/system/zookeeper.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2020-02-15 17:30:10 UTC; 5h 17min ago

This only confirm that the zookeeper server process is launched with Active: active (running) message.

In order to confirm the overall zookeeper cluster status, you can refer to Zookeeper status checking HOWTO.

If your zookeeper cluster is UP, then you can push the first version of your reference platform configuration :

 punchplatform-putconf.sh -zkn common -pf

Note than from a deployed operator environment, the -zkn common options would not be needed, because the operator environment have the PUNCHPLATFORM_CONF_URL set to provide the admin zookeeper instance connection string.

Add more components

We suggest you now add a Storm r Kafka cluster to your platform. For this refer to the punchplatform.properties and punchplatform_deployment.settings. Add in each file the required properties and simply reexecute the deployer.

punchplatform-deployer.sh --deploy -Kk --tags storm
You are ready to go.